From: nobody <> Date: Mon, 5 Jun 2000 20:49:54 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'gdb- X-Git-Tag: gdb-premipsmulti-2000-06-06-branchpoint X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37f7f684de0e53c8add5ff43d73082bf98985321;p=thirdparty%2Fbinutils-gdb.git This commit was manufactured by cvs2svn to create branch 'gdb- premipsmulti-2000-06-06-branch'. Sprout from gdb_5_0-2000-04-10-branch 2000-04-09 14:37:29 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2000-06-05 20:49:53 UTC Daniel Berlin 'C++ improvements': ChangeLog MAINTAINERS Makefile.in bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/aoutx.h bfd/archive.c bfd/archures.c bfd/bfd-in.h bfd/bfd-in2.h bfd/cache.c bfd/coff-a29k.c bfd/coff-alpha.c bfd/coff-go32.c bfd/coff-ia64.c bfd/coff-mips.c bfd/coff-pmac.c bfd/coff-rs6000.c bfd/coff-sh.c bfd/coff-stgo32.c bfd/coff-tic54x.c bfd/coff64-rs6000.c bfd/coffcode.h bfd/coffgen.c bfd/coffswap.h bfd/config.bfd bfd/configure bfd/configure.host bfd/configure.in bfd/cpu-i960.c bfd/cpu-ia64-opc.c bfd/cpu-ia64.c bfd/cpu-powerpc.c bfd/dep-in.sed bfd/doc/ChangeLog bfd/doc/bfdint.texi bfd/dwarf2.c bfd/efi-app-ia32.c bfd/efi-app-ia64.c bfd/elf-bfd.h bfd/elf-hppa.h bfd/elf.c bfd/elf32-arm.h bfd/elf32-d30v.c bfd/elf32-fr30.c bfd/elf32-hppa.c bfd/elf32-hppa.h bfd/elf32-i370.c bfd/elf32-i386.c bfd/elf32-m68k.c bfd/elf32-mcore.c bfd/elf32-mips.c bfd/elf32-ppc.c bfd/elf32-sh.c bfd/elf32-sparc.c bfd/elf64-alpha.c bfd/elf64-hppa.c bfd/elf64-hppa.h bfd/elf64-ia64.c bfd/elf64-sparc.c bfd/elfcode.h bfd/elflink.c bfd/elflink.h bfd/ieee.c bfd/libbfd-in.h bfd/libbfd.c bfd/libbfd.h bfd/libcoff.h bfd/libhppa.h bfd/libpei.h bfd/opncls.c bfd/peicode.h bfd/peigen.c bfd/po/POTFILES.in bfd/ppcboot.c bfd/reloc.c bfd/som.c bfd/sysdep.h bfd/targets.c bfd/trad-core.c bfd/versados.c bfd/vms.c bfd/xcoff-target.h bfd/xcofflink.c config.guess config.sub configure configure.in djunpack.bat gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/README gdb/TODO gdb/abug-rom.c gdb/acconfig.h gdb/aclocal.m4 gdb/alpha-nat.c gdb/alpha-tdep.c gdb/alphabsd-nat.c gdb/annotate.c gdb/annotate.h gdb/arc-tdep.c gdb/arch-utils.c gdb/arch-utils.h gdb/arm-linux-nat.c gdb/arm-linux-tdep.c gdb/arm-tdep.c gdb/ax-gdb.c gdb/ax-gdb.h gdb/ax-general.c gdb/ax.h gdb/bcache.c gdb/bcache.h gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/c-exp.y gdb/c-lang.c gdb/c-lang.h gdb/c-valprint.c gdb/call-cmds.h gdb/ch-exp.c gdb/ch-lang.c gdb/ch-lang.h gdb/cli-out.c gdb/coff-solib.h gdb/coffread.c gdb/command.c gdb/command.h gdb/complaints.c gdb/complaints.h gdb/config.in gdb/config/a29k/tm-a29k.h gdb/config/a29k/tm-vx29k.h gdb/config/alpha/alpha-osf3.mh gdb/config/alpha/fbsd.mh gdb/config/alpha/fbsd.mt gdb/config/alpha/nm-fbsd.h gdb/config/alpha/nm-linux.h gdb/config/alpha/nm-osf.h gdb/config/alpha/nm-osf2.h gdb/config/alpha/tm-alpha.h gdb/config/alpha/tm-alphalinux.h gdb/config/alpha/tm-fbsd.h gdb/config/alpha/xm-fbsd.h gdb/config/arc/tm-arc.h gdb/config/arm/linux.mh gdb/config/arm/nm-linux.h gdb/config/arm/tm-arm.h gdb/config/arm/tm-embed.h gdb/config/arm/tm-linux.h gdb/config/convex/tm-convex.h gdb/config/d10v/tm-d10v.h gdb/config/d30v/tm-d30v.h gdb/config/djgpp/README gdb/config/djgpp/config.sed gdb/config/djgpp/djconfig.sh gdb/config/djgpp/fnchange.lst gdb/config/fr30/tm-fr30.h gdb/config/h8300/tm-h8300.h gdb/config/h8500/tm-h8500.h gdb/config/i386/fbsd.mh gdb/config/i386/fbsd.mt gdb/config/i386/nbsd.mh gdb/config/i386/nbsd.mt gdb/config/i386/nbsdelf.mh gdb/config/i386/nbsdelf.mt gdb/config/i386/nm-fbsd.h gdb/config/i386/nm-i386bsd.h gdb/config/i386/nm-i386sco.h gdb/config/i386/nm-i386sol2.h gdb/config/i386/nm-i386v.h gdb/config/i386/nm-linux.h gdb/config/i386/nm-nbsd.h gdb/config/i386/nm-nbsdelf.h gdb/config/i386/nm-ptx4.h gdb/config/i386/nm-symmetry.h gdb/config/i386/tm-cygwin.h gdb/config/i386/tm-fbsd.h gdb/config/i386/tm-i386.h gdb/config/i386/tm-i386nw.h gdb/config/i386/tm-i386sol2.h gdb/config/i386/tm-i386v.h gdb/config/i386/tm-i386v4.h gdb/config/i386/tm-nbsd.h gdb/config/i386/tm-nbsdelf.h gdb/config/i386/tm-ptx.h gdb/config/i386/tm-sun386.h gdb/config/i386/xm-fbsd.h gdb/config/i960/tm-i960.h gdb/config/i960/tm-mon960.h gdb/config/i960/tm-nindy960.h gdb/config/ia64/linux.mt gdb/config/ia64/nm-linux.h gdb/config/ia64/tm-linux.h gdb/config/m32r/tm-m32r.h gdb/config/m68k/nbsd.mh gdb/config/m68k/nbsd.mt gdb/config/m68k/nm-dpx2.h gdb/config/m68k/nm-linux.h gdb/config/m68k/tm-altos.h gdb/config/m68k/tm-cisco.h gdb/config/m68k/tm-delta68.h gdb/config/m68k/tm-es1800.h gdb/config/m68k/tm-isi.h gdb/config/m68k/tm-linux.h gdb/config/m68k/tm-m68k.h gdb/config/m68k/tm-m68kv4.h gdb/config/m68k/tm-news.h gdb/config/m68k/tm-sun3.h gdb/config/m68k/tm-vx68.h gdb/config/m68k/xm-hp300bsd.h gdb/config/m88k/tm-m88k.h gdb/config/mcore/tm-mcore.h gdb/config/mips/nm-irix3.h gdb/config/mips/nm-irix4.h gdb/config/mips/nm-irix5.h gdb/config/mips/nm-mips.h gdb/config/mips/tm-embed.h gdb/config/mips/tm-irix5.h gdb/config/mips/tm-mips.h gdb/config/mips/tm-mipsv4.h gdb/config/mn10200/tm-mn10200.h gdb/config/mn10300/tm-mn10300.h gdb/config/nm-linux.h gdb/config/nm-lynx.h gdb/config/ns32k/nbsd.mh gdb/config/ns32k/nbsd.mt gdb/config/ns32k/nm-nbsd.h gdb/config/ns32k/tm-merlin.h gdb/config/ns32k/tm-umax.h gdb/config/pa/nm-hppah.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/pa/xm-hppah.h gdb/config/powerpc/nbsd.mh gdb/config/powerpc/nbsd.mt gdb/config/powerpc/nm-linux.h gdb/config/powerpc/nm-nbsd.h gdb/config/powerpc/tm-linux.h gdb/config/powerpc/tm-nbsd.h gdb/config/powerpc/tm-ppc-eabi.h gdb/config/powerpc/tm-solaris.h gdb/config/powerpc/xm-aix.h gdb/config/powerpc/xm-nbsd.h gdb/config/rs6000/nm-rs6000.h gdb/config/rs6000/tm-rs6000.h gdb/config/rs6000/xm-rs6000.h gdb/config/sh/tm-sh.h gdb/config/sh/tm-wince.h gdb/config/sparc/nm-linux.h gdb/config/sparc/nm-sun4os4.h gdb/config/sparc/nm-sun4sol2.h gdb/config/sparc/tm-sp64.h gdb/config/sparc/tm-sp64sim.h gdb/config/sparc/tm-sparc.h gdb/config/sparc/tm-sparclet.h gdb/config/sparc/tm-sparclite.h gdb/config/sparc/tm-spc-em.h gdb/config/sparc/tm-sun4os4.h gdb/config/sparc/tm-sun4sol2.h gdb/config/sparc/xm-sun4sol2.h gdb/config/tahoe/tm-tahoe.h gdb/config/tic80/tm-tic80.h gdb/config/tm-sysv4.h gdb/config/v850/tm-v850.h gdb/config/vax/tm-vax.h gdb/config/w65/tm-w65.h gdb/config/xm-aix4.h gdb/config/z8k/tm-z8k.h gdb/configure gdb/configure.host gdb/configure.in gdb/configure.tgt gdb/copying.c gdb/core-aout.c gdb/core-regset.c gdb/core-sol2.c gdb/corefile.c gdb/corelow.c gdb/cp-valprint.c gdb/cpu32bug-rom.c gdb/cxux-nat.c gdb/d10v-tdep.c gdb/d30v-tdep.c gdb/dbug-rom.c gdb/dbxread.c gdb/dcache.c gdb/dcache.h gdb/defs.h gdb/demangle.c gdb/dink32-rom.c gdb/doc/ChangeLog gdb/doc/Makefile.in gdb/doc/annotate.texi gdb/doc/configure gdb/doc/configure.in gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/stabs.texinfo gdb/dsrec.c gdb/dstread.c gdb/dve3900-rom.c gdb/dwarf2read.c gdb/dwarfread.c gdb/elfread.c gdb/environ.h gdb/eval.c gdb/event-top.c gdb/exec.c gdb/expprint.c gdb/expression.h gdb/f-exp.y gdb/f-lang.c gdb/f-lang.h gdb/f-valprint.c gdb/findvar.c gdb/fork-child.c gdb/fr30-tdep.c gdb/frame.h gdb/gdb-stabs.h gdb/gdb_dirent.h gdb/gdb_string.h gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbcmd.h gdb/gdbcore.h gdb/gdbserver/low-nbsd.c gdb/gdbserver/remote-utils.c gdb/gdbserver/server.h gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-regex.c gdb/go32-nat.c gdb/gregset.h gdb/h8300-tdep.c gdb/hp-psymtab-read.c gdb/hp-symtab-read.c gdb/hp300ux-nat.c gdb/hppa-tdep.c gdb/hppah-nat.c gdb/hpread.c gdb/hpread.h gdb/hpux-thread.c gdb/i386-linux-nat.c gdb/i386-tdep.c gdb/i386aix-nat.c gdb/i386bsd-nat.c gdb/i386mach-nat.c gdb/i386v-nat.c gdb/i386v4-nat.c gdb/i387-nat.c gdb/i387-nat.h gdb/i387-tdep.c gdb/i960-tdep.c gdb/ia64-linux-nat.c gdb/ia64-linux-tdep.c gdb/ia64-tdep.c gdb/infcmd.c gdb/inferior.h gdb/inflow.c gdb/infptrace.c gdb/infrun.c gdb/inftarg.c gdb/irix4-nat.c gdb/irix5-nat.c gdb/jv-exp.y gdb/jv-lang.c gdb/jv-lang.h gdb/jv-valprint.c gdb/language.c gdb/language.h gdb/lin-thread.c gdb/linux-thread.c gdb/lynx-nat.c gdb/m2-exp.y gdb/m2-lang.c gdb/m2-lang.h gdb/m32r-rom.c gdb/m68k-tdep.c gdb/m68klinux-nat.c gdb/m88k-nat.c gdb/mac-nat.c gdb/main.c gdb/maint.c gdb/mdebugread.c gdb/mem-break.c gdb/mi/ChangeLog gdb/mi/gdbmi.texinfo gdb/mi/mi-cmd-break.c gdb/mi/mi-cmd-disas.c gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmd-var.c gdb/mi/mi-cmds.c gdb/mi/mi-cmds.h gdb/mi/mi-console.c gdb/mi/mi-console.h gdb/mi/mi-getopt.c gdb/mi/mi-getopt.h gdb/mi/mi-main.c gdb/mi/mi-out.c gdb/mi/mi-out.h gdb/mi/mi-parse.c gdb/mi/mi-parse.h gdb/minsyms.c gdb/mips-nat.c gdb/mips-tdep.c gdb/mipsread.c gdb/mipsv4-nat.c gdb/mn10300-tdep.c gdb/mon960-rom.c gdb/monitor.c gdb/monitor.h gdb/nlmread.c gdb/objfiles.c gdb/objfiles.h gdb/ocd.c gdb/ocd.h gdb/op50-rom.c gdb/os9kread.c gdb/osfsolib.c gdb/pa64solib.c gdb/pa64solib.h gdb/parse.c gdb/parser-defs.h gdb/partial-stab.h gdb/ppc-bdm.c gdb/ppc-linux-nat.c gdb/ppcnbsd-nat.c gdb/printcmd.c gdb/proc-api.c gdb/proc-events.c gdb/proc-utils.h gdb/procfs.c gdb/ptx4-nat.c gdb/remote-array.c gdb/remote-bug.c gdb/remote-e7000.c gdb/remote-es.c gdb/remote-est.c gdb/remote-hms.c gdb/remote-mips.c gdb/remote-nindy.c gdb/remote-nrom.c gdb/remote-os9k.c gdb/remote-rdi.c gdb/remote-rdp.c gdb/remote-sds.c gdb/remote-sim.c gdb/remote-udi.c gdb/remote-utils.c gdb/remote-utils.h gdb/remote-vx.c gdb/remote.c gdb/rom68k-rom.c gdb/rs6000-nat.c gdb/rs6000-tdep.c gdb/scm-exp.c gdb/scm-lang.c gdb/scm-lang.h gdb/ser-e7kpc.c gdb/ser-go32.c gdb/ser-mac.c gdb/ser-ocd.c gdb/serial.c gdb/sh-tdep.c gdb/sh3-rom.c gdb/sol-thread.c gdb/solib.c gdb/solib.h gdb/somread.c gdb/somsolib.c gdb/somsolib.h gdb/source.c gdb/sparc-nat.c gdb/sparc-tdep.c gdb/sparcl-tdep.c gdb/sparclet-rom.c gdb/srec.h gdb/stabsread.c gdb/stabsread.h gdb/stack.c gdb/sun3-nat.c gdb/symfile.c gdb/symfile.h gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/terminal.h gdb/testsuite/ChangeLog gdb/testsuite/gdb.base/annota1.exp gdb/testsuite/gdb.base/break.exp gdb/testsuite/gdb.base/call-ar-st.exp gdb/testsuite/gdb.base/call-rt-st.exp gdb/testsuite/gdb.base/call-strs.exp gdb/testsuite/gdb.base/ending-run.exp gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.base/interrupt.exp gdb/testsuite/gdb.base/miscexprs.exp gdb/testsuite/gdb.base/step-test.exp gdb/testsuite/gdb.base/structs2.c gdb/testsuite/gdb.c++/Makefile.in gdb/testsuite/gdb.c++/ctti.exp gdb/testsuite/gdb.c++/misc.cc gdb/testsuite/gdb.c++/namespace.exp gdb/testsuite/gdb.c++/templates.cc gdb/testsuite/gdb.c++/templates.exp gdb/testsuite/gdb.mi/ChangeLog-mi gdb/testsuite/gdb.mi/Makefile.in gdb/testsuite/lib/compiler.cc gdb/thread.c gdb/top.c gdb/top.h gdb/tracepoint.c gdb/tracepoint.h gdb/tui/ChangeLog gdb/tui/tui-file.c gdb/tui/tui.c gdb/tui/tui.h gdb/tui/tuiCommand.h gdb/tui/tuiData.c gdb/tui/tuiData.h gdb/tui/tuiDataWin.h gdb/tui/tuiDisassem.c gdb/tui/tuiDisassem.h gdb/tui/tuiGeneralWin.c gdb/tui/tuiGeneralWin.h gdb/tui/tuiIO.c gdb/tui/tuiIO.h gdb/tui/tuiLayout.c gdb/tui/tuiLayout.h gdb/tui/tuiRegs.c gdb/tui/tuiRegs.h gdb/tui/tuiSource.c gdb/tui/tuiSource.h gdb/tui/tuiSourceWin.h gdb/tui/tuiStack.c gdb/tui/tuiStack.h gdb/tui/tuiWin.c gdb/tui/tuiWin.h gdb/typeprint.c gdb/ui-file.c gdb/ui-out.c gdb/ui-out.h gdb/ultra3-nat.c gdb/utils.c gdb/uw-thread.c gdb/v850-tdep.c gdb/v850ice.c gdb/valarith.c gdb/valops.c gdb/valprint.c gdb/value.h gdb/values.c gdb/varobj.c gdb/w89k-rom.c gdb/win32-nat.c gdb/wince-stub.c gdb/wince.c gdb/wrapper.c gdb/wrapper.h gdb/xcoffread.c gdb/xcoffsolib.c gdb/xcoffsolib.h gdb/xmodem.h gdb/z8k-tdep.c include/ChangeLog include/bfdlink.h include/coff/ChangeLog include/coff/ia64.h include/coff/internal.h include/coff/pe.h include/coff/rs6k64.h include/coff/ti.h include/dis-asm.h include/elf/ChangeLog include/elf/common.h include/elf/ia64.h include/elf/mips.h include/elf/mn10300.h include/elf/reloc-macros.h include/filenames.h include/floatformat.h include/opcode/ChangeLog include/opcode/cgen.h include/opcode/d10v.h include/opcode/h8300.h include/opcode/hppa.h include/opcode/i386.h include/opcode/ia64.h include/opcode/ppc.h include/opcode/tic54x.h libiberty/ChangeLog libiberty/Makefile.in libiberty/floatformat.c libiberty/hashtab.c libiberty/objalloc.c libiberty/partition.c libiberty/pexecute.c libiberty/sort.c libiberty/strerror.c libiberty/strsignal.c libiberty/xexit.c libiberty/xmemdup.c ltmain.sh mmalloc/ChangeLog mmalloc/Makefile.in opcodes/ChangeLog opcodes/Makefile.am opcodes/Makefile.in opcodes/a29k-dis.c opcodes/alpha-dis.c opcodes/alpha-opc.c opcodes/arc-dis.c opcodes/arc-opc.c opcodes/arm-dis.c opcodes/arm-opc.h opcodes/avr-dis.c opcodes/configure opcodes/configure.in opcodes/d10v-dis.c opcodes/d10v-opc.c opcodes/d30v-dis.c opcodes/d30v-opc.c opcodes/disassemble.c opcodes/fr30-desc.c opcodes/fr30-desc.h opcodes/h8300-dis.c opcodes/h8500-dis.c opcodes/hppa-dis.c opcodes/i370-dis.c opcodes/i370-opc.c opcodes/i960-dis.c opcodes/ia64-asmtab.c opcodes/ia64-asmtab.h opcodes/ia64-dis.c opcodes/ia64-gen.c opcodes/ia64-ic.tbl opcodes/ia64-opc-a.c opcodes/ia64-opc-b.c opcodes/ia64-opc-d.c opcodes/ia64-opc-f.c opcodes/ia64-opc-i.c opcodes/ia64-opc-m.c opcodes/ia64-opc-x.c opcodes/ia64-opc.c opcodes/ia64-opc.h opcodes/ia64-raw.tbl opcodes/ia64-war.tbl opcodes/ia64-waw.tbl opcodes/m10200-dis.c opcodes/m10200-opc.c opcodes/m10300-dis.c opcodes/m10300-opc.c opcodes/m32r-desc.h opcodes/m68k-dis.c opcodes/m68k-opc.c opcodes/m88k-dis.c opcodes/mcore-dis.c opcodes/mips-dis.c opcodes/mips-opc.c opcodes/mips16-opc.c opcodes/opintl.h opcodes/pj-dis.c opcodes/pj-opc.c opcodes/po/POTFILES.in opcodes/po/opcodes.pot opcodes/ppc-dis.c opcodes/ppc-opc.c opcodes/sh-dis.c opcodes/sparc-dis.c opcodes/sparc-opc.c opcodes/sysdep.h opcodes/tic54x-dis.c opcodes/tic54x-opc.c opcodes/tic80-dis.c opcodes/tic80-opc.c opcodes/v850-dis.c opcodes/v850-opc.c opcodes/vax-dis.c opcodes/w65-dis.c opcodes/z8k-dis.c opcodes/z8kgen.c readline/doc/ChangeLog sim/arm/ChangeLog sim/arm/Makefile.in sim/arm/armcopro.c sim/arm/armdefs.h sim/arm/armemu.c sim/arm/arminit.c sim/arm/armos.c sim/arm/armsupp.c sim/arm/configure sim/arm/configure.in sim/arm/wrapper.c sim/common/ChangeLog sim/common/aclocal.m4 sim/common/configure sim/common/run.c sim/common/sim-events.c sim/d10v/ChangeLog sim/d10v/configure sim/d10v/interp.c sim/d30v/ChangeLog sim/d30v/configure sim/d30v/cpu.h sim/erc32/ChangeLog sim/erc32/configure sim/fr30/ChangeLog sim/fr30/configure sim/h8300/ChangeLog sim/h8300/configure sim/h8500/ChangeLog sim/h8500/configure sim/i960/ChangeLog sim/i960/configure sim/igen/ChangeLog sim/igen/configure sim/igen/gen-semantics.c sim/m32r/ChangeLog sim/m32r/configure sim/mcore/ChangeLog sim/mcore/configure sim/mips/ChangeLog sim/mips/configure sim/mips/interp.c sim/mips/mips.igen sim/mips/sim-main.h sim/mn10200/ChangeLog sim/mn10200/configure sim/mn10300/ChangeLog sim/mn10300/am33.igen sim/mn10300/configure sim/mn10300/mn10300.igen sim/mn10300/mn10300_sim.h sim/mn10300/op_utils.c sim/ppc/ChangeLog sim/ppc/configure sim/ppc/events.c sim/ppc/interrupts.c sim/sh/ChangeLog sim/sh/configure sim/sh/gencode.c sim/sh/interp.c sim/testsuite/ChangeLog sim/testsuite/configure sim/testsuite/d10v-elf/ChangeLog sim/testsuite/d10v-elf/Makefile.in sim/testsuite/d10v-elf/t-rie-xx.s sim/v850/ChangeLog sim/v850/configure sim/v850/v850.igen sim/w65/ChangeLog sim/w65/configure sim/z8k/ChangeLog sim/z8k/configure texinfo/texinfo.tex Delete: gdb/config/gould/np1.mh gdb/config/gould/np1.mt gdb/config/gould/pn.mh gdb/config/gould/pn.mt gdb/config/gould/tm-np1.h gdb/config/gould/tm-pn.h gdb/config/gould/xm-np1.h gdb/config/gould/xm-pn.h gdb/gould-tdep.c gdb/gould-xdep.c gdb/mi/ChangeLog-mi gdb/tui/Makefile.in readline/doc/readline.0 --- diff --git a/ChangeLog b/ChangeLog index b88dd1b8904..0077cc93eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,105 @@ +Mon May 29 13:50:03 2000 Andrew Cagney + + * texinfo/texinfo.tex: Update. Version from makeinfo 4.0. + +Tue May 30 19:01:12 2000 Andrew Cagney + + * config.sub: Import CVS version 1.167 Tue May 30 09:00:07 2000. + * config.guess: Import CVS version 1.148 Tue May 30 09:00:06 2000 + +20000-05-21 H.J. Lu (hjl@gnu.org) + + * configure: Revert changes made on May 18 and May 19. + + * Makefile.in (CC_FOR_TARGET): Make sure as/ld in the gcc + directory are used if they exist. Make sure + $(build_tooldir)/include is searched for header files, + $(build_tooldir)/lib/ for library files. + (GCC_FOR_TARGET): Likewise. + (CXX_FOR_TARGET): Likewise. + +20000-05-19 H.J. Lu (hjl@gnu.org) + + * configure: Provide --disable-target-dir-sanity-checking to + disable the gcc directory checking for cross compiling. + +20000-05-18 H.J. Lu (hjl@gnu.org) + + * configure: Ask to create the gcc directory for cross + compiling if necessary. + +Thu May 18 10:58:13 2000 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa*64*-*-*): Do build ld for this configuration. + +2000-05-18 David Edelsohn + + * configure.in: Special case powerpc*-*-aix* target_makefile_frag. + +Wed May 17 16:03:48 2000 Alexandre Oliva + + * Makefile.in (configure-target-libiberty): Depend on + configure-target-newlib. + +Tue May 16 10:06:21 2000 Andrew Cagney + + Thu Apr 27 11:01:48 2000 Andrew Cagney : + * Makefile.in (do-tar-bz2, do-md5sum): Skip CVS directories. + +Tue May 16 09:57:35 2000 Andrew Cagney + + Wed Apr 26 17:03:53 2000 Andrew Cagney : + * Makefile.in (do-djunpack): New target. Update djunpack.bat with + current version information. Add to proto-toplev directory. + (gdb-taz): Build do-djunpack. + +2000-05-13 Alexandre Oliva + + * ltmain.sh: Preserve in relink_command any environment + variables that may affect the linker behavior. + +Fri May 12 11:23:17 2000 Jeffrey A Law (law@cygnus.com) + + * config.sub (basic_machine): Recognize hppa64 as a valid cpu type. + +Wed May 10 21:26:51 2000 Jim Wilson + + * configure.in (ia64*-*-elf*): Add gdb and friends to noconfigdirs. + +2000-05-08 Eli Zaretskii + + * djunpack.bat: Change the Sed script to replace @V@ in fnchange.lst + with the version name. + +2000-04-23 Eli Zaretskii + + * djunpack.bat: New file. + +2000-04-21 Michael Meissner + + * config.sub (d30v): Add d30v as a basic machine type. + +Wed Apr 19 12:46:26 2000 Andrew Cagney + + * Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2, + gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2, + dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2, + insight+dejagnu.tar.bz2, newlib.tar.bz2): Pass MD5PROG to sub-make. + +Wed Apr 12 16:42:48 2000 Andrew Cagney + + * Makefile.in (gdb-taz): New target. GDB specific archive. + (do-md5sum): New target. + (MD5PROG): Define. + (PACKAGE): Default to TOOL. + (VER): Default to a shell script. + (taz): Rewrite target. Move real work to do-proto-toplev. Include + md5 checksum generation. + (do-proto-toplev): New target. Create $(PACKAGE)-$(VER) link. + (do-tar-bz2): Delete creation of $(PACKAGE)-$(VER) link. + (gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, + insight.tar.bz2): Use gdb-taz to create archive. + Fri Apr 7 18:10:29 2000 Andrew Cagney * configure (warn_cflags): Delete. diff --git a/MAINTAINERS b/MAINTAINERS index 47b9fc22751..477d7c8a0fb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6,7 +6,7 @@ COPYING, COPYING.LIB, README Makefile.in, configure, configure.in Please notify the following of any committed patches. - bfd@sourceware.cygnus.com + binutils@sourceware.cygnus.com gdb-patches@sourceware.cygnus.com bfd/, binutils/, gas/, gprof/, ld/, opcodes/ & BFD's part of include/ diff --git a/Makefile.in b/Makefile.in index 9df70cbffae..f1acbd07f5c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,6 +111,7 @@ NM = nm LD = ld BZIPPROG = bzip2 +MD5PROG = md5sum # These values are substituted by configure. DEFAULT_YACC = yacc @@ -222,7 +223,7 @@ CC_FOR_TARGET = ` \ ;; \ esac \ else \ - echo $$r/gcc/xgcc -B$$r/gcc/; \ + echo $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -isystem $(build_tooldir)/include; \ fi; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ @@ -236,7 +237,7 @@ CC_FOR_TARGET = ` \ # variable is passed down to the gcc Makefile, where it is used to # build libgcc2.a. We define it here so that it can itself be # overridden on the command line. -GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ +GCC_FOR_TARGET = $$r/gcc/xgcc -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -I$(build_tooldir)/include CHILL_FOR_TARGET = ` \ if [ -f $$r/gcc/xgcc ] ; then \ @@ -261,7 +262,7 @@ CXX_FOR_TARGET = ` \ ;; \ esac \ else \ - echo $$r/gcc/xgcc -B$$r/gcc/; \ + echo $$r/gcc/g++ -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -B$$r/gcc/ -I$(build_tooldir)/include; \ fi; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ @@ -1628,7 +1629,7 @@ all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup: configure-target-newlib all-uudecode: all-libiberty all-zip: -configure-target-libiberty: $(ALL_GCC) +configure-target-libiberty: $(ALL_GCC) configure-target-newlib all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib all-target: $(ALL_TARGET_MODULES) install-target: $(INSTALL_TARGET_MODULES) @@ -1690,9 +1691,52 @@ ETC_SUPPORT= Makefile.in configure configure.in standards.texi \ # this macro. SUPPORT_FILES = list-of-support-files-for-tool-in-question -.PHONY: taz +# NOTE: No double quotes in the below. It is used within shell script +# as VER="$(VER)" +VER = ` if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ + sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ + else \ + sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ + fi` +PACKAGE = $(TOOL) +.PHONY: taz taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + $(MAKE) -f Makefile.in do-proto-toplev \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-md5sum \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-tar-bz2 \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + +.PHONY: gdb-taz +gdb-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + $(MAKE) -f Makefile.in do-proto-toplev \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-md5sum \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-djunpack \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-tar-bz2 \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + +.PHONY: do-proto-toplev +do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + echo "==> Making $(PACKAGE)-$(VER)/" # Take out texinfo from a few places. sed -e '/^all\.normal: /s/\all-texinfo //' \ -e '/^ install-texinfo /d' \ @@ -1742,25 +1786,35 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ else true; fi chmod -R og=u . || chmod og=u `find . -print` - if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ - ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \ - else \ - ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ - fi; \ - if test x"$(PACKAGE)" = x; then \ - package="$(TOOL)"; \ - else \ - package="$(PACKAGE)"; \ - fi; \ - $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver PACKAGE=$$package + # + -rm -f $(PACKAGE)-$(VER) + ln -s proto-toplev $(PACKAGE)-$(VER) +.PHONY: do-tar-bz2 do-tar-bz2: echo "==> Making $(PACKAGE)-$(VER).tar.bz2" - -rm -f $(PACKAGE)-$(VER) - ln -s proto-toplev $(PACKAGE)-$(VER) - tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER) + -rm -f $(PACKAGE)-$(VER).tar.bz2 + find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \ + | tar cTfh - $(PACKAGE)-$(VER).tar $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar +.PHONY: do-md5sum +do-md5sum: + echo "==> Adding md5 checksum to top-level directory" + cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \ + | xargs $(MD5PROG) > ../md5.sum + mv md5.sum proto-toplev + +.PHONY: do-djunpack +do-djunpack: + echo "==> Adding updated djunpack.bat to top-level directory" + echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/' + sed < djunpack.bat > djunpack.new \ + -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/' + mv djunpack.new djunpack.bat + -rm -f proto-toplev/djunpack.bat + ln -s ../djunpack.bat proto-toplev/djunpack.bat + TEXINFO_SUPPORT= texinfo/texinfo.tex DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) @@ -1768,6 +1822,7 @@ DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" # The FSF "binutils" release includes gprof and ld. @@ -1775,53 +1830,62 @@ gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils $(MAKE) -f Makefile.in taz TOOL=binutils \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" .PHONY: gas+binutils.tar.bz2 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" .PHONY: libg++.tar.bz2 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty libg++.tar.bz2: $(DIST_SUPPORT) libg++ $(MAKE) -f Makefile.in taz TOOL=libg++ \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" GNATS_SUPPORT_DIRS=include libiberty send-pr gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats $(MAKE) -f Makefile.in taz TOOL=gnats \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" .PHONY: gdb.tar.bz2 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" .PHONY: dejagnu.tar.bz2 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu $(MAKE) -f Makefile.in taz TOOL=dejagnu \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)" .PHONY: gdb+dejagnu.tar.bz2 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=gdb+dejagnu \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)" .PHONY: insight.tar.bz2 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=insight \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" .PHONY: insight+dejagnu.tar.bz2 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE="insight+dejagnu" \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" .PHONY: newlib.tar.bz2 @@ -1839,6 +1903,7 @@ NEWLIB_SUPPORT_DIRS=libgloss # supports newlib (if only minimally). newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib $(MAKE) -f Makefile.in taz TOOL=newlib \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \ DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4b80485f6bc..ddced79196a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,7 +1,734 @@ +2000-06-05 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + +2000-06-05 H.J. Lu + + * elflink.h (elf_fix_symbol_flags): Follow the link for the + indirect symbol for the ELF_LINK_NON_ELF bit. + (elf_link_output_extsym): Don't output the indirect symbol even + if the ELF_LINK_NON_ELF bit is set. + +2000-06-01 J.T. Conklin + + * config.bfd (i[3456]86-*-netbsdelf*): New target. + (i[3456]86-*-netbsdaout*): New target. + (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs. + (i[3456]86-*-openbsd*): Likewise. + +Tue May 30 15:39:04 2000 Andrew Cagney + + * trad-core.c: From hpux-core.c, include or + when possible. + +2000-05-31 Nick Clifton + + * opintl.h (_(String)): Explain why dgettext is used instead + of gettext. + +2000-05-31 Ulrich Drepper + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-05-31 Alan Modra + + * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field + selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and + R_PARISC_DIR17F are for absolute branches; Handle them as such. + +2000-05-30 Nick Clifton + + * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB, + 80960CA, 80960MC as valid machine names. + +2000-05-30 H.J. Lu + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + +2000-05-29 Philip Blundell + + * ppcboot.c: Add packed attribute if compiling with GCC. + +2000-05-29 Anatoly Vorobey + + * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal. + +2000-05-26 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am" + * Makefile.in: Regenerate. + + * sysdep.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. + +2000-05-26 Eli Zaretskii + + * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH. + + * archive.c (normalize, bfd_bsd_truncate_arname, + bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support + file names with backslashes. + + * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file + before opening it. + + * sysdep.h: Include filenames.h. + +2000-05-26 Alan Modra + + * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_relax_section): New. + (sparc64_elf_relocate_section): Optimize tail call into branch always + if possible. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_relax_section): New. + +2000-05-26 Jakub Jelinek + + * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters. + Remove unusued variables. + (sparc64_elf_relocate_section): Change r_symndx type to unsigned long. + (sparc64_elf_merge_private_bfd_data): Fix shared library case from + previous fix, so that shared libs really don't influence targets + extension mask and memory model. + +2000-05-23 H.J. Lu + + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-05-23 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-05-22 Richard Henderson + + * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI, + PCREL22, PCREL64I. Zero size of special relocs. + (elf64_ia64_reloc_type_lookup): Likewise. + (USE_BRL, oor_brl, oor_ip): New. + (elf64_ia64_relax_section): New. + (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I. + (elf64_ia64_install_value): Likewise, plus PCREL21BI. + (elf64_ia64_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): New. + * reloc.c (BFD_RELOC_IA64_PCREL21BI): New. + (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-05-22 Nick Clifton + + * configure.in : Add peigen.lo to MIPS PE targets. + * configure: Regenerate. + +2000-05-22 Momchil Velikov + + * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess + only if it is known for both input and output bfds. Separate + error message strings as in some languages, it may be necessary + to change more than one place in the string to change between + 'big' and 'little'. + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline + endianess checks, call _bfd_generic_verify_endian_match() instead. + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. + + * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify + endianess before checking bfd flavours. + +2000-05-22 H.J. Lu + + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + +2000-05-18 Alan Modra + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-05-18 Momchil Velikov + + * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting + relocs for an executable, ensure that they are virtual addresses. + +Thu May 18 10:55:47 2000 Jeffrey A Law (law@cygnus.com) + + * config.bfd (hppa*64*-*-hpux11*): New target triplet. + +2000-05-17 S. Bharadwaj Yadavalli + Rick Gorton + + * elflink.h: Add emitrelocations support: when enabled, relocation + information and relocation sections are put into final output + executables. If the emitrelocations flag is set, do the following: + (elf_bfd_final_link): Emit relocation sections. + (elf_link_input_bfd): Compute relocation section contents. + (elf_gc_sections): Don't clean relocation sections. + +2000-05-16 Catherine Moore + + * som.c (som_decode_symclass): Recognize weak symbols. + +2000-05-16 Szabolcs Szakacsits + + * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that + read idata section only from dataoff. + (pe_print_edata): Correctly check for valid eat_member. + +Tue May 16 00:04:11 2000 J"orn Rennecke + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + +2000-05-14 Philip Blundell + + * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets. + +2000-05-12 Alan Modra + + * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec + + * peigen.c (pe_print_idata): Look for .idata section and print + info even if data directory has zero entries. Read idata section + starting from dataoff, and adjust all data offsets to suit. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + * peigen.c (pe_print_edata): Similarly, look for .edata section + and print info even if data directory has zero entries. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + + From Szabolcs Szakacsits + * peigen.c (pe_print_idata): Use bfd_section_size rather than data + directory size which may be bogus. + * peigen.c (pe_print_edata): Similarly. + +2000-05-09 Alan Modra + + * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela + section is empty. + (copy_private_bfd_data): Allow for space possibly taken up by elf + headers when calculating segment physical address from lma. + +2000-05-08 Alan Modra + + * versados.c (versados_scan): Init stringlen and pass_2_done. + + * trad-core.c (trad_unix_core_file_p): Return + bfd_error_wrong_format rather than bfd_error_file_truncated. + + * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to + add_data_entry. DataDirectory virtual address is relative. + (pe_print_idata): Account for relative DataDirectory virtual + addresses. Don't trash datasize inside POWERPC_LE_PE code. + (pe_print_edata): Similarly. + + From Szabolcs Szakacsits + * peigen.c (dir_names): Add Delay Import Directory. + (pe_print_idata): Always search for bfd section containing + idata address rather than looking up section name. Print this + section name rather than .idata. + (pe_print_edata): Similarly. Also print some fields as %08lx. + (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as + Win32Version. + +Fri May 5 20:44:40 2000 Clinton Popetz + + * xcoff.h: Rename to xcoff-target.h + * Makefile.am: Change all instances of xcoff.h to xcoff-target.h + * coff-rs6000.c: Ditto. + * coff64-rs6000.c: Ditto. + * coff-pmac.c: Ditto. + * Makefile.in: Regenerate. + +Fri May 5 16:51:03 2000 Clinton Popetz + + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): + Change U802TOC64MAGIC to U803XTOCMAGIC. + +2000-05-04 Michael Snyder + + * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1. + * bfd-in.h: Prototype bfd_elf_get_arch_size. + * bfd-in2.h: Prototype bfd_elf_get_arch_size. + +2000-05-04 Alan Modra + + * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma. + +2000-05-03 Martin v. Löwis + + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + +2000-05-03 Mark Elbrecht + + * bfd/coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for + the .bss section. + * bfd/coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2000-05-02 H.J. Lu + + * elf.c (prep_headers): Use ELFOSABI_NONE instead of + ELFOSABI_SYSV. + +2000-05-02 Alan Modra + + * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec. + * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate + dependencies. + * Makefile.in: Regenerate. + +Mon May 1 16:56:47 2000 Jim Wilson + + * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo. + (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c. + (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo. + (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c. + * Makefile.in: Rebuild. + +2000-05-02 Alan Modra + + * config.bfd: Re-enable elf32-hppa. It now compiles, even if it + doesn't work very well. + + * elf-hppa.h (elf_hppa_internal_shdr): Define. + (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr. + Set hdr->s_type to 1 if ARCH_SIZE == 32. + (_bfd_elf_hppa_gen_reloc_type): Add prototype. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_is_local_label_name): Likewise. + (elf_hppa_fake_sections): Likewise. + (elf_hppa_final_write_processing): Likewise. + (elf_hppa_howto_table): Fully initialise all entries. + (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_record_segment_addrs, elf_hppa_final_link, + elf_hppa_relocate_section, elf_hppa_final_link_relocate, + elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until + elf32-hppa.c mess is cleaned up. + (elf_hppa_final_link_relocate): Make insn and r_type unsigned + int. Delete r_field. In case R_PARISC_PCREL21L, don't set + r_field then call hppa_field_adjust inline func with variable + r_field arg, instead call hppa_field_adjust with fixed arg. + In case R_PARISC_PCREL22F, don't set r_field. + (elf_hppa_relocate_insn): Change args and return type to unsigned + int. Call re_assemble_* funcs to do the work. + + * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when + sign extending. + + * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign + extending. + (sign_extend): Mask first before sign extending. + (low_sign_extend): Rewrite without condition expression. + (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16, + dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21, sign_unext, low_sign_unext): Return + result as function return value rather than through pointer arg. + Accept unsigned int args, and return unsigned int. + (re_assemble_3): New. Combines function of dis_assemble_3 with + re-assembly of opcode and immediate. + (re_assemble_12): Likewise. + (re_assemble_16): Likewise. + (re_assemble_17): Likewise. + (re_assemble_21): Likewise. + (re_assemble_22): Likewise. + (hppa_field_adjust): Rewrite and document, paying attention to + size of types and signed/unsigned issues. + (get_opcode): Shift before masking. + (FDLW): Rename to FLDW. + (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt. + (hppa_rebuild_insn): Change args and return value to unsigned + int. Make use of re_assemble_*. Correct case 11. + + * dep-in.sed: Handle ../opcodes/. + * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h, + elf64-hppa.h, hppa_stubs.h, xcoff.h. + (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c. + Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo, + elfarm-nabi.lo dependencies outside of auto-dependency area. + Regenerate dependencies. + * Makefile.in: Regenerate. + + * configure.in (TRAD_HEADER): Test non-null before + AC_DEFINE_UNQUOTED. + * configure: Regenerate. + + * reloc.c: Fix mis-spelling in comment. + +2000-05-01 Alan Modra + + * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. + * vms.c (vms_openr_next_archived_file): Return NULL. + +Fri Apr 28 21:34:44 2000 Clinton Popetz + + * coffcode.h Copy changes mistakenly done to libcoff.h in + 4/24/2000 patch. + +2000-04-29 Andreas Jaeger + + * libbfd-in.h: Correctly check GCC version. + * bfd-in.h: Likewise. + * libhppa.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +Fri Apr 28 14:58:37 2000 Clinton Popetz + + * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add + coffdu-rs6000.{lo,c}. + (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency + on xcoff.h + * Makefile.in: Regenerate. + * xcoff.h: New file. + * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c. + * coff-rs6000.c: Move all declarations and defines that are + common to the xcoff backends into xcoff.h + * coff64-rs6000.c: Ditto, + +Fri Apr 28 08:35:21 2000 Clinton Popetz + + * coff-mips.c (mips_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + * coff-sh.c: (bfd_coff_small_swap_table): Ditto. + +Fri Apr 28 08:05:12 2000 Clinton Popetz + + * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + +2000-04-27 Alan Modra + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL. + Check local_got_refcounts before dereferencing. + + * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL + before deciding we don't need R_PPC_PLT32 relocation. + (ppc_elf_gc_sweep_hook): Check local_got_refcounts before + dereferencing. + + * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment. + + * elf32-i386.c (elf_i386_check_relocs): Reference count .got and + .plt entries. + (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries. + (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries. + (elf_i386_relocate_section): Allow for .plt to go missing. + (elf_i386_finish_dynamic_symbol): Use same test to decide if we + can use a relative reloc for got as elf_i386_relocate_section. + (bfd_elf32_bfd_final_link): Define to use gc form of final link. + +Wed Apr 26 16:31:28 2000 Clinton Popetz + + * config.bfd: Remove extraneous bfd_powerpc_64_arch. + +Mon Apr 24 15:20:35 2000 Clinton Popetz + + * Makefile.am (coff64-rs6000.lo): New rule. + * Makefile.in: Regenerate. + * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data, + xcoff_is_local_label_name, xcoff_rtype2howto, + xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p, + xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap, + xcoff_write_archive_contents): No longer static, and prefix with _bfd_. + (NO_COFF_SYMBOLS): Define. + (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in, + xcoff64_swap_aux_out): New functions; handle xcoff symbol tables + internally. + (MINUS_ONE): New macro. + (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS + relocation. + (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, + coff_SWAP_aux_out): Map to the new functions. + * coff64-rs6000.c: New file. + * libcoff.h (bfd_coff_backend_data): Add new fields + _bfd_coff_force_symnames_in_strings and + _bfd_coff_debug_string_prefix_length. + (bfd_coff_force_symnames_in_strings, + bfd_coff_debug_string_prefix_length): New macros for above fields. + * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic. + Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead + of using coff_swap_sym_in directly. + (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64. + (coff_set_flags) Set magic for XCOFF64. + (coff_compute_section_file_positions): Add symbol name length to + string section length if bfd_coff_debug_string_prefix_length is + true. + (coff_write_object_contents): Don't do reloc overflow for XCOFF64. + (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of + using coff_swap_lineno_in directly. + (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings + and _bfd_coff_debug_string_prefix_length fields. + * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force + symbol names into strings table when + bfd_coff_force_symnames_in_strings is true. + * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR, + SET_RELOC_VADDR): New macros. + (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros. + (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C + code. + (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64 + changes within RS6000COFF_C specific code. + (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, + MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Extend existing hack on target name. + * xcofflink.c (XCOFF_XVECP): Extend existing hack on + target name. + * coff-tic54x.c (ticof): Keep up to date with new fields + in bfd_coff_backend_data. + * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define + targ_selvecs to include rs6000coff64_vec for rs6000. + * configure.in: Add rs6000coff64_vec case. + * cpu-powerpc.c: New bfd_arch_info_type. + +Mon Apr 24 02:17:31 2000 Jeffrey A Law (law@cygnus.com) + + * config.bfd: Only disable elf32-hppa vectors, not all of the + BSD and OSF configuration support. Provide (disabled) clauses + for PA64 support. + * configure.in: Add clause for PA64 support. + * configure: Rebuilt. + + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec. + (bfd_elf64_hppa_vec): Declare. + + * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo + (BFD64_BACKENDS_CFILES): Add elf64-hppa.c + (elf64-hppa.lo): Add dependencies. + * Makefile.in: Rebuilt. + + * elf64-hppa.c, elf64-hppa.h: New files with PA64 support. + +Mon Apr 24 02:14:29 2000 Jason Eckhardt + + * libhppa.h (dis_assemble_16): New function. + (pa_arch): Added pa20w element. + +Mon Apr 24 01:49:03 2000 Ulrich Drepper + + * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs, + bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and + bfd_elf64_slurp_reloc_table. + + * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New + definitions to get external names. + (elf_write_relocs): Renamed from write_relocs and make global. + (elf_slurp_reloc_table): Make global. + (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs. + + * archive.c (hpux_uid_gid_encode): New function. + (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is + defined and the ID is greater than 99999. + (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode + special uid/gid fields into 32 bit values. + +2000-04-21 Matthew Green + + * config.bfd: Add NetBSD/sparc64 support. + +Fri Apr 21 13:20:53 2000 Richard Henderson + David Mosberger + Timothy Wall + Jim Wilson + + * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo. + (ALL_MACHINES_CFILES): Add cpu-ia64.c. + (BFD64_BACKENDS): Add elf64-ia64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ia64.c. + (cpu-ia64.lo, elf64-ia64.lo): New rules. + * Makefile.in: Rebuild. + * archures.c (enum bfd_architecture): Add bfd_arch_ia64. + (bfd_ia64_arch): Declare. + (bfd_archures_list): Add bfd_ia64_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets. + * configure: Rebuild. + * configure.host: (ia64-*-linux*): New host. + * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec, + bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors. + * elf.c (prep_headers): Add bfd_arch_ia64. + * libbfd.h: Rebuild. + * reloc.c: Add IA-64 relocations. + * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec): + Declare. + (bfd_target_vect): Add bfd_elf64_ia64_little_vec. + * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files. + +2000-04-21 Richard Henderson + + * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section + contents when performing a partial link. + (bfd_elf_d30v_reloc_21): Likewise. + +2000-04-20 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + * elf32-ppc.c (ppc_elf_relocate_section): Similarly. + +2000-04-19 Michael Sokolov + + K&R compiler fixes. + * dwarf2.c (concat_filename): Avoid string literal concatenation. + * ieee.c (ieee_get_symtab): Don't initialise union in struct. + +Mon Apr 17 19:14:36 2000 David Mosberger + + * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo. + (BFD64_BACKENDS_CFILES): Mention coff-ia64.c + (coff-ia64.lo): Add dependency. + * Makefile.in: Regenerate. + * coff-ia64.c: New file. + * efi-app-ia32.c: Ditto. + * efi-app-ia64.c: Ditto. + * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC. + (coff_set_flags): Ditto. + (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC. + * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec. + * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec. + * configure: Regenerate. + * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro. + (PUT_OPTHDR_IMAGE_BASE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (GET_PDATA_ENTRY): Ditto. + * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read + data_start. Use above macros to read fields that are 64 bit wide for + COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits. + (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force + FileAlignment and SectionAlignment to minimum alignment if they + are zero. + (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set + Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM. + (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start. + Use above macros to write fields that are 64 bit wide for + COFF_WITH_PEP64. + (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64, + 5*4 otherwise. This should be right for IA-32 and IA-64, but may + be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded + value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print + begin address, end address, and unwind info address only. Use + GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to + print addresses. + (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and + HIGH3ADJ relocation names. + (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form. + * targets.c: Declare bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + (bfd_target_vector): Mention bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + +2000-04-17 Timothy Wall + + * bfd-in2.h: Add prototypes for tic54x load page access. + * bfd-in.h: Regenerate. + * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown + in customized _set_arch_mach function. + * coffcode.h (coff_set_alignment_hook): Set section load page if + the appropriate macro is defined. + (write_object_contents): Read section load page. + +2000-04-13 Alan Modra + + * elf32-hppa.h: Update copyright date. + + * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. + * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. + + * elf32-d30v.c (MAX32): Don't use LL suffix. + (MIN32): Define in terms of MAX32. + (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + + * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise + expression. + + * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + +2000-04-12 Alan Modra + + * dep-in.sed: Match space before file name, not after. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + + * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield + case, allow address wrap-around stupidly removed 2000-03-17. Sign + extend without an if statement. + +2000-04-11 Alan Modra + + * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using + signed quantites. + * elf32-mips.c (gprel16_with_gp): Likewise. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range + here using -0x40000, not (int)0xfffc0000. + (elf32_hppa_size_of_stub): Likewise. + +2000-04-11 Timothy Wall + + * coff-tic54x.c: Now builds with all targets. + * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies. + * Makefile.in: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on + unitialized variable. + Fri Apr 7 15:56:57 2000 Andrew Cagney - + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add - --enable-build-warnings option. + --enable-build-warnings option. * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. * Makefile.in, configure: Re-generate. @@ -107,10 +834,10 @@ Wed Apr 5 22:04:20 2000 J"orn Rennecke 2000-04-03 Kevin Buettner - * configure.in: Added corefile support for AIX 4.3. In particular, - AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when - compiling rs6000-core.c. - * configure: Regenerated. + * configure.in: Added corefile support for AIX 4.3. In particular, + AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when + compiling rs6000-core.c. + * configure: Regenerated. 2000-04-03 H.J. Lu @@ -196,9 +923,9 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay "boolean overflow" with "bfd_reloc_status_type flag". 2000-03-14 Doug Evans - - * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. - + + * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. + 2000-03-14 Kazu Hirata * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number @@ -219,7 +946,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper sign-extension and big-endian compensation for - R_MIPS_64 even in ld -r. + R_MIPS_64 even in ld -r. 2000-03-10 Geoffrey Keating @@ -310,7 +1037,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay * coffcode.h (styp_to_sec_flags): Initialise 'target_name'. * elf-m10300.c (mn10300_elf_relax_section): Initialise - 'sym_sec'. + 'sym_sec'. * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function parameters. @@ -520,10 +1247,10 @@ Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) * elflink.h (elf_link_add_object_symbols): If a version symbol is not defined, don't add a second ELF_VER_CHR. - * elflink.h (elf_bfd_final_link): Call output_extsym for global + * elflink.h (elf_bfd_final_link): Call output_extsym for global symbols converted to local symbols even when stripping all symbols. - (elf_link_output_extsym): Process global symbols converted to + (elf_link_output_extsym): Process global symbols converted to local symbols even if they are being stripped. 2000-02-21 Alan Modra @@ -718,28 +1445,28 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) 2000-02-08 Mark Elbrecht * coff-go32.c: Update comment. Update copyright. - + 2000-01-27 Thomas de Lellis - * syms.c (bfd_decode_symclass) - Two new class characters were added - 'V' and 'v'. The - meaning of 'W' is now restricted to just weak non-object - symbols. This allows differentiation between, for example, - weak functions vs weak objects. nm for example now dumps: - 'W' = weak global - 'w' = weak unresolved - 'V' = weak global object - 'v' = weak unresolved object + * syms.c (bfd_decode_symclass) + Two new class characters were added - 'V' and 'v'. The + meaning of 'W' is now restricted to just weak non-object + symbols. This allows differentiation between, for example, + weak functions vs weak objects. nm for example now dumps: + 'W' = weak global + 'w' = weak unresolved + 'V' = weak global object + 'v' = weak unresolved object (bfd_is_undefined_symclass): New function. Return true if the given symbol class represents and undefined/unresolved symbol. - (bfd_symbol_info): Use bfd_is_undefined_symclass to check for + (bfd_symbol_info): Use bfd_is_undefined_symclass to check for unresolved symbols. * bfd-in2.h: Add prototype for bfd_is_undefined_symbol(). - * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the + * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the STT_ARM_16BIT flag set, but it is not attached to a data object return STT_ARM_16BIT so that it will be treated as code by the disassembler. @@ -757,7 +1484,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) 2000-01-24 Robert Lipe (robertl@sco.com) - * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc + * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc instead of using GNU C extension. 2000-01-21 Nick Clifton @@ -934,8 +1661,8 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) 1999-12-09 Nick Clifton * elflink.h (elf_link_add_archive_symbols): Add an archive - element even if contains a symbol which is currently only - considered to be a common. + element even if contains a symbol which is currently only + considered to be a common. * targets.c (struct bfd_target): Add new field _bfd_allow_commons_in_armap. @@ -1096,7 +1823,7 @@ Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com) Sat Oct 23 17:36:12 1999 Andrew Cagney * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and - bfd_mach_d10v_ts3. + bfd_mach_d10v_ts3. * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add. * bfd-in2.h: Regenerate. @@ -1119,8 +1846,8 @@ Fri Oct 8 13:03:45 1999 Geoffrey Keating * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL relocs also need the GP value. (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs - properly. Handle sign-extension for R_MIPS_64 correctly. Correct - the GP value for R_MIPS_LITERAL relocs too. Handle + properly. Handle sign-extension for R_MIPS_64 correctly. Correct + the GP value for R_MIPS_LITERAL relocs too. Handle R_MIPS_64 relocs properly on big-endian MIPS. (mips_elf_sign_extend): Behave properly with 'long long'. (mips_elf_highest): Correct typo. @@ -1578,7 +2305,7 @@ Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com) (pj-*-*, pjl-*-*): New targets. * configure.in (bfd_elf32_pj_vec): New target vector. (bfd_elf32_pjl_vec): New target vector. - * archures.c (bfd_arch_pj): Define. + * archures.c (bfd_arch_pj): Define. * elf.c (prep_headers): Handle bfd_arch_pj. * reloc.c: Define BFD_RELOC_PJ_* relocations. * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add @@ -2045,9 +2772,9 @@ Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com) Mon Jul 19 14:03:44 1999 Mark P. Mitchell * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP - removed in previous change. + removed in previous change. (_bfd_mips_elf_relocate_section): Adjust GP relative relocations - in relocateable output. + in relocateable output. 1999-07-19 Ian Lance Taylor @@ -2075,8 +2802,8 @@ Mon Jul 19 14:03:44 1999 Mark P. Mitchell * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro. (CREATE_LITTLE_COFF_TARGET_VEC): New macro. - * aix386-core.c: Initialise new field of bfd_target structure. - * aout-adobe.c: Initialise new field of bfd_target structure. + * aix386-core.c: Initialise new field of bfd_target structure. + * aout-adobe.c: Initialise new field of bfd_target structure. * aout-arm.c: Initialise new field of bfd_target structure. * aout-target.h: Initialise new field of bfd_target structure. * aout-tic30.c: Initialise new field of bfd_target structure. @@ -3236,7 +3963,7 @@ Wed Jun 2 11:51:12 1999 Andreas Schwab section. (elf32_arm_final_link_relocate): New parameter h. (elf32_arm_relocate_section): Pass symbol hash entry to above - routine. + routine. (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct comments. @@ -3255,7 +3982,7 @@ Wed Jun 2 11:51:12 1999 Andreas Schwab 1999-05-24 Philip Blundell * elf32-arm.h (elf32_arm_relocate_section): Undo change of - 1999-03-25. + 1999-03-25. Mon May 17 13:35:35 1999 Stan Cox @@ -3288,7 +4015,7 @@ Mon May 17 13:35:35 1999 Stan Cox Fri May 14 10:59:55 1999 Andreas Schwab * elf32-arm.h (elf32_arm_relocate_section): Fix operator - precedence between bit-and and comparison. + precedence between bit-and and comparison. Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com) @@ -3877,8 +4604,8 @@ Fri Jan 29 00:47:21 1999 H.J. Lu Thu Jan 28 20:05:22 1999 Ian Lance Taylor * binary.c (binary_set_section_contents): Don't return early for a - non-loadable section, in case the first section is non-loadable. - Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej + non-loadable section, in case the first section is non-loadable. + Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej W. Rozycki . 1999-01-28 Nick Clifton @@ -3888,8 +4615,8 @@ Thu Jan 28 20:05:22 1999 Ian Lance Taylor Thu Jan 28 11:08:16 1999 Catherine Moore - * elflink.h (elf_link_output_sym): Zero syms which are - part of sections which have been excluded. + * elflink.h (elf_link_output_sym): Zero syms which are + part of sections which have been excluded. Wed Jan 27 13:35:35 1999 Stan Cox @@ -4028,32 +4755,32 @@ Tue Dec 8 16:21:35 1998 Ian Lance Taylor Wed Dec 2 15:03:59 1998 David Taylor The following changes were made by David Taylor - , Edith Epstein - , Jim Blandy - , and Elena Zannoni - as part of the project to merge in - changes originally made by HP; HP did not create ChangeLog - entries. + , Edith Epstein + , Jim Blandy + , and Elena Zannoni + as part of the project to merge in + changes originally made by HP; HP did not create ChangeLog + entries. * aclocal.m4, configure, Makefile.in: Rebuilt using latest - automake macro library. + automake macro library. * hpux-core.c (hpux_core_core_file_p): this function now - understands HPUX 10.30 thread info. Yes, the thread stacks can be - found in the corefile! Also, in hpux_core_core_file_p, if we - encounter a section with an unknown type, don't punt. Instead, - just skip it. Also, count the number of sections of known type - that we encounter. If we encounter at least one good one, then - we'll declare that the file is a core file. If we encounter any - unknown ones but some known ones, then we'll issue a warning (but - still declare it to be a core file). Also, correctly decide when a - file is not a core. + understands HPUX 10.30 thread info. Yes, the thread stacks can be + found in the corefile! Also, in hpux_core_core_file_p, if we + encounter a section with an unknown type, don't punt. Instead, + just skip it. Also, count the number of sections of known type + that we encounter. If we encounter at least one good one, then + we'll declare that the file is a core file. If we encounter any + unknown ones but some known ones, then we'll issue a warning (but + still declare it to be a core file). Also, correctly decide when a + file is not a core. (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined. (CORE_ANON_SHMEM): define if not defined. (hpux_core_struct): add members lwpid and user_tid. (core_kernel_thread_id, core_user_thread_id): new macros. (make_bfd_asection): use bfd_alloc to allocate room for a copy of - the name before storing it in the bfd. + the name before storing it in the bfd. (hpux_core_core_file_p): handle threads. * libhppa.h (GET_FIELD): protect against redefinition. @@ -4234,15 +4961,15 @@ Tue Nov 17 15:28:31 1998 Nick Clifton Mon Nov 16 22:19:21 1998 DJ Delorie * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY - bfds; they have no "file" so we fake it. + bfds; they have no "file" so we fake it. * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen) * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by - resizing the memory buffer. + resizing the memory buffer. * opncls.c (bfd_make_writable): New function; lets you write a - bfd_create'd bfd to an in-memory buffer. + bfd_create'd bfd to an in-memory buffer. (bfd_make_readable): New function; lets you read back that buffer - as if it were from bfd_openr. Used to build generated archive - members (winsup's ld's dlltool) + as if it were from bfd_openr. Used to build generated archive + members (winsup's ld's dlltool) Mon Nov 16 19:15:19 1998 Dave Brolley @@ -4283,8 +5010,8 @@ Tue Nov 10 15:13:59 1998 Nick Clifton Tue Nov 10 13:37:36 1998 Felix Lee * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE, - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value - was cached. + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value + was cached. * aclocal.m4, configure: regenerated. Tue Nov 10 14:31:01 1998 Catherine Moore @@ -4395,13 +5122,13 @@ Mon Oct 19 16:57:05 1998 Felix Lee Mon Oct 19 01:47:21 1998 Felix Lee * acinclude.m4, aclocal.m4: move gettext-related fragments from - aclocal.m4 to acinclude.m4, so they don't get lost. + aclocal.m4 to acinclude.m4, so they don't get lost. * elfcore.h: rewrite for better corefile support. * elf.c (elfcore_*): new functions. * elf-bfd.h (elf_obj_tdata): new structure members. * acconfig.h, acinclude.m4, configure.in: add feature-tests for - flavor of procfs. + flavor of procfs. * aclocal.m4, config.in, configure, Makefile.in: regenerated. Fri Oct 16 14:07:45 1998 Catherine Moore @@ -4582,20 +5309,20 @@ Wed Sep 16 11:26:49 CDT 1998 Catherine Moore Tue Sep 15 12:40:05 1998 Catherine Moore - * elf-bfd.h: Add argument to elf_backend_get_symbol_type. + * elf-bfd.h: Add argument to elf_backend_get_symbol_type. Tue Sep 15 08:34:40 1998 Catherine Moore - * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. - * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and - R_ARM_GNU_VTENTRY. - (elf32_arm_gc_mark_hook): New. - (elf32_arm_gc_sweep_hook): New. - (elf32_arm_check_relocs): New. - (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY - relocations. - (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY - relocations. + * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. + * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and + R_ARM_GNU_VTENTRY. + (elf32_arm_gc_mark_hook): New. + (elf32_arm_gc_sweep_hook): New. + (elf32_arm_check_relocs): New. + (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY + relocations. + (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY + relocations. 1998-09-10 Geoff Keating @@ -4736,28 +5463,28 @@ Fri Aug 14 09:12:28 1998 Stan Cox Thu Aug 13 14:02:02 1998 Catherine Moore - * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, - elf32_arm_allocate_interworking_sections and - elf32_arm_process_before_allocation. - * bfd-in2.h: Regenerated. - * elf32-arm.c Define elf32_arm_link_hash_table. - (insert_thumb_branch): New routine. - (find_thumb_glue): New routine. - (find_arm_glue): New routine. - (record_arm_to_thumb_glue): New routine. - (record_thumb_to_arm_glue): New routine. - (elf32_arm_link_hash_table_create): New routine. - (elf32_arm_get_bfd_for_interworking): New routine. - (elf32_arm_allocate_interworking_sections) New routine. - (elf32_arm_process_before_allocation) New routine. - (elf32_thumb_to_arm_stub): New routine. - (elf32_arm_to_thumb_stub): New routine. - (elf32_print_private_bfd_data): Fix typo. - (elf32_arm_final_link_relocate): Add argument sym_sec. - Check for branches to thumb symbols in case R_ARM_PC24. - Check for branches to arm symbols in case R_ARM_THM_PC22. - (elf32_arm_relocate_section): Pass symbol section to - elf32_arm_final_link_relocate. + * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, + elf32_arm_allocate_interworking_sections and + elf32_arm_process_before_allocation. + * bfd-in2.h: Regenerated. + * elf32-arm.c Define elf32_arm_link_hash_table. + (insert_thumb_branch): New routine. + (find_thumb_glue): New routine. + (find_arm_glue): New routine. + (record_arm_to_thumb_glue): New routine. + (record_thumb_to_arm_glue): New routine. + (elf32_arm_link_hash_table_create): New routine. + (elf32_arm_get_bfd_for_interworking): New routine. + (elf32_arm_allocate_interworking_sections) New routine. + (elf32_arm_process_before_allocation) New routine. + (elf32_thumb_to_arm_stub): New routine. + (elf32_arm_to_thumb_stub): New routine. + (elf32_print_private_bfd_data): Fix typo. + (elf32_arm_final_link_relocate): Add argument sym_sec. + Check for branches to thumb symbols in case R_ARM_PC24. + Check for branches to arm symbols in case R_ARM_THM_PC22. + (elf32_arm_relocate_section): Pass symbol section to + elf32_arm_final_link_relocate. Wed Aug 12 19:00:39 1998 Geoff Keating @@ -4771,16 +5498,16 @@ Wed Aug 12 14:48:33 1998 Ian Lance Taylor Wed Aug 12 08:10:11 1998 Catherine Moore - * elf32-arm.c (elf32_arm_final_link_relocate): Rework - R_ARM_PC24 relocation. + * elf32-arm.c (elf32_arm_final_link_relocate): Rework + R_ARM_PC24 relocation. Tue Aug 11 14:42:26 1998 Catherine Moore - * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused - argument is_local. Add argument sym_flags. Check sym_flags - in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. - (elf32_arm_relocate_section): Don't pass local sym and pass - sym_flags to elf32_arm_final_link_relocate. + * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused + argument is_local. Add argument sym_flags. Check sym_flags + in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. + (elf32_arm_relocate_section): Don't pass local sym and pass + sym_flags to elf32_arm_final_link_relocate. Mon Aug 10 20:38:39 1998 Richard Henderson @@ -5165,7 +5892,7 @@ Wed Jul 1 17:05:53 1998 Nick Clifton Wed Jul 1 16:58:50 1998 Ian Lance Taylor * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons - when handling 32 bit immediate relocs. + when handling 32 bit immediate relocs. * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com) @@ -5236,7 +5963,7 @@ Thu Jun 25 18:31:41 1998 Richard Henderson (ppc_elf_howto_raw): Handle them. (ppc_elf_reloc_type_lookup): Likewise. (ppc_elf_relocate_section): Likewise. - (ppc_elf_check_relocs): Reference count .got and .plt entires. + (ppc_elf_check_relocs): Reference count .got and .plt entries. Handle new vtable relocs. (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries. (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New. @@ -5283,8 +6010,8 @@ Fri Jun 19 17:08:18 1998 Ian Lance Taylor Tue Jun 16 11:55:55 1998 Ian Lance Taylor * elf.c (copy_private_bfd_data): Improve handling of Solaris - native linker output. Avoid putting an empty section in more than - one segment. + native linker output. Avoid putting an empty section in more than + one segment. Fri Jun 12 13:30:17 1998 Tom Tromey @@ -5346,7 +6073,7 @@ Tue Jun 2 15:29:35 1998 Ian Lance Taylor * elflink.h (elf_merge_symbol): Don't always set type_change_ok and size_change_ok. - (elf_link_add_object_symbols): Set type_change_ok and + (elf_link_add_object_symbols): Set type_change_ok and size_change_ok before calling elf_merge_symbol. * elf32-mips.c (mips_elf_relocate_section): If we issue an @@ -5410,7 +6137,7 @@ Tue May 19 18:41:19 1998 Ian Lance Taylor * bfd-in.h: Move over patch to bfd-in2.h. * reloc.c (bfd_check_overflow): Add casts before shifts which may - not fit in 32 bits. + not fit in 32 bits. (_bfd_relocate_contents): Likewise. Mon May 18 14:44:15 1998 Nick Clifton @@ -5690,8 +6417,8 @@ Thu Apr 16 13:49:00 1998 Richard Henderson Thu Apr 16 11:43:33 1998 Ian Lance Taylor * archive.c (bfd_generic_archive_p): If a slurp subroutine returns - an error other than bfd_error_system_call, set the error to - bfd_error_wrong_format. + an error other than bfd_error_system_call, set the error to + bfd_error_wrong_format. * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add bfd_elf32_powerpcle_vec. @@ -6035,10 +6762,10 @@ Wed Mar 25 11:19:28 1998 Ian Lance Taylor From Yan Meroth : * ihex.c (ihex_scan): Add extbase variable so that getting an - extended linear address record does not ignore any previous - extended address. + extended linear address record does not ignore any previous + extended address. (ihex_write_object_contents): When writing out an extended linear - address record, zero out any previous extended address. + address record, zero out any previous extended address. Tue Mar 24 16:09:43 1998 Manfred Hollstein @@ -6097,7 +6824,7 @@ Mon Feb 23 19:31:19 1998 Ian Lance Taylor 1998-02-23 15:53 Richard Henderson * elf32-i386.c (elf_i386_relocate_section): A pc-relative - relocation against a now-local symbol should not have a dynamic + relocation against a non-local symbol should not have a dynamic relocation. Mon Feb 23 16:17:08 1998 Ian Lance Taylor @@ -6110,8 +6837,8 @@ Mon Feb 23 16:17:08 1998 Ian Lance Taylor Sun Feb 22 20:39:00 1998 Richard Henderson * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create - a plt entry when we can determine that we authoritatively define - the symbol. + a plt entry when we can determine that we authoritatively define + the symbol. Sun Feb 22 20:33:05 1998 Richard Henderson @@ -6175,7 +6902,7 @@ Thu Feb 12 17:31:11 1998 Ian Lance Taylor netbsd-core.lo, set COREFLAG to -DNETBSD_CORE. * config.bfd (alpha*-*-netbsd*): New target. * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add vaxnetbsd.lo. + (BFD32_BACKENDS): Add vaxnetbsd.lo. (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c. * configure, Makefile.in: Rebuild. @@ -6240,8 +6967,8 @@ Thu Feb 5 11:51:05 1998 Ian Lance Taylor skip empty sections, to match coff_write_object_contents. * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, - rather than swapping out r_offset twice. From Luke Deller - . + rather than swapping out r_offset twice. From Luke Deller + . Wed Feb 4 19:11:28 1998 Ian Lance Taylor @@ -6324,7 +7051,7 @@ Fri Jan 30 19:07:07 1998 Geoff Keating * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs against _GLOBAL_OFFSET_TABLE_. - (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in + (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in shared libraries which refer to local symbols. Make sure that the test for allocating space for a reloc in a shared object is the same as the test for emitting a reloc. @@ -6402,10 +7129,10 @@ Thu Jan 22 21:13:39 1998 Richard Henderson Wed Jan 21 21:19:03 1998 Ian Lance Taylor * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't - adjust addend for an output common symbol (from Jimmy Blair - ). If COFF_WITH_PE, adjust addend for PC relative - defined symbol to counteract adjustment made in generic relocation - code. + adjust addend for an output common symbol (from Jimmy Blair + ). If COFF_WITH_PE, adjust addend for PC relative + defined symbol to counteract adjustment made in generic relocation + code. * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 9c587322d32..380b993f269 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -51,6 +51,7 @@ ALL_MACHINES = \ cpu-h8300.lo \ cpu-h8500.lo \ cpu-hppa.lo \ + cpu-ia64.lo \ cpu-i370.lo \ cpu-i386.lo \ cpu-i860.lo \ @@ -89,6 +90,7 @@ ALL_MACHINES_CFILES = \ cpu-h8300.c \ cpu-h8500.c \ cpu-hppa.c \ + cpu-ia64.c \ cpu-i370.c \ cpu-i386.c \ cpu-i860.c \ @@ -161,6 +163,7 @@ BFD32_BACKENDS = \ dwarf2.lo \ ecoff.lo \ ecofflink.lo \ + efi-app-ia32.lo \ elf.lo \ elf32-arc.lo \ elfarm-oabi.lo \ @@ -170,6 +173,7 @@ BFD32_BACKENDS = \ elf32-d30v.lo \ elf32-fr30.lo \ elf32-gen.lo \ + elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ elf32-i860.lo \ @@ -292,6 +296,7 @@ BFD32_BACKENDS_CFILES = \ dwarf2.c \ ecoff.c \ ecofflink.c \ + efi-app-ia32.c \ elf.c \ elf32-arc.c \ elfarm-oabi.c \ @@ -301,6 +306,7 @@ BFD32_BACKENDS_CFILES = \ elf32-d30v.c \ elf32-fr30.c \ elf32-gen.c \ + elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ elf32-i860.c \ @@ -385,8 +391,12 @@ BFD32_BACKENDS_CFILES = \ BFD64_BACKENDS = \ aout64.lo \ coff-alpha.lo \ + coff64-rs6000.lo \ demo64.lo \ + efi-app-ia64.lo \ elf64-alpha.lo \ + elf64-hppa.lo \ + elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ elf64-sparc.lo \ @@ -397,8 +407,12 @@ BFD64_BACKENDS = \ BFD64_BACKENDS_CFILES = \ aout64.c \ coff-alpha.c \ + coff64-rs6000.c \ demo64.c \ + efi-app-ia64.c \ elf64-alpha.c \ + elf64-hppa.c \ + elf64-ia64.c \ elf64-gen.c \ elf64-mips.c \ elf64-sparc.c \ @@ -445,12 +459,12 @@ CFILES = \ ## This is a list of all .h files which are in the source tree. SOURCE_HFILES = \ - aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \ - ecoffswap.h elf32-arm.h elfcode.h elfcore.h \ - elflink.h freebsd.h genlink.h go32stub.h libaout.h \ - libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \ - libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \ - nlmswap.h ns32k.h peicode.h som.h vms.h + aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \ + elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \ + elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ + hppa_stubs.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ + libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ + nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h HFILES = \ elf32-target.h elf64-target.h targmatch.h \ @@ -652,485 +666,565 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck -elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - -elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - # What appears below is generated by a hacked mkdep using gcc -MM. # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h -archures.lo: archures.c -bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -cache.lo: cache.c -coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h -corefile.lo: corefile.c -format.lo: format.c -init.lo: init.c -libbfd.lo: libbfd.c -opncls.lo: opncls.c $(INCDIR)/objalloc.h -reloc.lo: reloc.c $(INCDIR)/bfdlink.h -section.lo: section.c $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \ +archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/aout/ranlib.h +archures.lo: archures.c $(INCDIR)/filenames.h +bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ + libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +cache.lo: cache.c $(INCDIR)/filenames.h +coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h +corefile.lo: corefile.c $(INCDIR)/filenames.h +format.lo: format.c $(INCDIR)/filenames.h +init.lo: init.c $(INCDIR)/filenames.h +libbfd.lo: libbfd.c $(INCDIR)/filenames.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ + targmatch.h +hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +binary.lo: binary.c $(INCDIR)/filenames.h +tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h -hash.lo: hash.c $(INCDIR)/objalloc.h -linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h -srec.lo: srec.c $(INCDIR)/libiberty.h -binary.lo: binary.c -tekhex.lo: tekhex.c $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/libiberty.h -stabs.lo: stabs.c $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def -cpu-a29k.lo: cpu-a29k.c -cpu-alpha.lo: cpu-alpha.c -cpu-arc.lo: cpu-arc.c -cpu-arm.lo: cpu-arm.c -cpu-avr.lo: cpu-avr.c -cpu-d10v.lo: cpu-d10v.c -cpu-d30v.lo: cpu-d30v.c -cpu-fr30.lo: cpu-fr30.c -cpu-h8300.lo: cpu-h8300.c -cpu-h8500.lo: cpu-h8500.c -cpu-hppa.lo: cpu-hppa.c -cpu-i370.lo: cpu-i370.c -cpu-i386.lo: cpu-i386.c -cpu-i860.lo: cpu-i860.c -cpu-i960.lo: cpu-i960.c -cpu-m32r.lo: cpu-m32r.c -cpu-m68k.lo: cpu-m68k.c -cpu-m88k.lo: cpu-m88k.c -cpu-m10200.lo: cpu-m10200.c -cpu-m10300.lo: cpu-m10300.c -cpu-mcore.lo: cpu-mcore.c -cpu-mips.lo: cpu-mips.c -cpu-ns32k.lo: cpu-ns32k.c ns32k.h -cpu-pj.lo: cpu-pj.c -cpu-powerpc.lo: cpu-powerpc.c -cpu-rs6000.lo: cpu-rs6000.c -cpu-sh.lo: cpu-sh.c -cpu-sparc.lo: cpu-sparc.c -cpu-tic30.lo: cpu-tic30.c -cpu-tic80.lo: cpu-tic80.c -cpu-tic54x.lo: cpu-tic54x.c -cpu-v850.lo: cpu-v850.c -cpu-vax.lo: cpu-vax.c -cpu-we32k.lo: cpu-we32k.c -cpu-w65.lo: cpu-w65.c -cpu-z8k.lo: cpu-z8k.c -aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \ +cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h +cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h +cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h +cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h +cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h +cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h +cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h +cpu-ia64.lo: cpu-ia64.c $(INCDIR)/filenames.h cpu-ia64-opc.c \ + $(srcdir)/../opcodes/ia64-opc.h $(INCDIR)/opcode/ia64.h +cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h +cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h +cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h +cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h +cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h +cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h +cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h +cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h +cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h +cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h +cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h +cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h +cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h +cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h +cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h +cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h +cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h +aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h -aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h +aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ ns32k.h libaout.h $(INCDIR)/bfdlink.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ - libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \ + libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h aoutx.h -aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ + $(INCDIR)/aout/ar.h aout-target.h +aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h +aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ + libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h -cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \ +armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h +cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \ +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \ +coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h +coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \ +coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \ +coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \ +coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ - ecoffswap.h -coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \ +coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \ + libecoff.h coffswap.h ecoffswap.h +coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ + xcoff-target.h coffcode.h coffswap.h +coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ +coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ go32stub.h -coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic54x.lo: coff-tic54x.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ +coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \ +coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h -dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \ +coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h +dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h +ecoff.lo: ecoff.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/objalloc.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h -ecoff.lo: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \ - $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \ - elf32-target.h -elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf32-target.h -elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h +elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i370.h elf32-target.h -elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ + libhppa.h elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h +elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h +elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ +elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.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 +elf-m10200.lo: elf-m10200.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 +elf-m10300.lo: elf-m10300.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ +elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ elf32-target.h -elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ +elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elf32-target.h +elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -som.lo: som.c -i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +som.lo: som.c $(INCDIR)/filenames.h +i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386bsd.lo: i386bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386linux.lo: i386linux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h -i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/os9k.h -ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h -m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386lynx.lo: i386lynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386msdos.lo: i386msdos.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +i386netbsd.lo: i386netbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/os9k.h +ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ + libieee.h +m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68klinux.lo: m68klinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +m68klynx.lo: m68klynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h -nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \ +mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +newsos3.lo: newsos3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +nlm.lo: nlm.c $(INCDIR)/filenames.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +nlm32-i386.lo: nlm32-i386.c $(INCDIR)/filenames.h $(INCDIR)/nlm/i386-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \ +nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/sparc32-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/nlm/ppc-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \ - $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ - nlmswap.h nlm-target.h -nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h -pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \ +nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \ + liboasys.h +pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \ +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h +pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h -ppcboot.lo: ppcboot.c -reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \ +pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h +reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/internal.h libcoff.h +riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sparclinux.lo: sparclinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h -sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ - $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -versados.lo: versados.c $(INCDIR)/libiberty.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h -xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h coffswap.h ecoffswap.h -demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ +sparclynx.lo: sparclynx.c $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ aout-target.h -elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +sparcnetbsd.lo: sparcnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ + $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ - libcoff.h libecoff.h ecoffswap.h elf64-target.h -elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf64-target.h -elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \ - genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ - elf64-target.h -elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h +coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ + $(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ + coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ + libecoff.h ecoffswap.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ + libhppa.h elf64-hppa.h elf-hppa.h elf64-target.h +elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h +elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf64-target.h +elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ + ecoffswap.h elf64-target.h +elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ - libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h -hpux-core.lo: hpux-core.c -irix-core.lo: irix-core.c -lynx-core.lo: lynx-core.c -osf-core.lo: osf-core.c -sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h -trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h \ - hosts/i386linux.h -cisco-core.lo: cisco-core.c +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h +hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h +irix-core.lo: irix-core.c $(INCDIR)/filenames.h +lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h +osf-core.lo: osf-core.c $(INCDIR)/filenames.h +sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 0099f3f15d7..3192f328f4a 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -166,6 +166,7 @@ ALL_MACHINES = \ cpu-h8300.lo \ cpu-h8500.lo \ cpu-hppa.lo \ + cpu-ia64.lo \ cpu-i370.lo \ cpu-i386.lo \ cpu-i860.lo \ @@ -205,6 +206,7 @@ ALL_MACHINES_CFILES = \ cpu-h8300.c \ cpu-h8500.c \ cpu-hppa.c \ + cpu-ia64.c \ cpu-i370.c \ cpu-i386.c \ cpu-i860.c \ @@ -278,6 +280,7 @@ BFD32_BACKENDS = \ dwarf2.lo \ ecoff.lo \ ecofflink.lo \ + efi-app-ia32.lo \ elf.lo \ elf32-arc.lo \ elfarm-oabi.lo \ @@ -287,6 +290,7 @@ BFD32_BACKENDS = \ elf32-d30v.lo \ elf32-fr30.lo \ elf32-gen.lo \ + elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ elf32-i860.lo \ @@ -410,6 +414,7 @@ BFD32_BACKENDS_CFILES = \ dwarf2.c \ ecoff.c \ ecofflink.c \ + efi-app-ia32.c \ elf.c \ elf32-arc.c \ elfarm-oabi.c \ @@ -419,6 +424,7 @@ BFD32_BACKENDS_CFILES = \ elf32-d30v.c \ elf32-fr30.c \ elf32-gen.c \ + elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ elf32-i860.c \ @@ -504,8 +510,12 @@ BFD32_BACKENDS_CFILES = \ BFD64_BACKENDS = \ aout64.lo \ coff-alpha.lo \ + coff64-rs6000.lo \ demo64.lo \ + efi-app-ia64.lo \ elf64-alpha.lo \ + elf64-hppa.lo \ + elf64-ia64.lo \ elf64-gen.lo \ elf64-mips.lo \ elf64-sparc.lo \ @@ -517,8 +527,12 @@ BFD64_BACKENDS = \ BFD64_BACKENDS_CFILES = \ aout64.c \ coff-alpha.c \ + coff64-rs6000.c \ demo64.c \ + efi-app-ia64.c \ elf64-alpha.c \ + elf64-hppa.c \ + elf64-ia64.c \ elf64-gen.c \ elf64-mips.c \ elf64-sparc.c \ @@ -568,12 +582,12 @@ CFILES = \ SOURCE_HFILES = \ - aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \ - ecoffswap.h elf32-arm.h elfcode.h elfcore.h \ - elflink.h freebsd.h genlink.h go32stub.h libaout.h \ - libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \ - libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \ - nlmswap.h ns32k.h peicode.h som.h vms.h + aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \ + elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \ + elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ + hppa_stubs.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ + libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ + nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h HFILES = \ @@ -1180,487 +1194,567 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck -elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - -elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - # What appears below is generated by a hacked mkdep using gcc -MM. # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h -archures.lo: archures.c -bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -cache.lo: cache.c -coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h -corefile.lo: corefile.c -format.lo: format.c -init.lo: init.c -libbfd.lo: libbfd.c -opncls.lo: opncls.c $(INCDIR)/objalloc.h -reloc.lo: reloc.c $(INCDIR)/bfdlink.h -section.lo: section.c $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \ +archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/aout/ranlib.h +archures.lo: archures.c $(INCDIR)/filenames.h +bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ + libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +cache.lo: cache.c $(INCDIR)/filenames.h +coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h +corefile.lo: corefile.c $(INCDIR)/filenames.h +format.lo: format.c $(INCDIR)/filenames.h +init.lo: init.c $(INCDIR)/filenames.h +libbfd.lo: libbfd.c $(INCDIR)/filenames.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ + targmatch.h +hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +binary.lo: binary.c $(INCDIR)/filenames.h +tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h -hash.lo: hash.c $(INCDIR)/objalloc.h -linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h -srec.lo: srec.c $(INCDIR)/libiberty.h -binary.lo: binary.c -tekhex.lo: tekhex.c $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/libiberty.h -stabs.lo: stabs.c $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def -cpu-a29k.lo: cpu-a29k.c -cpu-alpha.lo: cpu-alpha.c -cpu-arc.lo: cpu-arc.c -cpu-arm.lo: cpu-arm.c -cpu-avr.lo: cpu-avr.c -cpu-d10v.lo: cpu-d10v.c -cpu-d30v.lo: cpu-d30v.c -cpu-fr30.lo: cpu-fr30.c -cpu-h8300.lo: cpu-h8300.c -cpu-h8500.lo: cpu-h8500.c -cpu-hppa.lo: cpu-hppa.c -cpu-i370.lo: cpu-i370.c -cpu-i386.lo: cpu-i386.c -cpu-i860.lo: cpu-i860.c -cpu-i960.lo: cpu-i960.c -cpu-m32r.lo: cpu-m32r.c -cpu-m68k.lo: cpu-m68k.c -cpu-m88k.lo: cpu-m88k.c -cpu-m10200.lo: cpu-m10200.c -cpu-m10300.lo: cpu-m10300.c -cpu-mcore.lo: cpu-mcore.c -cpu-mips.lo: cpu-mips.c -cpu-ns32k.lo: cpu-ns32k.c ns32k.h -cpu-pj.lo: cpu-pj.c -cpu-powerpc.lo: cpu-powerpc.c -cpu-rs6000.lo: cpu-rs6000.c -cpu-sh.lo: cpu-sh.c -cpu-sparc.lo: cpu-sparc.c -cpu-tic30.lo: cpu-tic30.c -cpu-tic80.lo: cpu-tic80.c -cpu-tic54x.lo: cpu-tic54x.c -cpu-v850.lo: cpu-v850.c -cpu-vax.lo: cpu-vax.c -cpu-we32k.lo: cpu-we32k.c -cpu-w65.lo: cpu-w65.c -cpu-z8k.lo: cpu-z8k.c -aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \ +cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h +cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h +cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h +cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h +cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h +cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h +cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h +cpu-ia64.lo: cpu-ia64.c $(INCDIR)/filenames.h cpu-ia64-opc.c \ + $(srcdir)/../opcodes/ia64-opc.h $(INCDIR)/opcode/ia64.h +cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h +cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h +cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h +cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h +cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h +cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h +cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h +cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h +cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h +cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h +cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h +cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h +cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h +cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h +cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h +cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h +cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h +aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h -aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h +aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ ns32k.h libaout.h $(INCDIR)/bfdlink.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ - libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \ + libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h aoutx.h -aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ + $(INCDIR)/aout/ar.h aout-target.h +aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h +aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ + libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h -cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \ +armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h +cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \ +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \ +coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h +coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \ +coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \ +coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \ +coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ - ecoffswap.h -coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \ +coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \ + libecoff.h coffswap.h ecoffswap.h +coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ + xcoff-target.h coffcode.h coffswap.h +coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ +coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ go32stub.h -coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic54x.lo: coff-tic54x.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h \ +coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \ +coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h -dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \ +coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h +dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h +ecoff.lo: ecoff.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/objalloc.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h -ecoff.lo: ecoff.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/ar.h \ - $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \ - elf32-target.h -elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf32-target.h -elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h +elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i370.h elf32-target.h -elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ + libhppa.h elf32-hppa.h elf-hppa.h hppa_stubs.h elf32-target.h +elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h +elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ +elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.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 +elf-m10200.lo: elf-m10200.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 +elf-m10300.lo: elf-m10300.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ +elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ elf32-target.h -elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ +elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elf32-target.h +elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -som.lo: som.c -i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +som.lo: som.c $(INCDIR)/filenames.h +i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386bsd.lo: i386bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386linux.lo: i386linux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h -i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/os9k.h -ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h -m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386lynx.lo: i386lynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386msdos.lo: i386msdos.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +i386netbsd.lo: i386netbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/os9k.h +ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ + libieee.h +m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68klinux.lo: m68klinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +m68klynx.lo: m68klynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h -nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \ +mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +newsos3.lo: newsos3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +nlm.lo: nlm.c $(INCDIR)/filenames.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +nlm32-i386.lo: nlm32-i386.c $(INCDIR)/filenames.h $(INCDIR)/nlm/i386-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \ +nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/sparc32-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/nlm/ppc-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \ - $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ - nlmswap.h nlm-target.h -nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h -pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \ +nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \ + liboasys.h +pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \ +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h +pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(INCDIR)/coff/mipspe.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h -ppcboot.lo: ppcboot.c -reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \ +pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ + $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h +ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h +reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/internal.h libcoff.h +riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sparclinux.lo: sparclinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h -sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ - $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -versados.lo: versados.c $(INCDIR)/libiberty.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h -xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h coffswap.h ecoffswap.h -demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ +sparclynx.lo: sparclynx.c $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ aout-target.h -elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +sparcnetbsd.lo: sparcnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ + $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ - libcoff.h libecoff.h ecoffswap.h elf64-target.h -elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf64-target.h -elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \ - genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ - elf64-target.h -elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h +coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ + $(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ + coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ + libecoff.h ecoffswap.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ + libhppa.h elf64-hppa.h elf-hppa.h elf64-target.h +elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h +elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h elf64-target.h +elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ + ecoffswap.h elf64-target.h +elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ - libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h -hpux-core.lo: hpux-core.c -irix-core.lo: irix-core.c -lynx-core.lo: lynx-core.c -osf-core.lo: osf-core.c -sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h -trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h \ - hosts/i386linux.h -cisco-core.lo: cisco-core.c +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h +hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h +irix-core.lo: irix-core.c $(INCDIR)/filenames.h +lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h +osf-core.lo: osf-core.c $(INCDIR)/filenames.h +sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 01dd9eee4c0..4b0940d7ad5 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1,5 +1,5 @@ /* BFD semi-generic back-end for a.out binaries. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -2833,7 +2833,7 @@ NAME(aout,find_nearest_line) } if (main_file_name == NULL - || main_file_name[0] == '/' + || IS_ABSOLUTE_PATH (main_file_name) || directory_name == NULL) filelen = 0; else @@ -2857,7 +2857,7 @@ NAME(aout,find_nearest_line) if (main_file_name != NULL) { - if (main_file_name[0] == '/' || directory_name == NULL) + if (IS_ABSOLUTE_PATH (main_file_name) || directory_name == NULL) *filename_ptr = main_file_name; else { diff --git a/bfd/archive.c b/bfd/archive.c index 19293af4573..5709f26e272 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -1,5 +1,5 @@ /* BFD back-end for archive files (libraries). - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -894,10 +894,10 @@ do_slurp_coff_armap (abfd) bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd); - if (tmp != NULL) + if (tmp != NULL) { if (tmp->arch_header[0] == '/' - && tmp->arch_header[1] == ' ') + && tmp->arch_header[1] == ' ') { ardata->first_file_filepos += (tmp->parsed_size + sizeof(struct ar_hdr) + 1) & ~1; @@ -1183,6 +1183,17 @@ normalize (abfd, file) { const char *filename = strrchr (file, '/'); + +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (file, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && file[0] != '\0' && file[1] == ':') + filename = file + 1; + } +#endif if (filename != (char *) NULL) filename++; else @@ -1340,6 +1351,23 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) /** A couple of functions for creating ar_hdrs */ +#ifdef HPUX_LARGE_AR_IDS +/* Function to encode large UID/GID values according to HP. */ +static void +hpux_uid_gid_encode (str, id) + char str[6]; + long int id; +{ + int cnt; + + str[5] = '@' + (id & 3); + id >>= 2; + + for (cnt = 4; cnt >= 0; ++cnt, id >>= 6) + str[cnt] = ' ' + (id & 0x3f); +} +#endif /* HPUX_LARGE_AR_IDS */ + #ifndef HAVE_GETUID #define getuid() 0 #endif @@ -1393,7 +1421,21 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) /* Goddamned sprintf doesn't permit MAXIMUM field lengths */ sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime); - sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid); +#ifdef HPUX_LARGE_AR_IDS + /* HP has a very "special" way to handle UID/GID's with numeric values + > 99999. */ + if (status.st_uid > 99999) + hpux_uid_gid_encode (hdr->ar_gid, (long) status.st_uid); + else +#endif + sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid); +#ifdef HPUX_LARGE_AR_IDS + /* HP has a very "special" way to handle UID/GID's with numeric values + > 99999. */ + if (status.st_gid > 99999) + hpux_uid_gid_encode (hdr->ar_uid, (long) status.st_gid); + else +#endif sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid); sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode); sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size); @@ -1453,10 +1495,30 @@ bfd_generic_stat_arch_elt (abfd, buf) #define foo(arelt, stelt, size) \ buf->stelt = strtol (hdr->arelt, &aloser, size); \ if (aloser == hdr->arelt) return -1; + /* Some platforms support special notations for large IDs. */ +#ifdef HPUX_LARGE_AR_IDS +# define foo2(arelt, stelt, size) \ + if (hdr->arelt[5] == ' ') { foo (arelt, stelt, size); } \ + else { \ + int cnt; \ + for (buf->stelt = cnt = 0; cnt < 5; ++cnt) \ + { \ + if (hdr->arelt[cnt] < ' ' || hdr->arelt[cnt] > ' ' + 0x3f) \ + return -1; \ + buf->stelt <<= 6; \ + buf->stelt += hdr->arelt[cnt] - ' '; \ + } \ + if (hdr->arelt[5] < '@' || hdr->arelt[5] > '@' + 3) return -1; \ + buf->stelt <<= 2; \ + buf->stelt += hdr->arelt[5] - '@'; \ + } +#else +# define foo2(arelt, stelt, size) foo (arelt, stelt, size) +#endif foo (ar_date, st_mtime, 10); - foo (ar_uid, st_uid, 10); - foo (ar_gid, st_gid, 10); + foo2 (ar_uid, st_uid, 10); + foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); buf->st_size = arch_eltdata (abfd)->parsed_size; @@ -1515,6 +1577,17 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) CONST char *filename = strrchr (pathname, '/'); int maxlen = ar_maxnamelen (abfd); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (pathname, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') + filename = pathname + 1; + } +#endif + if (filename == NULL) filename = pathname; else @@ -1555,6 +1628,17 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr) CONST char *filename = strrchr (pathname, '/'); int maxlen = ar_maxnamelen (abfd); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ + char *bslash = strrchr (pathname, '\\'); + if (bslash > filename) + filename = bslash; + if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') + filename = pathname + 1; + } +#endif + if (filename == NULL) filename = pathname; else diff --git a/bfd/archures.c b/bfd/archures.c index d24ee820b7d..536f2b1358d 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -199,6 +199,7 @@ DESCRIPTION . bfd_arch_fr30, .#define bfd_mach_fr30 0x46523330 . bfd_arch_mcore, +. bfd_arch_ia64, {* HP/Intel ia64 *} . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers *} .#define bfd_mach_avr1 1 @@ -279,6 +280,7 @@ extern const bfd_arch_info_type bfd_v850_arch; extern const bfd_arch_info_type bfd_fr30_arch; extern const bfd_arch_info_type bfd_mcore_arch; extern const bfd_arch_info_type bfd_avr_arch; +extern const bfd_arch_info_type bfd_ia64_arch; static const bfd_arch_info_type * const bfd_archures_list[] = { @@ -320,6 +322,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_fr30_arch, &bfd_mcore_arch, &bfd_avr_arch, + &bfd_ia64_arch, #endif 0 }; diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 1f67c0c3a25..dc172bf7dac 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -89,7 +89,7 @@ typedef struct _bfd bfd; /* Yup, SVR4 has a "typedef enum boolean" in -fnf */ /* It gets worse if the host also defines a true/false enum... -sts */ /* And even worse if your compiler has built-in boolean types... -law */ -#if defined (__GNUG__) && (__GNUC_MINOR__ > 5) +#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) #define TRUE_FALSE_ALREADY_DEFINED #endif #ifdef MPW @@ -640,6 +640,9 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); error occurs; bfd_get_error will return an appropriate code. */ extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Return the arch_size field of an elf bfd, or -1 if not elf. */ +extern int bfd_elf_get_arch_size PARAMS ((bfd *)); + /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list @@ -748,4 +751,11 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +/* TI COFF load page support. */ +extern void bfd_ticoff_set_section_load_page + PARAMS ((struct sec *, int)); + +extern int bfd_ticoff_get_section_load_page + PARAMS ((struct sec *)); + /* And more from the source. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 79080cbaad5..a3f6d8cf675 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -89,7 +89,7 @@ typedef struct _bfd bfd; /* Yup, SVR4 has a "typedef enum boolean" in -fnf */ /* It gets worse if the host also defines a true/false enum... -sts */ /* And even worse if your compiler has built-in boolean types... -law */ -#if defined (__GNUG__) && (__GNUC_MINOR__ > 5) +#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) #define TRUE_FALSE_ALREADY_DEFINED #endif #ifdef MPW @@ -640,6 +640,9 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); error occurs; bfd_get_error will return an appropriate code. */ extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Return the arch_size field of an elf bfd, or -1 if not elf. */ +extern int bfd_elf_get_arch_size PARAMS ((bfd *)); + /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list @@ -748,6 +751,13 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +/* TI COFF load page support. */ +extern void bfd_ticoff_set_section_load_page + PARAMS ((struct sec *, int)); + +extern int bfd_ticoff_get_section_load_page + PARAMS ((struct sec *)); + /* And more from the source. */ void bfd_init PARAMS ((void)); @@ -1058,9 +1068,9 @@ typedef struct sec #define SEC_SHARED 0x4000000 /* When a section with this flag is being linked, then if the size of - the input section is less than a page, it should not cross a page - boundary. If the size of the input section is one page or more, it - should be aligned on a page boundary. */ + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ #define SEC_BLOCK 0x8000000 /* Conditionally link this section; do not link if there are no @@ -1425,6 +1435,7 @@ enum bfd_architecture bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ bfd_arch_pj, bfd_arch_avr, /* Atmel AVR microcontrollers */ #define bfd_mach_avr1 1 @@ -2441,6 +2452,75 @@ is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. */ BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY, + +/* Intel IA64 Relocations. */ + BFD_RELOC_IA64_IMM14, + BFD_RELOC_IA64_IMM22, + BFD_RELOC_IA64_IMM64, + BFD_RELOC_IA64_DIR32MSB, + BFD_RELOC_IA64_DIR32LSB, + BFD_RELOC_IA64_DIR64MSB, + BFD_RELOC_IA64_DIR64LSB, + BFD_RELOC_IA64_GPREL22, + BFD_RELOC_IA64_GPREL64I, + BFD_RELOC_IA64_GPREL32MSB, + BFD_RELOC_IA64_GPREL32LSB, + BFD_RELOC_IA64_GPREL64MSB, + BFD_RELOC_IA64_GPREL64LSB, + BFD_RELOC_IA64_LTOFF22, + BFD_RELOC_IA64_LTOFF64I, + BFD_RELOC_IA64_PLTOFF22, + BFD_RELOC_IA64_PLTOFF64I, + BFD_RELOC_IA64_PLTOFF64MSB, + BFD_RELOC_IA64_PLTOFF64LSB, + BFD_RELOC_IA64_FPTR64I, + BFD_RELOC_IA64_FPTR32MSB, + BFD_RELOC_IA64_FPTR32LSB, + BFD_RELOC_IA64_FPTR64MSB, + BFD_RELOC_IA64_FPTR64LSB, + BFD_RELOC_IA64_PCREL21B, + BFD_RELOC_IA64_PCREL21BI, + BFD_RELOC_IA64_PCREL21M, + BFD_RELOC_IA64_PCREL21F, + BFD_RELOC_IA64_PCREL22, + BFD_RELOC_IA64_PCREL60B, + BFD_RELOC_IA64_PCREL64I, + BFD_RELOC_IA64_PCREL32MSB, + BFD_RELOC_IA64_PCREL32LSB, + BFD_RELOC_IA64_PCREL64MSB, + BFD_RELOC_IA64_PCREL64LSB, + BFD_RELOC_IA64_LTOFF_FPTR22, + BFD_RELOC_IA64_LTOFF_FPTR64I, + BFD_RELOC_IA64_LTOFF_FPTR64MSB, + BFD_RELOC_IA64_LTOFF_FPTR64LSB, + BFD_RELOC_IA64_SEGBASE, + BFD_RELOC_IA64_SEGREL32MSB, + BFD_RELOC_IA64_SEGREL32LSB, + BFD_RELOC_IA64_SEGREL64MSB, + BFD_RELOC_IA64_SEGREL64LSB, + BFD_RELOC_IA64_SECREL32MSB, + BFD_RELOC_IA64_SECREL32LSB, + BFD_RELOC_IA64_SECREL64MSB, + BFD_RELOC_IA64_SECREL64LSB, + BFD_RELOC_IA64_REL32MSB, + BFD_RELOC_IA64_REL32LSB, + BFD_RELOC_IA64_REL64MSB, + BFD_RELOC_IA64_REL64LSB, + BFD_RELOC_IA64_LTV32MSB, + BFD_RELOC_IA64_LTV32LSB, + BFD_RELOC_IA64_LTV64MSB, + BFD_RELOC_IA64_LTV64LSB, + BFD_RELOC_IA64_IPLTMSB, + BFD_RELOC_IA64_IPLTLSB, + BFD_RELOC_IA64_EPLTMSB, + BFD_RELOC_IA64_EPLTLSB, + BFD_RELOC_IA64_COPY, + BFD_RELOC_IA64_TPREL22, + BFD_RELOC_IA64_TPREL64MSB, + BFD_RELOC_IA64_TPREL64LSB, + BFD_RELOC_IA64_LTOFF_TP22, + BFD_RELOC_IA64_LTOFF22X, + BFD_RELOC_IA64_LDXMOV, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * diff --git a/bfd/cache.c b/bfd/cache.c index ad3140e1ed7..91b6c610854 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -1,5 +1,6 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000 + Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -300,10 +301,17 @@ bfd_open_file (abfd) So we unlink the output file if and only if it has non-zero size. */ +#ifndef __MSDOS__ + /* Don't do this for MSDOS: it doesn't care about overwriting + a running binary, but if this file is already open by + another BFD, we will be in deep trouble if we delete an + open file. In fact, objdump does just that if invoked with + the --info option. */ struct stat s; if (stat (abfd->filename, &s) == 0 && s.st_size != 0) unlink (abfd->filename); +#endif abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); abfd->opened_once = true; } diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index 0374b20b473..26d3c6401f2 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -1,5 +1,5 @@ /* BFD back-end for AMD 29000 COFF binaries. - Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 99, 2000 Free Software Foundation, Inc. Contributed by David Wood at New York University 7/8/91. @@ -43,9 +43,9 @@ static boolean coff_a29k_adjust_symndx #define INSERT_HWORD(WORD,HWORD) \ (((WORD) & 0xff00ff00) | (((HWORD) & 0xff00) << 8) | ((HWORD)& 0xff)) #define EXTRACT_HWORD(WORD) \ - ((((WORD) & 0x00ff0000) >> 8) | ((WORD)& 0xff)) + ((((WORD) & 0x00ff0000) >> 8) | ((WORD) & 0xff)) #define SIGN_EXTEND_HWORD(HWORD) \ - ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD)) + (((HWORD) ^ 0x8000) - 0x8000) /* Provided the symbol, returns the value reffed */ static long diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 6bbc279aeea..79b8023d31d 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2266,7 +2266,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in, alpha_ecoff_swap_scnhdr_in, NULL, alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, diff --git a/bfd/coff-go32.c b/bfd/coff-go32.c index a6b28e12eb4..720f4be1424 100644 --- a/bfd/coff-go32.c +++ b/bfd/coff-go32.c @@ -29,6 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.d"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.t"), \ diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c new file mode 100644 index 00000000000..df867e73717 --- /dev/null +++ b/bfd/coff-ia64.c @@ -0,0 +1,198 @@ +/* BFD back-end for HP/Intel IA-64 COFF files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +#include "coff/ia64.h" + +#include "coff/internal.h" + +#include "coff/pe.h" + +#include "libcoff.h" + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) +/* The page size is a guess based on ELF. */ + +#define COFF_PAGE_SIZE 0x1000 + +static reloc_howto_type howto_table[] = +{ + {0}, +}; + +#define BADMAG(x) IA64BADMAG(x) +#define IA64 1 /* Customize coffcode.h */ + +#ifdef COFF_WITH_PEP64 +# undef AOUTSZ +# define AOUTSZ PEP64AOUTSZ +# define PEAOUTHDR PEP64AOUTHDR +#endif + +#define RTYPE2HOWTO(cache_ptr, dst) \ + (cache_ptr)->howto = howto_table + (dst)->r_type; + +#ifdef COFF_WITH_PE +/* Return true if this relocation should + appear in the output .reloc section. */ + +static boolean +in_reloc_p(abfd, howto) + bfd * abfd; + reloc_howto_type *howto; +{ + return 0; /* We don't do relocs for now... */ +} +#endif + +#include "coffcode.h" + +static const bfd_target * +ia64coff_object_p (abfd) + bfd *abfd; +{ +#ifdef COFF_IMAGE_WITH_PE + /* We need to hack badly to handle a PE image correctly. In PE + images created by the GNU linker, the offset to the COFF header + is always the size. However, this is not the case in images + generated by other PE linkers. The PE format stores a four byte + offset to the PE signature just before the COFF header at + location 0x3c of the file. We pick up that offset, verify that + the PE signature is there, and then set ourselves up to read in + the COFF header. */ + { + bfd_byte ext_offset[4]; + file_ptr offset; + bfd_byte ext_signature[4]; + unsigned long signature; + + if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0 + || bfd_read (ext_offset, 1, 4, abfd) != 4) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + offset = bfd_h_get_32 (abfd, ext_offset); + if (bfd_seek (abfd, offset, SEEK_SET) != 0 + || bfd_read (ext_signature, 1, 4, abfd) != 4) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + signature = bfd_h_get_32 (abfd, ext_signature); + + if (signature != 0x4550) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Here is the hack. coff_object_p wants to read filhsz bytes to + pick up the COFF header. We adjust so that that will work. 20 + is the size of the COFF filehdr. */ + + if (bfd_seek (abfd, + (bfd_tell (abfd) + - bfd_coff_filhsz (abfd) + + 20), + SEEK_SET) + != 0) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } +#endif + + return coff_object_p (abfd); +} + +const bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + ia64coff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "coff-ia64", /* name */ +#endif + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + +#ifndef COFF_WITH_PE + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA), +#else + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), +#endif + +#ifdef TARGET_UNDERSCORE + TARGET_UNDERSCORE, /* leading underscore */ +#else + 0, /* leading underscore */ +#endif + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + +/* Note that we allow an object file to be treated as a core file as well. */ + {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, ia64coff_object_p}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index bb4b15e96c2..dd7ace5ecdd 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS Extended-Coff files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -910,7 +910,7 @@ mips_gprel_reloc (abfd, reloc_entry->address += input_section->output_offset; /* Make sure it fit in 16 bits. */ - if (val >= 0x8000 && val < 0xffff8000) + if ((long) val >= 0x8000 || (long) val < -0x8000) return bfd_reloc_overflow; return bfd_reloc_ok; @@ -2505,7 +2505,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in, mips_ecoff_swap_scnhdr_in, NULL, mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, diff --git a/bfd/coff-pmac.c b/bfd/coff-pmac.c index f3332d98959..790160b7de5 100644 --- a/bfd/coff-pmac.c +++ b/bfd/coff-pmac.c @@ -17,11 +17,20 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_SYM pmac_xcoff_vec -#define TARGET_NAME "xcoff-powermac" /* Tweak coffcode.h based on this being a PowerMac instead of RS/6000. */ #define POWERMAC -#include "coff-rs6000.c" +#define TARGET_SYM pmac_xcoff_vec +#define TARGET_NAME "xcoff-powermac" + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "coff/rs6000.h" +#include "libcoff.h" +#include "xcoff-target.h" + + diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 6f8563f911b..46894001a7b 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -26,8 +26,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Internalcoff.h and coffcode.h modify themselves based on this flag. */ -#define RS6000COFF_C 1 #include "bfd.h" #include "sysdep.h" @@ -35,32 +33,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coff/internal.h" #include "coff/rs6000.h" #include "libcoff.h" +#define TARGET_NAME "aixcoff-rs6000" +#define TARGET_SYM rs6000coff_vec +#include "xcoff-target.h" + /* The main body of code is in coffcode.h. */ -static boolean xcoff_mkobject PARAMS ((bfd *)); -static boolean xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean xcoff_is_local_label_name PARAMS ((bfd *, const char *)); -static void xcoff_rtype2howto - PARAMS ((arelent *, struct internal_reloc *)); -static reloc_howto_type *xcoff_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static boolean xcoff_slurp_armap PARAMS ((bfd *)); -static const bfd_target *xcoff_archive_p PARAMS ((bfd *)); -static PTR xcoff_read_ar_hdr PARAMS ((bfd *)); -static bfd *xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); -static int xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); static const char *normalize_filename PARAMS ((bfd *)); -static boolean xcoff_write_armap - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); -static boolean xcoff_write_archive_contents PARAMS ((bfd *)); -static int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean)); - + /* We use our own tdata type. Its first field is the COFF tdata type, so the COFF routines are compatible. */ -static boolean -xcoff_mkobject (abfd) +boolean +_bfd_xcoff_mkobject (abfd) bfd *abfd; { coff_data_type *coff; @@ -90,8 +76,8 @@ xcoff_mkobject (abfd) /* Copy XCOFF data from one BFD to another. */ -static boolean -xcoff_copy_private_bfd_data (ibfd, obfd) +boolean +_bfd_xcoff_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { @@ -138,13 +124,292 @@ xcoff_copy_private_bfd_data (ibfd, obfd) The AIX native linker does not have a -X option, and it ignores the -x option. */ -static boolean -xcoff_is_local_label_name (abfd, name) +boolean +_bfd_xcoff_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name ATTRIBUTE_UNUSED; { return false; } + + + +void +_bfd_xcoff_swap_sym_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + SYMENT *ext = (SYMENT *)ext1; + struct internal_syment *in = (struct internal_syment *)in1; + + + if(ext->e.e_name[0] != 0) + { + memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + } + else + { + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = + bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset); + } + + in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); + in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); + in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); + in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); + in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); +} + +unsigned int +_bfd_xcoff_swap_sym_out (abfd, inp, extp) + bfd *abfd; + PTR inp; + PTR extp; +{ + struct internal_syment *in = (struct internal_syment *)inp; + SYMENT *ext =(SYMENT *)extp; + + if(in->_n._n_name[0] != 0) + { + memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + } + else + { + bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); + bfd_h_put_32(abfd, in->_n._n_n._n_offset, + (bfd_byte *) ext->e.e.e_offset); + } + + bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value); + bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); + bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); + bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); + bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + return bfd_coff_symesz (abfd); +} + +#define PUTWORD bfd_h_put_32 +#define PUTHALF bfd_h_put_16 +#define PUTBYTE bfd_h_put_8 +#define GETWORD bfd_h_get_32 +#define GETHALF bfd_h_get_16 +#define GETBYTE bfd_h_get_8 + +void +_bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) + bfd *abfd; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; +{ + AUXENT *ext = (AUXENT *)ext1; + union internal_auxent *in = (union internal_auxent *)in1; + + switch (class) { + case C_FILE: + if (ext->x_file.x_fname[0] == 0) { + in->x_file.x_n.x_zeroes = 0; + in->x_file.x_n.x_offset = + bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + } else { + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + in->x_csect.x_scnlen.l = + bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); + in->x_csect.x_parmhash = bfd_h_get_32 (abfd, + ext->x_csect.x_parmhash); + in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); + in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); + in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab); + in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + in->x_scn.x_scnlen = bfd_h_get_32(abfd, + (bfd_byte *) ext->x_scn.x_scnlen); + in->x_scn.x_nreloc = bfd_h_get_16(abfd, + (bfd_byte *) ext->x_scn.x_nreloc); + in->x_scn.x_nlinno = bfd_h_get_16(abfd, + (bfd_byte *) ext->x_scn.x_nlinno); + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + + goto end; + } + break; + } + + in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); + in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + else + { + in->x_sym.x_fcnary.x_ary.x_dimen[0] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + in->x_sym.x_fcnary.x_ary.x_dimen[1] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + in->x_sym.x_fcnary.x_ary.x_dimen[2] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + in->x_sym.x_fcnary.x_ary.x_dimen[3] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + if (ISFCN(type)) { + in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else { + in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_size); + } + +end: ; + /* the semicolon is because MSVC doesn't like labels at + end of block. */ + +} + + + +unsigned int +_bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) + bfd *abfd; + PTR inp; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR extp; +{ + union internal_auxent *in = (union internal_auxent *)inp; + AUXENT *ext = (AUXENT *)extp; + + memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); + switch (class) + { + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); + PUTWORD(abfd, + in->x_file.x_n.x_offset, + (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen); + PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); + PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen); + bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc); + bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno); + goto end; + } + break; + } + + PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + PUTWORD(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + bfd_h_put_32(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + else + { + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + + if (ISFCN (type)) + PUTWORD (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) ext->x_sym.x_misc.x_fsize); + else + { + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno); + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size); + } + +end: + return bfd_coff_auxesz (abfd); +} + + /* The XCOFF reloc table. Actually, XCOFF relocations specify the bitsize and whether they are signed or not, along with a @@ -152,7 +417,11 @@ xcoff_is_local_label_name (abfd, name) different algorithms for putting in the reloc. Many of these relocs need special_function entries, which I have not written. */ -static reloc_howto_type xcoff_howto_table[] = +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value + from smaller values. Start with zero, widen, *then* decrement. */ +#define MINUS_ONE (((bfd_vma)0) - 1) + +reloc_howto_type xcoff_howto_table[] = { /* Standard 32 bit relocation. */ HOWTO (0, /* type */ @@ -493,7 +762,21 @@ static reloc_howto_type xcoff_howto_table[] = true, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + HOWTO (0, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ false) /* pcrel_offset */ + }; /* These are the first two like the above but for 16-bit relocs. */ @@ -542,11 +825,11 @@ static reloc_howto_type xcoff_howto_table_16[] = true, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ -}; + false) /* pcrel_offset */ + }; -static void -xcoff_rtype2howto (relent, internal) +void +_bfd_xcoff_rtype2howto (relent, internal) arelent *relent; struct internal_reloc *internal; { @@ -571,8 +854,8 @@ xcoff_rtype2howto (relent, internal) #endif } -static reloc_howto_type * -xcoff_reloc_type_lookup (abfd, code) +reloc_howto_type * +_bfd_xcoff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { @@ -587,34 +870,13 @@ xcoff_reloc_type_lookup (abfd, code) case BFD_RELOC_32: case BFD_RELOC_CTOR: return &xcoff_howto_table[0]; + case BFD_RELOC_64: + return &xcoff_howto_table[0x1c]; default: return NULL; } } -#define SELECT_RELOC(internal, howto) \ - { \ - internal.r_type = howto->type; \ - internal.r_size = \ - ((howto->complain_on_overflow == complain_overflow_signed \ - ? 0x80 \ - : 0) \ - | (howto->bitsize - 1)); \ - } - -#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) - -#define COFF_LONG_FILENAMES - -#define RTYPE2HOWTO(cache_ptr, dst) xcoff_rtype2howto (cache_ptr, dst) - -#define coff_mkobject xcoff_mkobject -#define coff_bfd_copy_private_bfd_data xcoff_copy_private_bfd_data -#define coff_bfd_is_local_label_name xcoff_is_local_label_name -#define coff_bfd_reloc_type_lookup xcoff_reloc_type_lookup -#define coff_relocate_section _bfd_ppc_xcoff_relocate_section - -#include "coffcode.h" /* XCOFF archive support. The original version of this code was by Damon A. Permezel. It was enhanced to permit cross support, and @@ -826,27 +1088,10 @@ struct xcoff_ar_hdr_big #define arch_xhdr_big(bfd) \ ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header) -/* XCOFF archives do not have anything which corresponds to an - extended name table. */ - -#define xcoff_slurp_extended_name_table bfd_false -#define xcoff_construct_extended_name_table \ - ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ - bfd_false) -#define xcoff_truncate_arname bfd_dont_truncate_arname - -/* We can use the standard get_elt_at_index routine. */ - -#define xcoff_get_elt_at_index _bfd_generic_get_elt_at_index - -/* XCOFF archives do not have a timestamp. */ - -#define xcoff_update_armap_timestamp bfd_true - /* Read in the armap of an XCOFF archive. */ -static boolean -xcoff_slurp_armap (abfd) +boolean +_bfd_xcoff_slurp_armap (abfd) bfd *abfd; { file_ptr off; @@ -969,8 +1214,8 @@ xcoff_slurp_armap (abfd) /* See if this is an XCOFF archive. */ -static const bfd_target * -xcoff_archive_p (abfd) +const bfd_target * +_bfd_xcoff_archive_p (abfd) bfd *abfd; { char magic[SXCOFFARMAG]; @@ -1060,7 +1305,7 @@ xcoff_archive_p (abfd) memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR_BIG); } - if (! xcoff_slurp_armap (abfd)) + if (! _bfd_xcoff_slurp_armap (abfd)) { bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = (struct artdata *) NULL; @@ -1072,8 +1317,8 @@ xcoff_archive_p (abfd) /* Read the archive header in an XCOFF archive. */ -static PTR -xcoff_read_ar_hdr (abfd) +PTR +_bfd_xcoff_read_ar_hdr (abfd) bfd *abfd; { size_t namlen; @@ -1160,8 +1405,8 @@ xcoff_read_ar_hdr (abfd) /* Open the next element in an XCOFF archive. */ -static bfd * -xcoff_openr_next_archived_file (archive, last_file) +bfd * +_bfd_xcoff_openr_next_archived_file (archive, last_file) bfd *archive; bfd *last_file; { @@ -1221,8 +1466,8 @@ xcoff_openr_next_archived_file (archive, last_file) /* Stat an element in an XCOFF archive. */ -static int -xcoff_generic_stat_arch_elt (abfd, s) +int +_bfd_xcoff_generic_stat_arch_elt (abfd, s) bfd *abfd; struct stat *s; { @@ -1452,8 +1697,8 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) } /*ARGSUSED*/ -static boolean -xcoff_write_armap (abfd, elength, map, orl_count, stridx) +boolean +_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength ATTRIBUTE_UNUSED; struct orl *map; @@ -1983,8 +2228,8 @@ xcoff_write_archive_contents_big (abfd) return true; } -static boolean -xcoff_write_archive_contents (abfd) +boolean +_bfd_xcoff_write_archive_contents (abfd) bfd *abfd; { if (! xcoff_big_format_p (abfd)) @@ -1997,7 +2242,7 @@ xcoff_write_archive_contents (abfd) always uses an a.out header. */ /*ARGSUSED*/ -static int +int _bfd_xcoff_sizeof_headers (abfd, reloc) bfd *abfd; boolean reloc ATTRIBUTE_UNUSED; @@ -2013,115 +2258,4 @@ _bfd_xcoff_sizeof_headers (abfd, reloc) return size; } -#define CORE_FILE_P _bfd_dummy_target - -#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command -#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal -#define coff_core_file_matches_executable_p \ - _bfd_nocore_core_file_matches_executable_p - -#ifdef AIX_CORE -#undef CORE_FILE_P -#define CORE_FILE_P rs6000coff_core_p -extern const bfd_target * rs6000coff_core_p (); -extern boolean rs6000coff_get_section_contents (); -extern boolean rs6000coff_core_file_matches_executable_p (); - -#undef coff_core_file_matches_executable_p -#define coff_core_file_matches_executable_p \ - rs6000coff_core_file_matches_executable_p - -extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_command -#define coff_core_file_failing_command rs6000coff_core_file_failing_command - -extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_signal -#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal - -#undef coff_get_section_contents -#define coff_get_section_contents rs6000coff_get_section_contents -#endif /* AIX_CORE */ - -#ifdef LYNX_CORE - -#undef CORE_FILE_P -#define CORE_FILE_P lynx_core_file_p -extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd)); - -extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd, - bfd *exec_bfd)); -#undef coff_core_file_matches_executable_p -#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p - -extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_command -#define coff_core_file_failing_command lynx_core_file_failing_command - -extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_signal -#define coff_core_file_failing_signal lynx_core_file_failing_signal - -#endif /* LYNX_CORE */ - -#define _bfd_xcoff_bfd_get_relocated_section_contents \ - coff_bfd_get_relocated_section_contents -#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section -#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections -#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section - -/* The transfer vector that leads the outside world to all of the above. */ - -const bfd_target -#ifdef TARGET_SYM - TARGET_SYM = -#else - rs6000coff_vec = -#endif -{ -#ifdef TARGET_NAME - TARGET_NAME, -#else - "aixcoff-rs6000", /* name */ -#endif - bfd_target_coff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | DYNAMIC | - HAS_SYMS | HAS_LOCALS | WP_TEXT), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading char */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen??? FIXMEmgo */ - - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - xcoff_archive_p, CORE_FILE_P}, - {bfd_false, coff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - xcoff_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (coff), - BFD_JUMP_TABLE_ARCHIVE (xcoff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (_bfd_xcoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff), - - NULL, - - COFF_SWAP_TABLE -}; + diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 821fecd4db2..1b78ef4f371 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -3198,6 +3198,16 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table = false, #endif 2, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook, coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c index 26dba40b5e3..45e7d62795a 100644 --- a/bfd/coff-stgo32.c +++ b/bfd/coff-stgo32.c @@ -46,6 +46,8 @@ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 } #include "bfd.h" diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index 2a5aafbfef4..4ae62e31a51 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C54X coff binaries. - Copyright (C) 1999,2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) This file is part of BFD, the Binary File Descriptor library. @@ -76,6 +76,56 @@ tic54x_getl_signed_32 (addr) return COERCE32 (v); } +#define coff_get_section_load_page bfd_ticoff_get_section_load_page +#define coff_set_section_load_page bfd_ticoff_set_section_load_page + +void +bfd_ticoff_set_section_load_page (sect, page) + asection *sect; + int page; +{ + sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page); +} + + +int +bfd_ticoff_get_section_load_page (sect) + asection *sect; +{ + int page; + + /* Provide meaningful defaults for predefined sections. */ + if (sect == &bfd_com_section) + page = PG_DATA; + + else if (sect == &bfd_und_section + || sect == &bfd_abs_section + || sect == &bfd_ind_section) + page = PG_PROG; + + else + page = FLAG_TO_PG (sect->lma); + + return page; +} + +/* Set the architecture appropriately. Allow unkown architectures + (e.g. binary). */ +static boolean +tic54x_set_arch_mach (abfd, arch, machine) + bfd *abfd; + enum bfd_architecture arch; + unsigned long machine; +{ + if (arch == bfd_arch_unknown) + arch = bfd_arch_tic54x; + + else if (arch != bfd_arch_tic54x) + return false; + + return bfd_default_set_arch_mach (abfd, arch, machine); +} + static bfd_reloc_status_type tic54x_relocation (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -295,6 +345,18 @@ ticoff_bfd_is_local_label_name (abfd, name) #define BADMAG(x) COFF2_BADMAG(x) #include "coffcode.h" +static boolean +tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do) + bfd *abfd; + sec_ptr section; + PTR location; + file_ptr offset; + bfd_size_type bytes_to_do; +{ + return coff_set_section_contents (abfd, section, location, + offset, bytes_to_do); +} + static void tic54x_reloc_processing (relent, reloc, symbols, abfd, section) arelent *relent; @@ -365,6 +427,16 @@ static CONST bfd_coff_backend_data ticoff0_swap_table = true, #else false, +#endif +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, #endif COFF_DEFAULT_SECTION_ALIGNMENT_POWER, coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, @@ -398,6 +470,16 @@ static CONST bfd_coff_backend_data ticoff1_swap_table = false, #endif COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, @@ -420,7 +502,7 @@ const bfd_target tic54x_coff0_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -446,7 +528,7 @@ const bfd_target tic54x_coff0_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, @@ -464,7 +546,7 @@ const bfd_target tic54x_coff0_beh_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -490,7 +572,7 @@ const bfd_target tic54x_coff0_beh_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -509,7 +591,7 @@ const bfd_target tic54x_coff1_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -535,7 +617,7 @@ const bfd_target tic54x_coff1_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -554,7 +636,7 @@ const bfd_target tic54x_coff1_beh_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -580,7 +662,7 @@ const bfd_target tic54x_coff1_beh_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -599,7 +681,7 @@ const bfd_target tic54x_coff2_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -625,7 +707,7 @@ const bfd_target tic54x_coff2_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), @@ -644,7 +726,7 @@ const bfd_target tic54x_coff2_beh_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | HAS_LOAD_PAGE ), + HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -670,7 +752,7 @@ const bfd_target tic54x_coff2_beh_vec = BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), BFD_JUMP_TABLE_SYMBOLS (coff), BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_WRITE (tic54x), BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c new file mode 100644 index 00000000000..8e5c501bf7a --- /dev/null +++ b/bfd/coff64-rs6000.c @@ -0,0 +1,360 @@ +/* BFD back-end for IBM RS/6000 "XCOFF64" files. + Copyright 2000 + Free Software Foundation, Inc. + Written Clinton Popetz. + Contributed by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Internalcoff.h and coffcode.h modify themselves based on these flags. */ +#define XCOFF64 +#define RS6000COFF_C 1 + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "coff/rs6k64.h" +#include "libcoff.h" + + +#define GET_FILEHDR_SYMPTR bfd_h_get_64 +#define PUT_FILEHDR_SYMPTR bfd_h_put_64 +#define GET_AOUTHDR_DATA_START bfd_h_get_64 +#define PUT_AOUTHDR_DATA_START bfd_h_put_64 +#define GET_AOUTHDR_TEXT_START bfd_h_get_64 +#define PUT_AOUTHDR_TEXT_START bfd_h_put_64 +#define GET_AOUTHDR_TSIZE bfd_h_get_64 +#define PUT_AOUTHDR_TSIZE bfd_h_put_64 +#define GET_AOUTHDR_DSIZE bfd_h_get_64 +#define PUT_AOUTHDR_DSIZE bfd_h_put_64 +#define GET_AOUTHDR_BSIZE bfd_h_get_64 +#define PUT_AOUTHDR_BSIZE bfd_h_put_64 +#define GET_AOUTHDR_ENTRY bfd_h_get_64 +#define PUT_AOUTHDR_ENTRY bfd_h_put_64 +#define GET_SCNHDR_PADDR bfd_h_get_64 +#define PUT_SCNHDR_PADDR bfd_h_put_64 +#define GET_SCNHDR_VADDR bfd_h_get_64 +#define PUT_SCNHDR_VADDR bfd_h_put_64 +#define GET_SCNHDR_SIZE bfd_h_get_64 +#define PUT_SCNHDR_SIZE bfd_h_put_64 +#define GET_SCNHDR_SCNPTR bfd_h_get_64 +#define PUT_SCNHDR_SCNPTR bfd_h_put_64 +#define GET_SCNHDR_RELPTR bfd_h_get_64 +#define PUT_SCNHDR_RELPTR bfd_h_put_64 +#define GET_SCNHDR_LNNOPTR bfd_h_get_64 +#define PUT_SCNHDR_LNNOPTR bfd_h_put_64 +#define GET_SCNHDR_NRELOC bfd_h_get_32 +#define MAX_SCNHDR_NRELOC 0xffffffff +#define PUT_SCNHDR_NRELOC bfd_h_put_32 +#define GET_SCNHDR_NLNNO bfd_h_get_32 +#define MAX_SCNHDR_NLNNO 0xffffffff +#define PUT_SCNHDR_NLNNO bfd_h_put_32 +#define GET_RELOC_VADDR bfd_h_get_64 +#define PUT_RELOC_VADDR bfd_h_put_64 + +#define COFF_FORCE_SYMBOLS_IN_STRINGS +#define COFF_DEBUG_STRING_WIDE_PREFIX + + +#define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \ +do { \ + memset (((SCNHDR *)EXT)->s_pad, 0, sizeof (((SCNHDR *)EXT)->s_pad));\ +} while(0) + +#define NO_COFF_LINENOS + +#define coff_SWAP_lineno_in xcoff64_swap_lineno_in +#define coff_SWAP_lineno_out xcoff64_swap_lineno_out + +#define PUTWORD bfd_h_put_32 +#define PUTHALF bfd_h_put_16 +#define PUTBYTE bfd_h_put_8 +#define GETWORD bfd_h_get_32 +#define GETHALF bfd_h_get_16 +#define GETBYTE bfd_h_get_8 + + +/* For XCOFF64, the effective width of symndx changes depending on + whether we are the first entry. Sigh. */ +static void +xcoff64_swap_lineno_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + LINENO *ext = (LINENO *)ext1; + struct internal_lineno *in = (struct internal_lineno *)in1; + + in->l_lnno = bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno)); + if (in->l_lnno == 0) + in->l_addr.l_symndx = + bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx); + else + in->l_addr.l_symndx = + bfd_h_get_64(abfd, (bfd_byte *) ext->l_addr.l_symndx); +} + +static unsigned int +xcoff64_swap_lineno_out (abfd, inp, outp) + bfd *abfd; + PTR inp; + PTR outp; +{ + struct internal_lineno *in = (struct internal_lineno *)inp; + struct external_lineno *ext = (struct external_lineno *)outp; + PUTWORD(abfd, in->l_addr.l_symndx, (bfd_byte *) + ext->l_addr.l_symndx); + + bfd_h_put_32 (abfd, in->l_lnno, (bfd_byte *) (ext->l_lnno)); + if (in->l_lnno == 0) + bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx); + else + bfd_h_put_64 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx); + + return bfd_coff_linesz (abfd); +} + + +static void xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR)); +static unsigned int xcoff64_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +static void xcoff64_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +static unsigned int xcoff64_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + +static void +xcoff64_swap_sym_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + SYMENT *ext = (SYMENT *)ext1; + struct internal_syment *in = (struct internal_syment *)in1; + + + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e_offset); + in->n_value = bfd_h_get_64(abfd, (bfd_byte *) ext->e.e_value); + in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); + in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); + in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); + in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); +} + +static unsigned int +xcoff64_swap_sym_out (abfd, inp, extp) + bfd *abfd; + PTR inp; + PTR extp; +{ + struct internal_syment *in = (struct internal_syment *)inp; + SYMENT *ext =(SYMENT *)extp; + + bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e_offset); + bfd_h_put_64(abfd, in->n_value , (bfd_byte *) ext->e.e_value); + bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); + bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); + bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); + bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + return bfd_coff_symesz (abfd); +} + +static void +xcoff64_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) + bfd *abfd; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; +{ + AUXENT *ext = (AUXENT *)ext1; + union internal_auxent *in = (union internal_auxent *)in1; + + switch (class) { + case C_FILE: + if (ext->x_file.x_fname[0] == 0) { + in->x_file.x_n.x_zeroes = 0; + in->x_file.x_n.x_offset = + bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + } else { + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + in->x_csect.x_scnlen.l = + bfd_h_get_32(abfd, ext->x_csect.x_scnlen_lo); + /* FIXME: If we want section lengths larger than 32 bits, we need + to modify the internal coff structures to support it. */ + in->x_csect.x_parmhash = bfd_h_get_32 (abfd, + ext->x_csect.x_parmhash); + in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); + in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + + goto end; + } + break; + } + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_64(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + if (ISFCN(type)) { + in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize); + } + else { + in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_lnsz.x_size); + } + +end: ; + /* the semicolon is because MSVC doesn't like labels at + end of block. */ + +} + + + +static unsigned int +xcoff64_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) + bfd *abfd; + PTR inp; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR extp; +{ + union internal_auxent *in = (union internal_auxent *)inp; + AUXENT *ext = (AUXENT *)extp; + + memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); + switch (class) + { + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); + PUTWORD(abfd, + in->x_file.x_n.x_offset, + (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } + PUTBYTE (abfd, _AUX_FILE, (bfd_byte *) ext->x_auxtype.x_auxtype); + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + PUTWORD (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen_lo); + PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + PUTBYTE (abfd, _AUX_CSECT, (bfd_byte *) ext->x_auxtype.x_auxtype); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + goto end; + } + break; + } + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + bfd_h_put_64(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + PUTBYTE (abfd, _AUX_FCN, (bfd_byte *) ext->x_auxtype.x_auxtype); + PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + if (ISFCN (type)) + PUTWORD (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize); + else + { + bfd_h_put_32(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_lnno); + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, + (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_size); + } + +end: + return bfd_coff_auxesz (abfd); +} + + +#define coff_SWAP_sym_in xcoff64_swap_sym_in +#define coff_SWAP_sym_out xcoff64_swap_sym_out +#define coff_SWAP_aux_in xcoff64_swap_aux_in +#define coff_SWAP_aux_out xcoff64_swap_aux_out + +#define TARGET_NAME "aixcoff64-rs6000" +#define TARGET_SYM rs6000coff64_vec + +#include "xcoff-target.h" + diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 27d467c552f..26c86203c43 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1124,6 +1124,8 @@ dependent COFF routines: . boolean _bfd_coff_long_filenames; . boolean _bfd_coff_long_section_names; . unsigned int _bfd_coff_default_section_alignment_power; +. boolean _bfd_coff_force_symnames_in_strings; +. unsigned int _bfd_coff_debug_string_prefix_length; . void (*_bfd_coff_swap_filehdr_in) PARAMS (( . bfd *abfd, . PTR ext, @@ -1321,6 +1323,12 @@ dependent COFF routines: .#define bfd_coff_symname_in_debug(abfd, sym)\ . ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) . +.#define bfd_coff_force_symnames_in_strings(abfd)\ +. (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) +. +.#define bfd_coff_debug_string_prefix_length(abfd)\ +. (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) +. .#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ . ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ . (abfd, file, base, symbol, aux, indaux)) @@ -1531,6 +1539,10 @@ coff_set_alignment_hook (abfd, section, scnhdr) i = COFF_DECODE_ALIGNMENT(hdr->s_flags); #endif section->alignment_power = i; + +#ifdef coff_set_section_load_page + coff_set_section_load_page (section, hdr->s_page); +#endif } #else /* ! COFF_ALIGN_IN_SECTION_HEADER */ @@ -1783,6 +1795,12 @@ coff_set_arch_mach_hook (abfd, filehdr) machine = 0; break; #endif +#ifdef IA64MAGIC + case IA64MAGIC: + arch = bfd_arch_ia64; + machine = 0; + break; +#endif #ifdef A29K_MAGIC_BIG case A29K_MAGIC_BIG: case A29K_MAGIC_LITTLE: @@ -1891,9 +1909,13 @@ coff_set_arch_mach_hook (abfd, filehdr) #endif #ifdef RS6000COFF_C +#ifdef XCOFF64 + case U803XTOCMAGIC: +#else case U802ROMAGIC: case U802WRMAGIC: case U802TOCMAGIC: +#endif { int cputype; @@ -1920,7 +1942,7 @@ coff_set_arch_mach_hook (abfd, filehdr) free (buf); return false; } - coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym); + bfd_coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym); if (sym.n_sclass == C_FILE) cputype = sym.n_type & 0xff; else @@ -1942,7 +1964,11 @@ coff_set_arch_mach_hook (abfd, filehdr) machine = 0; #else arch = bfd_arch_rs6000; +#ifdef XCOFF64 + machine = 620; +#else machine = 6000; +#endif #endif /* POWERMAC */ break; @@ -2064,6 +2090,7 @@ coff_set_arch_mach_hook (abfd, filehdr) break; #endif default: + arch = bfd_arch_obscure; (*_bfd_error_handler) (_("Unrecognized TI COFF target id '0x%x'"), internal_f->f_target_id); @@ -2114,6 +2141,10 @@ symname_in_debug_hook (abfd, sym) #ifdef RS6000COFF_C +#ifdef XCOFF64 +#define FORCE_SYMNAMES_IN_STRINGS +#endif + /* Handle the csect auxent of a C_EXT or C_HIDEXT symbol. */ static boolean coff_pointerize_aux_hook @@ -2552,6 +2583,12 @@ coff_set_flags (abfd, magicp, flagsp) return true; break; #endif +#ifdef IA64MAGIC + case bfd_arch_ia64: + *magicp = IA64MAGIC; + return true; + break; +#endif #ifdef MC68MAGIC case bfd_arch_m68k: #ifdef APOLLOM68KMAGIC @@ -2650,12 +2687,18 @@ coff_set_flags (abfd, magicp, flagsp) break; #endif -#ifdef U802TOCMAGIC +#ifdef RS6000COFF_C case bfd_arch_rs6000: #ifndef PPCMAGIC case bfd_arch_powerpc: #endif - *magicp = U802TOCMAGIC; +#ifdef XCOFF64 + if (bfd_get_mach (abfd) == 620 && !strncmp (abfd->xvec->name,"aix", 3)) + *magicp = U803XTOCMAGIC; + else +#else + *magicp = U802TOCMAGIC; +#endif return true; break; #endif @@ -2763,8 +2806,8 @@ coff_compute_section_file_positions (abfd) size_t len; len = strlen (bfd_asymbol_name (*symp)); - if (len > SYMNMLEN) - sz += len + 3; + if (len > SYMNMLEN || bfd_coff_force_symnames_in_strings (abfd)) + sz += len + 1 + bfd_coff_debug_string_prefix_length (abfd); } } if (sz > 0) @@ -3248,6 +3291,9 @@ coff_write_object_contents (abfd) section.s_vaddr = current->vma; section.s_paddr = current->lma; section.s_size = current->_raw_size; +#ifdef coff_get_section_load_page + section.s_page = coff_get_section_load_page (current); +#endif #ifdef COFF_WITH_PE section.s_paddr = 0; @@ -3289,13 +3335,15 @@ coff_write_object_contents (abfd) && ! is_reloc_section) hasdebug = true; -#ifdef RS6000COFF_C +#ifdef RS6000COFF_C +#ifndef XCOFF64 /* Indicate the use of an XCOFF overflow section header. */ if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff) { section.s_nreloc = 0xffff; section.s_nlnno = 0xffff; } +#endif #endif section.s_flags = sec_to_styp_flags (current->name, current->flags); @@ -3627,6 +3675,11 @@ coff_write_object_contents (abfd) #endif /* LYNXOS */ #endif /* I386 */ +#if defined(IA64) +#define __A_MAGIC_SET__ + internal_a.magic = ZMAGIC; +#endif /* IA64 */ + #if defined(SPARC) #define __A_MAGIC_SET__ #if defined(LYNXOS) @@ -4043,7 +4096,7 @@ coff_slurp_line_table (abfd, asect) while (counter < asect->lineno_count) { struct internal_lineno dst; - coff_swap_lineno_in (abfd, src, &dst); + bfd_coff_swap_lineno_in (abfd, src, &dst); cache_ptr->line_number = dst.l_lnno; if (cache_ptr->line_number == 0) @@ -4984,7 +5037,17 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #else false, #endif - COFF_DEFAULT_SECTION_ALIGNMENT_POWER, + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook, coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 47e5baac190..bb7f86205dc 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -819,7 +819,16 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, { unsigned int filnmlen; - strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + if (bfd_coff_force_symnames_in_strings (abfd)) + { + native->u.syment._n._n_n._n_offset = + (*string_size_p + STRING_SIZE_SIZE); + native->u.syment._n._n_n._n_zeroes = 0; + *string_size_p += 6; /* strlen(".file") + 1 */ + } + else + strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + auxent = &(native + 1)->u.auxent; filnmlen = bfd_coff_filnmlen (abfd); @@ -846,7 +855,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, } else { - if (name_length <= SYMNMLEN) + if (name_length <= SYMNMLEN && !bfd_coff_force_symnames_in_strings (abfd)) { /* This name will fit into the symbol neatly */ strncpy (native->u.syment._n._n_name, symbol->name, SYMNMLEN); @@ -861,7 +870,8 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, else { long filepos; - bfd_byte buf[2]; + bfd_byte buf[4]; + int prefix_len = bfd_coff_debug_string_prefix_length (abfd); /* This name should be written into the .debug section. For some reason each name is preceded by a two byte length @@ -871,24 +881,29 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, if (*debug_string_section_p == (asection *) NULL) *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug"); filepos = bfd_tell (abfd); - bfd_put_16 (abfd, name_length + 1, buf); + if (prefix_len == 4) + bfd_put_32 (abfd, name_length + 1, buf); + else + bfd_put_16 (abfd, name_length + 1, buf); + if (!bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) buf, (file_ptr) *debug_string_size_p, - (bfd_size_type) 2) + (bfd_size_type) prefix_len) || !bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) symbol->name, ((file_ptr) *debug_string_size_p - + 2), + + prefix_len), (bfd_size_type) name_length + 1)) abort (); if (bfd_seek (abfd, filepos, SEEK_SET) != 0) abort (); - native->u.syment._n._n_n._n_offset = *debug_string_size_p + 2; + native->u.syment._n._n_n._n_offset = + *debug_string_size_p + prefix_len; native->u.syment._n._n_n._n_zeroes = 0; - *debug_string_size_p += name_length + 3; + *debug_string_size_p += name_length + 1 + prefix_len; } } } @@ -1244,7 +1259,7 @@ coff_write_symbols (abfd) { /* This is not a COFF symbol, so it certainly is not a file name, nor does it go in the .debug section. */ - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; } else if (bfd_coff_symname_in_debug (abfd, &c_symbol->native->u.syment)) @@ -1255,9 +1270,13 @@ coff_write_symbols (abfd) } else if (c_symbol->native->u.syment.n_sclass == C_FILE && c_symbol->native->u.syment.n_numaux > 0) - maxlen = bfd_coff_filnmlen (abfd); + { + if (bfd_coff_force_symnames_in_strings (abfd)) + bfd_write (".file", 1, 6, abfd); + maxlen = bfd_coff_filnmlen (abfd); + } else - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; if (name_length > maxlen) { diff --git a/bfd/coffswap.h b/bfd/coffswap.h index d7d090fd41e..5bf011efdd7 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -168,12 +168,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef GET_SCNHDR_NRELOC #define GET_SCNHDR_NRELOC bfd_h_get_16 #endif +#ifndef MAX_SCNHDR_NRELOC +#define MAX_SCNHDR_NRELOC 0xffff +#endif #ifndef PUT_SCNHDR_NRELOC #define PUT_SCNHDR_NRELOC bfd_h_put_16 #endif #ifndef GET_SCNHDR_NLNNO #define GET_SCNHDR_NLNNO bfd_h_get_16 #endif +#ifndef MAX_SCNHDR_NLNNO +#define MAX_SCNHDR_NLNNO 0xffff +#endif #ifndef PUT_SCNHDR_NLNNO #define PUT_SCNHDR_NLNNO bfd_h_put_16 #endif @@ -184,6 +190,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PUT_SCNHDR_FLAGS bfd_h_put_32 #endif +#ifndef GET_RELOC_VADDR +#define GET_RELOC_VADDR bfd_h_get_32 +#endif +#ifndef PUT_RELOC_VADDR +#define PUT_RELOC_VADDR bfd_h_put_32 +#endif static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR)); static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); @@ -217,7 +229,7 @@ coff_swap_reloc_in (abfd, src, dst) RELOC *reloc_src = (RELOC *) src; struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; - reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr); + reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr); reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx); #ifdef RS6000COFF_C @@ -241,7 +253,7 @@ coff_swap_reloc_out (abfd, src, dst) { struct internal_reloc *reloc_src = (struct internal_reloc *)src; struct external_reloc *reloc_dst = (struct external_reloc *)dst; - bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); + PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx); #ifdef RS6000COFF_C @@ -439,28 +451,6 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) } goto end; - /* RS/6000 "csect" auxents */ -#ifdef RS6000COFF_C - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - in->x_csect.x_scnlen.l = bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); - in->x_csect.x_parmhash = bfd_h_get_32 (abfd, - ext->x_csect.x_parmhash); - in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); - in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); - in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab); - in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab); - goto end; - } - break; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -558,27 +548,6 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) } goto end; -#ifdef RS6000COFF_C - /* RS/6000 "csect" auxents */ - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - PUTWORD (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen); - PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); - PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); - PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); - PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); - PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); - goto end; - } - break; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -705,7 +674,11 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) #ifdef RS6000COFF_C +#ifdef XCOFF64 + aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc); +#else aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc); +#endif aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry); aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext); aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata); @@ -716,9 +689,14 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata); aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype); aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype); +#ifdef XCOFF64 + aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack); + aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata); +#else aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack); aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata); #endif +#endif #ifdef MIPSECOFF aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start); @@ -763,7 +741,11 @@ coff_swap_aouthdr_out (abfd, in, out) #endif #ifdef RS6000COFF_C +#ifdef XCOFF64 + bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); +#else bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); +#endif bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry); bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext); bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata); @@ -774,9 +756,18 @@ coff_swap_aouthdr_out (abfd, in, out) bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata); bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype); bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype); +#ifdef XCOFF64 + bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); + bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); +#else bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); +#endif memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2); +#ifdef XCOFF64 + memset (aouthdr_out->o_debugger, 0, sizeof aouthdr_out->o_debugger); + memset (aouthdr_out->o_resv3, 0, sizeof aouthdr_out->o_resv3); +#endif #endif #ifdef MIPSECOFF @@ -879,8 +870,9 @@ coff_swap_scnhdr_out (abfd, in, out) PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); #else - if (scnhdr_int->s_nlnno <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); + if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO) + PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno, + (bfd_byte *) scnhdr_ext->s_nlnno); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -891,10 +883,11 @@ coff_swap_scnhdr_out (abfd, in, out) (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), buf, scnhdr_int->s_nlnno); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); } - if (scnhdr_int->s_nreloc <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); + if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) + PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc, + (bfd_byte *) scnhdr_ext->s_nreloc); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -905,7 +898,7 @@ coff_swap_scnhdr_out (abfd, in, out) bfd_get_filename (abfd), buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); ret = 0; } #endif diff --git a/bfd/config.bfd b/bfd/config.bfd index 3d290a4eaee..324a168efca 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -80,6 +80,14 @@ case "${targ}" in alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; + ia64*-*-linux-gnu* | ia64*-*-elf*) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; + sparc64-*-netbsd*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + ;; #endif /* BFD64 */ arc-*-elf*) @@ -123,6 +131,10 @@ case "${targ}" in targ_selvecs=armcoff_big_vec targ_underscore=yes ;; + armeb-*-elf | arm*b-*-linux-gnu*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec @@ -216,27 +228,27 @@ case "${targ}" in targ_underscore=yes ;; -#if 0 /* HPPA ELF does not work currently. */ hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*) targ_defvec=bfd_elf32_hppa_vec ;; +#ifdef BFD64 + hppa*64*-*-hpux11*) + targ_defvec=bfd_elf64_hppa_vec + targ_cflags=-DHPUX_LARGE_AR_IDS + ;; #endif #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX) -#if 0 /* HPPA ELF does not work currently. */ hppa*-*-bsd*) targ_defvec=som_vec targ_selvecs=bfd_elf32_hppa_vec ;; -#endif hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*) targ_defvec=som_vec ;; -#if 0 /* HPPA ELF does not work currently. */ hppa*-*-osf*) targ_defvec=som_vec targ_selvecs=bfd_elf32_hppa_vec ;; -#endif #endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */ i370-*-*) @@ -287,9 +299,13 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3456]86-*-netbsdelf*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=i386netbsd_vec + ;; + i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) targ_defvec=i386netbsd_vec - targ_selvecs=i386bsd_vec + targ_selvecs="bfd_elf32_i386_vec i386bsd_vec" targ_underscore=yes ;; i[3456]86-*-netware*) @@ -303,7 +319,7 @@ case "${targ}" in ;; i[3456]86-*-linux-gnu*) targ_defvec=bfd_elf32_i386_vec - targ_selvecs=i386linux_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" ;; i[3456]86-*-lynxos*) targ_defvec=i386lynx_coff_vec @@ -610,6 +626,7 @@ case "${targ}" in powerpc-*-aix* | powerpc-*-beos*) targ_defvec=rs6000coff_vec + targ_selvecs="rs6000coff64_vec" ;; powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ diff --git a/bfd/configure b/bfd/configure index 2f3ba7cfde6..b567ae50156 100755 --- a/bfd/configure +++ b/bfd/configure @@ -4992,10 +4992,12 @@ EOF fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:5337: checking for $ac_hdr" >&5 +echo "configure:5350: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5360: \"$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* @@ -5372,12 +5385,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5376: checking for $ac_func" >&5 +echo "configure:5389: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5417: \"$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 @@ -5425,7 +5438,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5429: checking for working mmap" >&5 +echo "configure:5442: 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 @@ -5433,7 +5446,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5590: \"$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 @@ -5598,12 +5611,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5602: checking for $ac_func" >&5 +echo "configure:5615: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5643: \"$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 diff --git a/bfd/configure.host b/bfd/configure.host index e24cd600228..bd5391cd7da 100644 --- a/bfd/configure.host +++ b/bfd/configure.host @@ -27,6 +27,8 @@ hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;; hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;; hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;; +ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; + i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; i[3456]86-sequent-sysv4*) ;; i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; diff --git a/bfd/configure.in b/bfd/configure.in index 3e3a689bcae..4cc84deb3de 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -351,8 +351,10 @@ changequote([,])dnl fi AC_SUBST(COREFILE) AC_SUBST(COREFLAG) -AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, - [Name of host specific header file to include in trad-core.c.]) +if test -n "$TRAD_HEADER"; then + AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, + [Name of host specific header file to include in trad-core.c.]) +fi # Horrible hacks to build DLLs on Windows. WIN32LDFLAGS= @@ -464,8 +466,17 @@ do apollocoff_vec) tb="$tb coff-apollo.lo" ;; b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; + bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; + bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo peigen.lo cofflink.lo" + target64=true ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; + bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; @@ -554,14 +565,16 @@ do m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; - mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;; - mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;; + mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; + mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; + rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" + target64=true ;; nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" target64=true ;; diff --git a/bfd/cpu-i960.c b/bfd/cpu-i960.c index 7fb2c7ebc5c..2374b2fdf37 100644 --- a/bfd/cpu-i960.c +++ b/bfd/cpu-i960.c @@ -34,28 +34,44 @@ scan_960_mach (ap, string) const char *string; { unsigned long machine; + int i; + int fail_because_not_80960 = false; + + for (i = 0; i < strlen (string); i ++) + string[i] = tolower (string[i]); + + /* Look for the string i960 at the front of the string. */ + if (strncmp ("i960", string, 4) == 0) + { + string += 4; - /* Look for the string i960, or somesuch at the front of the string */ + /* i960 on it's own means core to us. */ + if (* string == 0) + return ap->mach == bfd_mach_i960_core; + + /* "i960:*" is valid, anything else is not. */ + if (* string != ':') + return false; - if (strncmp("i960",string,4) == 0) { - string+=4; - } - else { - /* no match, can be us */ - return false; - } - if (string[0] == 0) { - /* i960 on it's own means core to us*/ - if (ap->mach == bfd_mach_i960_core) return true; - return false; - } + string ++; + } + /* In some bfds the cpu-id is written as "80960KA", "80960KB", + "80960CA" or "80960MC". */ + else if (strncmp ("80960", string, 5) == 0) + { + string += 5; - if (string[0] != ':') { + /* Sett his to true here. If a correct matching postfix + is detected below it will be reset to false. */ + fail_because_not_80960 = true; + } + /* No match, can't be us. */ + else return false; - } - string++; - if (string[0] == '\0') + + if (* string == '\0') return false; + if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' && string[3] == 'e' && string[4] == '\0') machine = bfd_mach_i960_core; @@ -63,20 +79,20 @@ scan_960_mach (ap, string) machine = bfd_mach_i960_ka_sa; else if (strcmp (string, "kb_sb") == 0) machine = bfd_mach_i960_kb_sb; - else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char */ + else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */ return false; else if (string[0] == 'k' && string[1] == 'b') - machine = bfd_mach_i960_kb_sb; + { machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = false; } else if (string[0] == 's' && string[1] == 'b') machine = bfd_mach_i960_kb_sb; else if (string[0] == 'm' && string[1] == 'c') - machine = bfd_mach_i960_mc; + { machine = bfd_mach_i960_mc; fail_because_not_80960 = false; } else if (string[0] == 'x' && string[1] == 'a') machine = bfd_mach_i960_xa; else if (string[0] == 'c' && string[1] == 'a') - machine = bfd_mach_i960_ca; + { machine = bfd_mach_i960_ca; fail_because_not_80960 = false; } else if (string[0] == 'k' && string[1] == 'a') - machine = bfd_mach_i960_ka_sa; + { machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = false; } else if (string[0] == 's' && string[1] == 'a') machine = bfd_mach_i960_ka_sa; else if (string[0] == 'j' && string[1] == 'x') @@ -85,7 +101,13 @@ scan_960_mach (ap, string) machine = bfd_mach_i960_hx; else return false; - if (machine == ap->mach) return true; + + if (fail_because_not_80960) + return false; + + if (machine == ap->mach) + return true; + return false; } diff --git a/bfd/cpu-ia64-opc.c b/bfd/cpu-ia64-opc.c new file mode 100644 index 00000000000..130dbe7b998 --- /dev/null +++ b/bfd/cpu-ia64-opc.c @@ -0,0 +1,586 @@ +/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* Logically, this code should be part of libopcode but since some of + the operand insertion/extraction functions help bfd to implement + relocations, this code is included as part of elf64-ia64.c. This + avoids circular dependencies between libopcode and libbfd and also + obviates the need for applications to link in libopcode when all + they really want is libbfd. + + --davidm Mon Apr 13 22:14:02 1998 */ + +#include "../opcodes/ia64-opc.h" + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +static const char* +ins_rsvd (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ext_rsvd (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ins_const (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return 0; +} + +static const char* +ext_const (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return 0; +} + +static const char* +ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value >= 1u << self->field[0].bits) + return "register number out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((1u << self->field[0].bits) - 1)); + return 0; +} + +static const char* +ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn new = 0; + int i; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + value >>= self->field[i].bits; + } + if (value) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_U_64_BIT value = 0; + int i, bits = 0, total = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + value |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + *valuep = value; + return 0; +} + +static const char* +ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value & 0x7) + return "value not an integer multiple of 8"; + return ins_immu (self, value >> 3, code); +} + +static const char* +ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + + result = ext_immu (self, code, valuep); + if (result) + return result; + + *valuep = *valuep << 3; + return 0; +} + +static const char* +ins_imms_scaled (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code, int scale) +{ + BFD_HOST_64_BIT svalue = value, sign_bit; + ia64_insn new = 0; + int i; + + svalue >>= scale; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + sign_bit = (svalue >> (self->field[i].bits - 1)) & 1; + svalue >>= self->field[i].bits; + } + if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1)) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, + ia64_insn *valuep, int scale) +{ + int i, bits = 0, total = 0, shift; + BFD_HOST_64_BIT val = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + val |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + /* sign extend: */ + shift = 8*sizeof (val) - total; + val = (val << shift) >> shift; + + *valuep = (val << scale); + return 0; +} + +static const char* +ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 0); +} + +static const char* +ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *res = ext_imms_scaled (self, code, valuep, 0); + + ++*valuep; + return res; +} + +static const char* +ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 1); +} + +static const char* +ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 1); +} + +static const char* +ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 4); +} + +static const char* +ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 4); +} + +static const char* +ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 16); +} + +static const char* +ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 16); +} + +static const char* +ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + return ins_immu (self, value ^ mask, code); +} + +static const char* +ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + ia64_insn mask; + + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + result = ext_immu (self, code, valuep); + if (!result) + { + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + *valuep ^= mask; + } + return result; +} + +static const char* +ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) + return "count out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1; + return 0; +} + +static const char* +ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + + if (value > 2) + return "count must be in range 1..3"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) & 0x3) + 1; + return 0; +} + +static const char* +ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + switch (value) + { + case 0: value = 0; break; + case 7: value = 1; break; + case 15: value = 2; break; + case 16: value = 3; break; + default: return "count must be 0, 7, 15, or 16"; + } + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + ia64_insn value; + + value = (code >> self->field[0].shift) & 0x3; + switch (value) + { + case 0: value = 0; break; + case 1: value = 7; break; + case 2: value = 15; break; + case 3: value = 16; break; + } + *valuep = value; + return 0; +} + +static const char* +ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + BFD_HOST_64_BIT val = value; + BFD_HOST_U_64_BIT sign = 0; + + if (val < 0) + { + sign = 0x4; + value = -value; + } + switch (value) + { + case 1: value = 3; break; + case 4: value = 2; break; + case 8: value = 1; break; + case 16: value = 0; break; + default: return "count must be +/- 1, 4, 8, or 16"; + } + *code |= (sign | value) << self->field[0].shift; + return 0; +} + +static const char* +ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_64_BIT val; + int negate; + + val = (code >> self->field[0].shift) & 0x7; + negate = val & 0x4; + switch (val & 0x3) + { + case 0: val = 16; break; + case 1: val = 8; break; + case 2: val = 4; break; + case 3: val = 1; break; + } + if (negate) + val = -val; + + *valuep = val; + return 0; +} + +#define CST IA64_OPND_CLASS_CST +#define REG IA64_OPND_CLASS_REG +#define IND IA64_OPND_CLASS_IND +#define ABS IA64_OPND_CLASS_ABS +#define REL IA64_OPND_CLASS_REL + +#define SDEC IA64_OPND_FLAG_DECIMAL_SIGNED +#define UDEC IA64_OPND_FLAG_DECIMAL_UNSIGNED + +const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] = + { + /* constants: */ + { CST, ins_const, ext_const, "NIL", {{ 0, }}, 0, "" }, + { CST, ins_const, ext_const, "ar.ccv", {{ 0, }}, 0, "ar.ccv" }, + { CST, ins_const, ext_const, "ar.pfs", {{ 0, }}, 0, "ar.pfs" }, + { CST, ins_const, ext_const, "1", {{ 0, }}, 0, "1" }, + { CST, ins_const, ext_const, "8", {{ 0, }}, 0, "1" }, + { CST, ins_const, ext_const, "16", {{ 0, }}, 0, "16" }, + { CST, ins_const, ext_const, "r0", {{ 0, }}, 0, "r0" }, + { CST, ins_const, ext_const, "ip", {{ 0, }}, 0, "ip" }, + { CST, ins_const, ext_const, "pr", {{ 0, }}, 0, "pr" }, + { CST, ins_const, ext_const, "pr.rot", {{ 0, }}, 0, "pr.rot" }, + { CST, ins_const, ext_const, "psr", {{ 0, }}, 0, "psr" }, + { CST, ins_const, ext_const, "psr.l", {{ 0, }}, 0, "psr.l" }, + { CST, ins_const, ext_const, "psr.um", {{ 0, }}, 0, "psr.um" }, + + /* register operands: */ + { REG, ins_reg, ext_reg, "ar", {{ 7, 20}}, 0, /* AR3 */ + "an application register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 6}}, 0, /* B1 */ + "a branch register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 13}}, 0, /* B2 */ + "a branch register"}, + { REG, ins_reg, ext_reg, "cr", {{ 7, 20}}, 0, /* CR */ + "a control register"}, + { REG, ins_reg, ext_reg, "f", {{ 7, 6}}, 0, /* F1 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 13}}, 0, /* F2 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 20}}, 0, /* F3 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 27}}, 0, /* F4 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 6}}, 0, /* P1 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 27}}, 0, /* P2 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 6}}, 0, /* R1 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 13}}, 0, /* R2 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 20}}, 0, /* R3 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 2, 20}}, 0, /* R3_2 */ + "a general register r0-r3" }, + + /* indirect operands: */ + { IND, ins_reg, ext_reg, "cpuid", {{7, 20}}, 0, /* CPUID_R3 */ + "a cpuid register" }, + { IND, ins_reg, ext_reg, "dbr", {{7, 20}}, 0, /* DBR_R3 */ + "a dbr register" }, + { IND, ins_reg, ext_reg, "dtr", {{7, 20}}, 0, /* DTR_R3 */ + "a dtr register" }, + { IND, ins_reg, ext_reg, "itr", {{7, 20}}, 0, /* ITR_R3 */ + "an itr register" }, + { IND, ins_reg, ext_reg, "ibr", {{7, 20}}, 0, /* IBR_R3 */ + "an ibr register" }, + { IND, ins_reg, ext_reg, "", {{7, 20}}, 0, /* MR3 */ + "an indirect memory address" }, + { IND, ins_reg, ext_reg, "msr", {{7, 20}}, 0, /* MSR_R3 */ + "an msr register" }, + { IND, ins_reg, ext_reg, "pkr", {{7, 20}}, 0, /* PKR_R3 */ + "a pkr register" }, + { IND, ins_reg, ext_reg, "pmc", {{7, 20}}, 0, /* PMC_R3 */ + "a pmc register" }, + { IND, ins_reg, ext_reg, "pmd", {{7, 20}}, 0, /* PMD_R3 */ + "a pmd register" }, + { IND, ins_reg, ext_reg, "rr", {{7, 20}}, 0, /* RR_R3 */ + "an rr register" }, + + /* immediate operands: */ + { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC, /* CCNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 2, 27 }}, UDEC, /* CNT2a */ + "a 2-bit count (1-4)" }, + { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC, /* CNT2b */ + "a 2-bit count (1-3)" }, + { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC, /* CNT2c */ + "a count (0, 7, 15, or 16)" }, + { ABS, ins_immu, ext_immu, 0, {{ 5, 14}}, UDEC, /* CNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 27}}, UDEC, /* CNT6 */ + "a 6-bit count (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC, /* CPOS6a */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC, /* CPOS6b */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC, /* CPOS6c */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_imms, ext_imms, 0, {{ 1, 36}}, SDEC, /* IMM1 */ + "a 1-bit integer (-1, 0)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 13}}, UDEC, /* IMMU2 */ + "a 2-bit unsigned (0-3)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, 0, /* IMMU7a */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, 0, /* IMMU7b */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, UDEC, /* SOF */ + "a frame size (register count)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, UDEC, /* SOL */ + "a local register count" }, + { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC, /* SOR */ + "a rotating register count (integer multiple of 8)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-128-127)" }, + { ABS, ins_immsu4, ext_imms, 0, /* IMM8U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-127-128)" }, + { ABS, ins_immsm1u4, ext_immsm1, 0, /* IMM8M1U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1U8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 33}, { 7, 20}}, 0, /* IMMU9 */ + "a 9-bit unsigned (0-511)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9a */ + {{ 7, 6}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9b */ + {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM14 */ + {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC, + "a 14-bit integer (-8192-8191)" }, + { ABS, ins_imms1, ext_imms1, 0, /* IMM17 */ + {{ 7, 6}, { 8, 24}, { 1, 36}}, 0, + "a 17-bit integer (-65536-65535)" }, + { ABS, ins_immu, ext_immu, 0, {{20, 6}, { 1, 36}}, 0, /* IMMU21 */ + "a 21-bit unsigned" }, + { ABS, ins_imms, ext_imms, 0, /* IMM22 */ + {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC, + "a 22-bit integer" }, + { ABS, ins_immu, ext_immu, 0, /* IMMU24 */ + {{21, 6}, { 2, 31}, { 1, 36}}, 0, + "a 24-bit unsigned" }, + { ABS, ins_imms16,ext_imms16,0, {{27, 6}, { 1, 36}}, 0, /* IMM44 */ + "a 44-bit unsigned (least 16 bits ignored/zeroes)" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU62 */ + "a 62-bit unsigned" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU64 */ + "a 64-bit unsigned" }, + { ABS, ins_inc3, ext_inc3, 0, {{ 3, 13}}, SDEC, /* INC3 */ + "an increment (+/- 1, 4, 8, or 16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 4, 27}}, UDEC, /* LEN4 */ + "a 4-bit length (1-16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 6, 27}}, UDEC, /* LEN6 */ + "a 6-bit length (1-64)" }, + { ABS, ins_immu, ext_immu, 0, {{ 4, 20}}, 0, /* MBTYPE4 */ + "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" }, + { ABS, ins_immu, ext_immu, 0, {{ 8, 20}}, 0, /* MBTYPE8 */ + "an 8-bit mix type" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 14}}, UDEC, /* POS6 */ + "a 6-bit bit pos (0-63)" }, + { REL, ins_imms4, ext_imms4, 0, {{ 7, 6}, { 2, 33}}, 0, /* TAG13 */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0, /* TAG13b */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 6}, { 1, 36}}, 0, /* TGT25 */ + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, /* TGT25b */ + {{ 7, 6}, {13, 20}, { 1, 36}}, 0, + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0, /* TGT25c */ + "a branch target" }, + { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ + "a branch target" }, + }; diff --git a/bfd/cpu-ia64.c b/bfd/cpu-ia64.c new file mode 100644 index 00000000000..8069b1a9eff --- /dev/null +++ b/bfd/cpu-ia64.c @@ -0,0 +1,42 @@ +/* BFD support for the ia64 architecture. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_ia64_arch = + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_ia64, + 0, /* only 1 machine */ + "ia64", + "ia64", + 3, /* log2 of section alignment */ + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan , + 0, + }; + +#include "cpu-ia64-opc.c" diff --git a/bfd/cpu-powerpc.c b/bfd/cpu-powerpc.c index 11f0f80af5a..a2c8f59fe40 100644 --- a/bfd/cpu-powerpc.c +++ b/bfd/cpu-powerpc.c @@ -103,6 +103,20 @@ static const bfd_arch_info_type arch_info_struct[] = false, /* not the default */ powerpc_compatible, bfd_default_scan, + &arch_info_struct[4] + }, + { + 32, /* 32 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + 620, /* for the mpc620 */ + "powerpc", + "powerpc:620", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, 0 } }; diff --git a/bfd/dep-in.sed b/bfd/dep-in.sed index 444dde0c019..c3781f23bcb 100644 --- a/bfd/dep-in.sed +++ b/bfd/dep-in.sed @@ -6,8 +6,9 @@ t loop s!\.o:!.lo:! s! @BFD_H@!!g s!@INCDIR@!$(INCDIR)!g +s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g -s!hosts/[^ ]*\.h ! !g +s! hosts/[^ ]*\.h! !g s/ sysdep.h//g s! \.\./bfd/sysdep.h!!g s/ libbfd.h//g diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 968c2c9ff01..39c7265e836 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,16 @@ +Wed May 24 12:03:25 2000 Hans-Peter Nilsson + + * bfdint.texi (BFD ELF processor required): Add paragraph about + target necessities for readelf. + +2000-04-30 Ben Elliston + + * bfdint.texi (BFD generated files): Fix another typo. + +2000-04-17 Ben Elliston + + * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. + Fri Apr 7 17:54:38 2000 Andrew Cagney * Makefile.in: Rebuild with current autoconf/automake. diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index eb09b34a9d2..ef4fa910831 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -447,7 +447,7 @@ For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines three functions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc}, and @samp{_bfd_reloc_type_lookup}. A reference like @samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functions -prefixed with @samp{foo}: @samp{foo_get_reloc_upper_found}, etc. The +prefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc. The @samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those three functions initialize the appropriate fields in the BFD target vector. @@ -908,7 +908,7 @@ target vector is named @samp{_bfd_canonicalize_dynamic_reloc}. BFD contains several automatically generated files. This section describes them. Some files are created at configure time, when you configure BFD. Some files are created at make time, when you build -time. Some files are automatically rebuilt at make time, but only if +BFD. Some files are automatically rebuilt at make time, but only if you configure with the @samp{--enable-maintainer-mode} option. Some files live in the object directory---the directory from which you run configure---and some live in the source directory. All files that live @@ -1607,6 +1607,10 @@ it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, macros to create a table mapping the number used to indentify a relocation to a name describing that relocation. +While not a BFD component, you probably also want to make the binutils +program @samp{readelf} parse your ELF objects. For this, you need to add +code for @code{EM_@var{cpu}} as appropriate in @file{binutils/readelf.c}. + @node BFD ELF processor linker @subsubsection Processor specific linker support diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 92397a2e119..1c02912d214 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -700,8 +700,8 @@ concat_filename (table, file) if (file - 1 >= table->num_files) { - (*_bfd_error_handler) (_("Dwarf Error: mangled line number " - "section (bad file number).")); + (*_bfd_error_handler) + (_("Dwarf Error: mangled line number section (bad file number).")); return ""; } diff --git a/bfd/efi-app-ia32.c b/bfd/efi-app-ia32.c new file mode 100644 index 00000000000..5784178935a --- /dev/null +++ b/bfd/efi-app-ia32.c @@ -0,0 +1,35 @@ +/* BFD back-end for Intel IA-32 EFI application files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" + +#define TARGET_SYM bfd_efi_app_ia32_vec +#define TARGET_NAME "efi-app-ia32" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define PCRELOFFSET true +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define ALIGN_SECTIONS_IN_FILE +#define PEI_DEFAULT_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-i386.c" diff --git a/bfd/efi-app-ia64.c b/bfd/efi-app-ia64.c new file mode 100644 index 00000000000..b3182dc8b3f --- /dev/null +++ b/bfd/efi-app-ia64.c @@ -0,0 +1,35 @@ +/* BFD back-end for HP/Intel IA-64 EFI application files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" + +#define TARGET_SYM bfd_efi_app_ia64_vec +#define TARGET_NAME "efi-app-ia64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_PEP64 +#define PCRELOFFSET true +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define PEI_DEFAULT_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-ia64.c" diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 0dcecdf5884..3978aee2693 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1142,6 +1142,10 @@ extern long bfd_elf32_slurp_symbol_table extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf32_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf32_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf32_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf32_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf32_link_create_dynamic_sections @@ -1185,6 +1189,10 @@ extern long bfd_elf64_slurp_symbol_table extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf64_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf64_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf64_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf64_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf64_link_create_dynamic_sections diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index b55e1c4e5bc..0a4dc649e3e 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1,5 +1,5 @@ /* Common code for PA ELF implementations. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if ARCH_SIZE == 64 #define ELF_R_TYPE(X) ELF64_R_TYPE(X) #define ELF_R_SYM(X) ELF64_R_SYM(X) +#define elf_hppa_internal_shdr Elf64_Internal_Shdr #define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type #define elf_hppa_relocate_section elf64_hppa_relocate_section #define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link @@ -36,33 +37,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if ARCH_SIZE == 32 #define ELF_R_TYPE(X) ELF32_R_TYPE(X) #define ELF_R_SYM(X) ELF32_R_SYM(X) +#define elf_hppa_internal_shdr Elf32_Internal_Shdr #define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type #define elf_hppa_relocate_section elf32_hppa_relocate_section #define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link #define elf_hppa_final_link elf32_hppa_final_link #endif -static boolean -elf_hppa_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type + PARAMS ((bfd *, elf_hppa_reloc_type, int, int, int, asymbol *)); -static bfd_reloc_status_type elf_hppa_final_link_relocate - PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *, - bfd_byte *, bfd_vma, struct bfd_link_info *, - asection *, struct elf_link_hash_entry *, - struct elf64_hppa_dyn_hash_entry *)); +static void elf_hppa_info_to_howto + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + +static void elf_hppa_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); + +static reloc_howto_type * elf_hppa_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); + +static boolean elf_hppa_is_local_label_name + PARAMS ((bfd *, const char *)); -static unsigned long elf_hppa_relocate_insn - PARAMS ((unsigned long, long, unsigned long)); +static boolean elf_hppa_fake_sections + PARAMS ((bfd *abfd, elf_hppa_internal_shdr *, asection *)); + +#if ARCH_SIZE == 64 +static void elf_hppa_final_write_processing + PARAMS ((bfd *, boolean)); static boolean elf_hppa_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); -static boolean elf_hppa_final_link - PARAMS ((bfd *, struct bfd_link_info *)); - static boolean elf_hppa_unmark_useless_dynamic_symbols PARAMS ((struct elf_link_hash_entry *, PTR)); @@ -72,268 +79,518 @@ static boolean elf_hppa_remark_useless_dynamic_symbols static void elf_hppa_record_segment_addrs PARAMS ((bfd *, asection *, PTR)); +static boolean elf_hppa_final_link + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf_hppa_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +static bfd_reloc_status_type elf_hppa_final_link_relocate + PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *, + bfd_byte *, bfd_vma, struct bfd_link_info *, + asection *, struct elf_link_hash_entry *, + struct elf64_hppa_dyn_hash_entry *)); + +static unsigned int elf_hppa_relocate_insn + PARAMS ((unsigned int, unsigned int, unsigned int)); +#endif + + /* ELF/PA relocation howto entries. */ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = { - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, + { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false }, /* The values in DIR32 are to placate the check in _bfd_stab_section_find_nearest_line. */ - {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false}, - {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR21L"}, - {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17R"}, - {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL32"}, - - {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL21L"}, - {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17R"}, - {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17F"}, - {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17C"}, - {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14R"}, - {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL21L"}, - {R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14WR"}, - - {R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14DR"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14R"}, - {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14R"}, - {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14R"}, - {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14F"}, - - {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SETBASE"}, - {R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SECREL32"}, - {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL21L"}, - {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17R"}, - {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14R"}, - {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14F"}, - {R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGBASE"}, - {R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL32"}, - - {R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R"}, - {R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32"}, - {R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_FPTR64"}, - {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL32"}, - {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL64"}, - {R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22C"}, - {R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22F"}, - {R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14WR"}, - {R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14DR"}, - {R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16F"}, - {R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16WF"}, - {R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16DF"}, - - {R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64"}, - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, - {R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14WR"}, - {R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14DR"}, - {R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16F"}, - {R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16WF"}, - {R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16DF"}, - {R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR"}, - {R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR"}, - {R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16F"}, - {R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16WF"}, - {R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16DF"}, - {R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR"}, - - {R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR"}, - {R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16F"}, - {R_PARISC_LTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"}, - {R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR"}, - {R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR"}, - {R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR"}, - {R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F"}, - {R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF"}, - {R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF"}, - - {R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR"}, - {R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR"}, - {R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F"}, - {R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF"}, - {R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_COPY"}, - {R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_IPLT"}, - - {R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_EPLT"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL32"}, - {R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14WR"}, - - {R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14DR"}, - {R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16F"}, - {R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL16WF"}, - {R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16DF"}, - {R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR"}, - {R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR"}, - {R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_LTOFF_TP16F"}, - - {R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF"}, - {R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF"}, + { R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false }, + { R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR21L", false, 0, 0, false }, + { R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR17R", false, 0, 0, false }, + { R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR17F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL32", false, 0, 0, false }, + + { R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL21L", false, 0, 0, false }, + { R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17R", false, 0, 0, false }, + { R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17F", false, 0, 0, false }, + { R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17C", false, 0, 0, false }, + { R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14R", false, 0, 0, false }, + { R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL21L", false, 0, 0, false }, + { R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", false, 0, 0, false }, + + { R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14R", false, 0, 0, false }, + { R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", false, 0, 0, false }, + { R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", false, 0, 0, false }, + { R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", false, 0, 0, false }, + + { R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SETBASE", false, 0, 0, false }, + { R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SECREL32", false, 0, 0, false }, + { R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", false, 0, 0, false }, + { R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", false, 0, 0, false }, + { R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", false, 0, 0, false }, + { R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", false, 0, 0, false }, + { R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGBASE", false, 0, 0, false }, + { R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGREL32", false, 0, 0, false }, + + { R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", false, 0, 0, false }, + { R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_FPTR64", false, 0, 0, false }, + { R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL32", false, 0, 0, false }, + { R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL64", false, 0, 0, false }, + { R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL22C", false, 0, 0, false }, + { R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL22F", false, 0, 0, false }, + { R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", false, 0, 0, false }, + { R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", false, 0, 0, false }, + { R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16F", false, 0, 0, false }, + { R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", false, 0, 0, false }, + { R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", false, 0, 0, false }, + + { R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR64", false, 0, 0, false }, + { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false }, + { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false }, + { R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14WR", false, 0, 0, false }, + { R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14DR", false, 0, 0, false }, + { R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16F", false, 0, 0, false }, + { R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16WF", false, 0, 0, false }, + { R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16DF", false, 0, 0, false }, + { R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", false, 0, 0, false }, + { R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", false, 0, 0, false }, + { R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16F", false, 0, 0, false }, + { R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", false, 0, 0, false }, + { R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", false, 0, 0, false }, + { R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", false, 0, 0, false }, + + { R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", false, 0, 0, false }, + { R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", false, 0, 0, false }, + { R_PARISC_LTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false }, + { R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR", false, 0, 0, false }, + { R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", false, 0, 0, false }, + { R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", false, 0, 0, false }, + { R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", false, 0, 0, false }, + { R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", false, 0, 0, false }, + { R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", false, 0, 0, false }, + + { R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_COPY", false, 0, 0, false }, + { R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_IPLT", false, 0, 0, false }, + + { R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_EPLT", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_TPREL32", false, 0, 0, false }, + { R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_TPREL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_TPREL14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_TPREL14WR", false, 0, 0, false }, + + { R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", false, 0, 0, false }, + { R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL16F", false, 0, 0, false }, + { R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_TPREL16WF", false, 0, 0, false }, + { R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", false, 0, 0, false }, + { R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false }, + { R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont, + NULL, "R_PARISC_LTOFF_TP16F", false, 0, 0, false }, + + { R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false }, + { R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false }, }; #define OFFSET_14R_FROM_21L 4 @@ -348,8 +605,8 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) elf_hppa_reloc_type base_type; int format; int field; - int ignore; - asymbol *sym; + int ignore ATTRIBUTE_UNUSED; + asymbol *sym ATTRIBUTE_UNUSED; { elf_hppa_reloc_type *finaltype; elf_hppa_reloc_type **final_types; @@ -599,7 +856,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) static void elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; Elf_Internal_Rela *elf_reloc; { @@ -612,7 +869,7 @@ elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) static void elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; Elf_Internal_Rel *elf_reloc; { @@ -626,7 +883,7 @@ elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) static reloc_howto_type * elf_hppa_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { if ((int) code < (int) R_PARISC_UNIMPLEMENTED) @@ -637,34 +894,6 @@ elf_hppa_reloc_type_lookup (abfd, code) return NULL; } -static void -elf_hppa_final_write_processing (abfd, linker) - bfd *abfd; - boolean linker; -{ - int mach = bfd_get_mach (abfd); - - elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL - | EF_PARISC_EXT | EF_PARISC_LSB - | EF_PARISC_WIDE | EF_PARISC_NO_KABP - | EF_PARISC_LAZYSWAP); - - if (mach == 10) - elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0; - else if (mach == 11) - elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1; - else if (mach == 20) - elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0; - else if (mach == 25) - elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE - | EFA_PARISC_2_0 - /* The GNU tools have trapped without - option since 1993, so need to take - a step backwards with the ELF - based toolchains. */ - | EF_PARISC_TRAPNIL); -} - /* Return true if SYM represents a local label symbol. */ static boolean @@ -681,7 +910,7 @@ elf_hppa_is_local_label_name (abfd, name) static boolean elf_hppa_fake_sections (abfd, hdr, sec) bfd *abfd; - Elf64_Internal_Shdr *hdr; + elf_hppa_internal_shdr *hdr; asection *sec; { register const char *name; @@ -692,7 +921,11 @@ elf_hppa_fake_sections (abfd, hdr, sec) { int indx; asection *sec; +#if ARCH_SIZE == 64 hdr->sh_type = SHT_LOPROC + 1; +#else + hdr->sh_type = 1; +#endif /* ?!? How are unwinds supposed to work for symbols in arbitrary sections? Or what if we have multiple .text sections in a single .o file? HP really messed up on this one. @@ -717,6 +950,35 @@ elf_hppa_fake_sections (abfd, hdr, sec) return true; } +#if ARCH_SIZE == 64 +static void +elf_hppa_final_write_processing (abfd, linker) + bfd *abfd; + boolean linker; +{ + int mach = bfd_get_mach (abfd); + + elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL + | EF_PARISC_EXT | EF_PARISC_LSB + | EF_PARISC_WIDE | EF_PARISC_NO_KABP + | EF_PARISC_LAZYSWAP); + + if (mach == 10) + elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0; + else if (mach == 11) + elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1; + else if (mach == 20) + elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0; + else if (mach == 25) + elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE + | EFA_PARISC_2_0 + /* The GNU tools have trapped without + option since 1993, so need to take + a step backwards with the ELF + based toolchains. */ + | EF_PARISC_TRAPNIL); +} + /* Hook called by the linker routine which adds symbols from an object file. HP's libraries define symbols with HP specific section indices, which we have to handle. */ @@ -763,10 +1025,10 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data) the generic code will warn that it is undefined. This behavior is undesirable on HPs since the standard shared - libraries contain reerences to undefined symbols. + libraries contain references to undefined symbols. So we twiddle the flags associated with such symbols so that they - will not trigger the warning. ?!? FIXME. This is horribly fraglie. + will not trigger the warning. ?!? FIXME. This is horribly fragile. Ultimately we should have better controls over the generic ELF BFD linker code. */ @@ -1079,7 +1341,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, relocation = 0; } /* Allow undefined symbols in shared libraries. */ - else if (info->shared && !info->no_undefined) + else if (info->shared && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) { if (info->symbolic) (*info->callbacks->undefined_symbol) @@ -1182,12 +1445,11 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, struct elf_link_hash_entry *h; struct elf64_hppa_dyn_hash_entry *dyn_h; { - unsigned long insn; + unsigned int insn; bfd_vma offset = rel->r_offset; bfd_vma addend = rel->r_addend; reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info); - unsigned long r_type = howto->type; - unsigned long r_field = e_fsel; + unsigned int r_type = howto->type; bfd_byte *hit_data = contents + offset; struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); @@ -1198,6 +1460,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_NONE: break; + /* Basic function call support. I'm not entirely sure if PCREL14F is + actually needed or even handled correctly. + + Note for a call to a function defined in another dynamic library + we want to redirect the call to a stub. */ + /* Random PC relative relocs. */ case R_PARISC_PCREL21L: case R_PARISC_PCREL14R: @@ -1208,16 +1476,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_PCREL16WF: case R_PARISC_PCREL16DF: { - if (r_type == R_PARISC_PCREL21L) - r_field = e_lsel; - else if (r_type == R_PARISC_PCREL14F - || r_type == R_PARISC_PCREL16F - || r_type == R_PARISC_PCREL16WF - || r_type == R_PARISC_PCREL16DF) - r_field = e_fsel; - else - r_field = e_rsel; - /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ @@ -1230,29 +1488,27 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, + input_section->output_section->vma); /* Adjust for any field selectors. */ - value = hppa_field_adjust (value, -8 + addend, r_field); + if (r_type == R_PARISC_PCREL21L) + value = hppa_field_adjust (value, -8 + addend, e_lsel); + else if (r_type == R_PARISC_PCREL14F + || r_type == R_PARISC_PCREL16F + || r_type == R_PARISC_PCREL16WF + || r_type == R_PARISC_PCREL16DF) + value = hppa_field_adjust (value, -8 + addend, e_fsel); + else + value = hppa_field_adjust (value, -8 + addend, e_rsel); /* Apply the relocation to the given instruction. */ insn = elf_hppa_relocate_insn (insn, value, r_type); break; } - /* Basic function call support. I'm not entirely sure if PCREL14F is - actually needed or even handled correctly. - - Note for a call to a function defined in another dynamic library - we want to redirect the call to a stub. */ case R_PARISC_PCREL22F: case R_PARISC_PCREL17F: case R_PARISC_PCREL22C: case R_PARISC_PCREL17C: case R_PARISC_PCREL17R: { - if (r_type == R_PARISC_PCREL17R) - r_field = e_rsel; - else - r_field = e_fsel; - /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ @@ -1265,7 +1521,10 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, + input_section->output_section->vma); /* Adjust for any field selectors. */ - value = hppa_field_adjust (value, -8 + addend, e_fsel); + if (r_type == R_PARISC_PCREL17R) + value = hppa_field_adjust (value, -8 + addend, e_rsel); + else + value = hppa_field_adjust (value, -8 + addend, e_fsel); /* All branches are implicitly shifted by 2 places. */ value >>= 2; @@ -1352,7 +1611,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, + hppa_info->dlt_sec->output_section->vma); value -= _bfd_get_gp_value (output_bfd); - /* All DLTIND relocations are basically the same at this point, except that we need different field selectors for the 21bit version vs the 14bit versions. */ @@ -1426,8 +1684,10 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_DIR16DF: { /* All DIR relocations are basically the same at this point, - except that we need different field selectors for the 21bit - version vs the 14bit versions. */ + except that branch offsets need to be divided by four, and + we need different field selectors. Note that we don't + redirect absolute calls to local stubs. */ + if (r_type == R_PARISC_DIR21L) value = hppa_field_adjust (value, addend, e_lrsel); else if (r_type == R_PARISC_DIR17F @@ -1438,6 +1698,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, else value = hppa_field_adjust (value, addend, e_rrsel); + if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F) + { + /* All branches are implicitly shifted by 2 places. */ + value >>= 2; + } + insn = elf_hppa_relocate_insn (insn, value, r_type); break; } @@ -1698,11 +1964,11 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, Instead this routine is meant to handle the bit manipulations needed to insert the relocation into the given instruction. */ -static unsigned long +static unsigned int elf_hppa_relocate_insn (insn, sym_value, r_type) - unsigned long insn; - long sym_value; - unsigned long r_type; + unsigned int insn; + unsigned int sym_value; + unsigned int r_type; { switch (r_type) { @@ -1710,24 +1976,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) the "B" instruction. */ case R_PARISC_PCREL22F: case R_PARISC_PCREL22C: - { - unsigned int w3, w2, w1, w; - - /* These are 22 bit branches. Mask off bits we do not care - about. */ - sym_value &= 0x3fffff; - - /* Now extract the W1, W2, W3 and W fields from the value. */ - dis_assemble_22 (sym_value, &w3, &w1, &w2, &w); - - /* Mask out bits for the value in the instruction. */ - insn &= 0xfc00e002; - - /* Insert the bits for the W1, W2 and W fields into the - instruction. */ - insn |= (w3 << 21) | (w2 << 2) | (w1 << 16) | w; - return insn; - } + return re_assemble_22 (insn & ~ 0x3ff1ffd, sym_value); /* This is any 17bit branch. In PA2.0 syntax it also corresponds to the "B" instruction as well as BE. */ @@ -1736,24 +1985,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR17R: case R_PARISC_PCREL17C: case R_PARISC_PCREL17R: - { - unsigned int w2, w1, w; - - /* These are 17 bit branches. Mask off bits we do not care - about. */ - sym_value &= 0x1ffff; - - /* Now extract the W1, W2 and W fields from the value. */ - dis_assemble_17 (sym_value, &w1, &w2, &w); - - /* Mask out bits for the value in the instruction. */ - insn &= 0xffe0e002; - - /* Insert the bits for the W1, W2 and W fields into the - instruction. */ - insn |= (w2 << 2) | (w1 << 16) | w; - return insn; - } + return re_assemble_17 (insn & ~ 0x1f1ffd, sym_value); /* ADDIL or LDIL instructions. */ case R_PARISC_DLTREL21L: @@ -1764,18 +1996,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DPREL21L: case R_PARISC_PLTOFF21L: case R_PARISC_DIR21L: - { - int w; - - /* Mask off bits in INSN we do not want. */ - insn &= 0xffe00000; - - /* Turn the 21bit value into the proper format. */ - dis_assemble_21 (sym_value, &w); - - /* And insert the proper bits into INSN. */ - return insn | w; - } + return re_assemble_21 (insn & ~ 0x1fffff, sym_value); /* LDO and integer loads/stores with 14bit displacements. */ case R_PARISC_DLTREL14R: @@ -1799,18 +2020,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR14R: case R_PARISC_DIR16F: case R_PARISC_LTOFF16F: - { - int w; - - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc000; - - /* Turn the 14bit value into the proper format. */ - low_sign_unext (sym_value, 14, &w); - - /* And insert the proper bits into INSN. */ - return insn | w; - } + return (insn & ~ 0x3fff) | low_sign_unext (sym_value, 14); /* Doubleword loads and stores with a 14bit displacement. */ case R_PARISC_DLTREL14DR: @@ -1828,22 +2038,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR14DR: case R_PARISC_DIR16DF: case R_PARISC_LTOFF16DF: - { - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc00e; - - /* The sign bit at 14 moves into bit zero in the destination. */ - insn |= ((sym_value & 0x2000) >> 13); - - /* Turn off the bits in sym_value we do not care about. */ - sym_value &= 0x1ff8; - - /* Now shift it one bit position left so that it lines up with the - destination field in INSN. */ - sym_value <<= 1; - - return insn | sym_value; - } + return (insn & ~ 0x3ff1) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ff8) << 1)); /* Floating point single word load/store instructions. */ case R_PARISC_DLTREL14WR: @@ -1861,24 +2057,11 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR16WF: case R_PARISC_DIR14WR: case R_PARISC_LTOFF16WF: - { - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc006; - - /* The sign bit at 14 moves into bit zero in the destination. */ - insn |= ((sym_value & 0x2000) >> 13); - - /* Turn off the bits in sym_value we do not care about. */ - sym_value &= 0x1ffc; - - /* Now shift it one bit position left so that it lines up with the - destination field in INSN. */ - sym_value <<= 1; - - return insn | sym_value; - } + return (insn & ~ 0x3ff9) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ffc) << 1)); default: return insn; } } +#endif diff --git a/bfd/elf.c b/bfd/elf.c index 8830ff099cc..3143a0ebfd1 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -977,6 +977,7 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) table->needed = NULL; table->hgot = NULL; table->stab_info = NULL; + table->dynlocal = NULL; return _bfd_link_hash_table_init (&table->root, abfd, newfunc); } @@ -1354,8 +1355,9 @@ bfd_section_from_shdr (abfd, shindex) target_sect->rel_filepos = hdr->sh_offset; /* In the section to which the relocations apply, mark whether its relocations are of the REL or RELA variety. */ - elf_section_data (target_sect)->use_rela_p - = (hdr->sh_type == SHT_RELA); + if (hdr->sh_size != 0) + elf_section_data (target_sect)->use_rela_p + = (hdr->sh_type == SHT_RELA); abfd->flags |= HAS_RELOC; return true; } @@ -1752,6 +1754,22 @@ elf_fake_sections (abfd, asect, failedptrarg) *failedptr = true; } +/* Get elf arch size (32 / 64). + Returns -1 if not elf. */ + +int +bfd_elf_get_arch_size (abfd) + bfd *abfd; +{ + if (abfd->xvec->flavour != bfd_target_elf_flavour) + { + bfd_set_error (bfd_error_wrong_format); + return -1; + } + + return (get_elf_backend_data (abfd))->s->arch_size; +} + /* Assign all ELF section numbers. The dummy first section is handled here too. The link/info pointers for the standard section types are filled in here too, while we're at it. */ @@ -1764,7 +1782,6 @@ assign_section_numbers (abfd) asection *sec; unsigned int section_number; Elf_Internal_Shdr **i_shdrp; - struct elf_backend_data *bed = get_elf_backend_data (abfd); section_number = 1; @@ -1899,7 +1916,7 @@ assign_section_numbers (abfd) /* This is a .stab section. */ elf_section_data (s)->this_hdr.sh_entsize = - 4 + 2 * (bed->s->arch_size / 8); + 4 + 2 * bfd_elf_get_arch_size (abfd) / 8; } } break; @@ -3205,7 +3222,7 @@ prep_headers (abfd) bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB; i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current; - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_SYSV; + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NONE; i_ehdrp->e_ident[EI_ABIVERSION] = 0; for (count = EI_PAD; count < EI_NIDENT; count++) @@ -3226,7 +3243,7 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_NONE; break; case bfd_arch_sparc: - if (bed->s->arch_size == 64) + if (bfd_elf_get_arch_size (abfd) == 64) i_ehdrp->e_machine = EM_SPARCV9; else i_ehdrp->e_machine = EM_SPARC; @@ -3237,6 +3254,9 @@ prep_headers (abfd) case bfd_arch_i386: i_ehdrp->e_machine = EM_386; break; + case bfd_arch_ia64: + i_ehdrp->e_machine = EM_IA_64; + break; case bfd_arch_m68k: i_ehdrp->e_machine = EM_68K; break; @@ -3726,7 +3746,7 @@ copy_private_bfd_data (ibfd, obfd) more to do. */ isec = 0; - matching_lma = false; + matching_lma = 0; suggested_lma = 0; for (j = 0, s = ibfd->sections; s != NULL; s = s->next) @@ -3792,21 +3812,32 @@ copy_private_bfd_data (ibfd, obfd) free (sections); continue; } - else if (matching_lma != 0) - { - /* At least one section fits inside the current segment. - Keep it, but modify its physical address to match the - LMA of the first section that fitted. */ - - m->p_paddr = matching_lma; - } else { - /* None of the sections fitted inside the current segment. - Change the current segment's physical address to match - the LMA of the first section. */ + if (matching_lma != 0) + { + /* At least one section fits inside the current segment. + Keep it, but modify its physical address to match the + LMA of the first section that fitted. */ + + m->p_paddr = matching_lma; + } + else + { + /* None of the sections fitted inside the current segment. + Change the current segment's physical address to match + the LMA of the first section. */ + + m->p_paddr = suggested_lma; + } + + /* Offset the segment physical address from the lma to allow + for space taken up by elf headers. */ + if (m->includes_filehdr) + m->p_paddr -= iehdr->e_ehsize; - m->p_paddr = suggested_lma; + if (m->includes_phdrs) + m->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize; } /* Step Three: Loop over the sections again, this time assigning @@ -3839,7 +3870,12 @@ copy_private_bfd_data (ibfd, obfd) { /* If the first section in a segment does not start at the beginning of the segment, then something is wrong. */ - if (os->lma != m->p_paddr) + if (os->lma != (m->p_paddr + + (m->includes_filehdr + ? iehdr->e_ehsize : 0) + + (m->includes_phdrs + ? iehdr->e_phnum * iehdr->e_phentsize + : 0))) abort (); } else @@ -4470,18 +4506,13 @@ _bfd_elf_slurp_version_tables (abfd) Elf_Internal_Shdr *hdr; Elf_External_Verdef *everdef; Elf_Internal_Verdef *iverdef; + Elf_Internal_Verdef *iverdefarr; + Elf_Internal_Verdef iverdefmem; unsigned int i; + unsigned int maxidx; hdr = &elf_tdata (abfd)->dynverdef_hdr; - elf_tdata (abfd)->verdef = - ((Elf_Internal_Verdef *) - bfd_zalloc (abfd, hdr->sh_info * sizeof (Elf_Internal_Verdef))); - if (elf_tdata (abfd)->verdef == NULL) - goto error_return; - - elf_tdata (abfd)->cverdefs = hdr->sh_info; - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); if (contents == NULL) goto error_return; @@ -4489,15 +4520,42 @@ _bfd_elf_slurp_version_tables (abfd) || bfd_read ((PTR) contents, 1, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; + /* We know the number of entries in the section but not the maximum + index. Therefore we have to run through all entries and find + the maximum. */ everdef = (Elf_External_Verdef *) contents; - iverdef = elf_tdata (abfd)->verdef; - for (i = 0; i < hdr->sh_info; i++, iverdef++) + maxidx = 0; + for (i = 0; i < hdr->sh_info; ++i) + { + _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); + + if ((iverdefmem.vd_ndx & VERSYM_VERSION) > maxidx) + maxidx = iverdefmem.vd_ndx & VERSYM_VERSION; + + everdef = ((Elf_External_Verdef *) + ((bfd_byte *) everdef + iverdefmem.vd_next)); + } + + elf_tdata (abfd)->verdef = + ((Elf_Internal_Verdef *) + bfd_zalloc (abfd, maxidx * sizeof (Elf_Internal_Verdef))); + if (elf_tdata (abfd)->verdef == NULL) + goto error_return; + + elf_tdata (abfd)->cverdefs = maxidx; + + everdef = (Elf_External_Verdef *) contents; + iverdefarr = elf_tdata (abfd)->verdef; + for (i = 0; i < hdr->sh_info; i++) { Elf_External_Verdaux *everdaux; Elf_Internal_Verdaux *iverdaux; unsigned int j; - _bfd_elf_swap_verdef_in (abfd, everdef, iverdef); + _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); + + iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1]; + memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef)); iverdef->vd_bfd = abfd; diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index a66629348f1..e655781bde6 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -1838,14 +1838,17 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -2007,25 +2010,14 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) flagword out_flags; flagword in_flags; + /* Check if we have the same endianess */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN - && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } - /* The input BFD must have had its flags initialised. */ /* The following seems bogus to me -- The flags are initialized in the assembler but I don't think an elf_flags_init field is diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 263b5c010e5..52bafb99af7 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -1,5 +1,5 @@ /* D30V-specific support for 32-bit ELF - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 98, 99, 2000 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -263,8 +263,8 @@ static reloc_howto_type elf_d30v_howto_table[] = }; -#define MIN32 (long long)0xffffffff80000000LL -#define MAX32 0x7fffffffLL +#define MAX32 ((bfd_signed_vma) 0x7fffffff) +#define MIN32 (- MAX32 - 1) static bfd_reloc_status_type bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -276,7 +276,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - long long relocation; + bfd_signed_vma relocation; bfd_vma in1, in2, num; bfd_vma tmp_addr = 0; bfd_reloc_status_type r; @@ -287,6 +287,13 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_howto_type *howto = reloc_entry->howto; int make_absolute = 0; + if (output_bfd != (bfd *) NULL) + { + /* Partial linking -- do nothing. */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); if (r != bfd_reloc_continue) @@ -314,11 +321,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd) - output_base = 0; - else - output_base = reloc_target_output_section->vma; - + output_base = reloc_target_output_section->vma; relocation += output_base + symbol->section->output_offset; /* Add in supplied addend. */ @@ -334,18 +337,6 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, relocation -= tmp_addr; } - if (output_bfd != (bfd *) NULL) - { - /* This is a partial relocation, and we want to apply the relocation - to the reloc entry rather than the raw data. Modify the reloc - inplace to reflect what we now know. */ - reloc_entry->addend = relocation; - reloc_entry->address += input_section->output_offset; - return flag; - } - else - reloc_entry->addend = 0; - in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr); in2 = bfd_get_32 (abfd, (bfd_byte *) data + addr + 4); @@ -360,15 +351,10 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (howto->pc_relative == true && howto->bitsize == 32) { - /* the D30V has a PC that doesn't wrap and PC-relative jumps */ - /* are signed, so a PC-relative jump can'tbe more than +/- 2^31 byrtes */ - /* if one exceeds this, change it to an absolute jump */ - if (relocation > MAX32) - { - relocation = (relocation + tmp_addr) & 0xffffffff; - make_absolute = 1; - } - else if (relocation < MIN32) + /* The D30V has a PC that doesn't wrap and PC-relative jumps are + signed, so a PC-relative jump can't be more than +/- 2^31 bytes. + If one exceeds this, change it to an absolute jump. */ + if (relocation > MAX32 || relocation < MIN32) { relocation = (relocation + tmp_addr) & 0xffffffff; make_absolute = 1; @@ -411,6 +397,13 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf reloc_howto_type *howto = reloc_entry->howto; int mask, max; + if (output_bfd != (bfd *) NULL) + { + /* Partial linking -- do nothing. */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); if (r != bfd_reloc_continue) @@ -438,11 +431,7 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd) - output_base = 0; - else - output_base = reloc_target_output_section->vma; - + output_base = reloc_target_output_section->vma; relocation += output_base + symbol->section->output_offset; /* Add in supplied addend. */ @@ -453,23 +442,12 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf if (howto->pc_relative == true) { - relocation -= input_section->output_section->vma + input_section->output_offset; + relocation -= (input_section->output_section->vma + + input_section->output_offset); if (howto->pcrel_offset == true) relocation -= reloc_entry->address; } - if (output_bfd != (bfd *) NULL) - { - /* This is a partial relocation, and we want to apply the relocation - to the reloc entry rather than the raw data. Modify the reloc - inplace to reflect what we now know. */ - reloc_entry->addend = relocation; - reloc_entry->address += input_section->output_offset; - return flag; - } - else - reloc_entry->addend = 0; - in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr); mask = (1 << howto->bitsize) - 1; diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index 6b295d3e52a..b150ec95642 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -1,5 +1,5 @@ /* FR30-specific support for 32-bit ELF. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -275,7 +275,7 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data, + symbol->section->output_offset + reloc_entry->addend; - if (relocation > ((1U << 20) - 1)) + if (relocation > (((bfd_vma) 1 << 20) - 1)) return bfd_reloc_overflow; x = bfd_get_32 (abfd, data + reloc_entry->address); diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 683a308515a..1fdd4abb26f 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,5 +1,5 @@ /* BFD back-end for HP PA-RISC ELF files. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by @@ -311,17 +311,17 @@ hppa_elf_relocate_insn (abfd, input_sect, insn, address, sym_value, case BL: case BE: case BLE: - /* XXX computing constant_value is not needed??? */ + /* XXX r_addend ignored ???. */ constant_value = assemble_17 ((insn & 0x001f0000) >> 16, (insn & 0x00001ffc) >> 2, insn & 1); - constant_value = (constant_value << 15) >> 15; + constant_value = (constant_value << (BFD_ARCH_SIZE-17)) + >> (BFD_ARCH_SIZE-17); if (pcrel) { - sym_value -= - address + input_sect->output_offset - + input_sect->output_section->vma; + sym_value -= (address + input_sect->output_offset + + input_sect->output_section->vma); sym_value = hppa_field_adjust (sym_value, -8, r_field); } else @@ -665,7 +665,7 @@ elf32_hppa_bfd_final_link_relocate (howto, input_bfd, output_bfd, /* Any kind of linker stub needed? */ if (((int)(value - location) > 0x3ffff) - || ((int)(value - location) < (int)0xfffc0000)) + || ((int)(value - location) < -0x40000)) { struct elf32_hppa_stub_hash_table *stub_hash_table; struct elf32_hppa_stub_hash_entry *stub_hash; @@ -831,7 +831,7 @@ elf32_hppa_size_of_stub (location, destination, sym_name) { /* Determine if a long branch stub is needed. */ if (!(((int)(location - destination) > 0x3ffff) - || ((int)(location - destination) < (int)0xfffc0000))) + || ((int)(location - destination) < -0x40000))) return 0; if (!strncmp ("$$", sym_name, 2) diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h index 915fc13ae59..17c5e1673ae 100644 --- a/bfd/elf32-hppa.h +++ b/bfd/elf32-hppa.h @@ -4,7 +4,8 @@ in the Stratus FTX/Golf Object File Format (SED-1762) dated February 1994. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000 + Free Software Foundation, Inc. Written by: diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index c8bf94326cd..0715d86d081 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1413,7 +1413,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 90efba8dc9b..53edaaf2543 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -439,7 +439,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) bfd *dynobj; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; - bfd_vma *local_got_offsets; + bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sgot; @@ -452,7 +452,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - local_got_offsets = elf_local_got_offsets (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sgot = NULL; srelgot = NULL; @@ -522,57 +522,54 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.offset != (bfd_vma) -1) + if (h->got.refcount == -1) { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; + h->got.refcount = 1; - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } - srelgot->_raw_size += sizeof (Elf32_External_Rel); + sgot->_raw_size += 4; + srelgot->_raw_size += sizeof (Elf32_External_Rel); + } + else + h->got.refcount += 1; } else { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) { size_t size; - register unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) + size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (abfd, size)); + if (local_got_refcounts == NULL) return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (local_got_refcounts, -1, size); } - if (local_got_offsets[r_symndx] != (bfd_vma) -1) + if (local_got_refcounts[r_symndx] == -1) { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[r_symndx] = sgot->_raw_size; + local_got_refcounts[r_symndx] = 1; - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_386_RELATIVE reloc so that the dynamic - linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rel); + sgot->_raw_size += 4; + if (info->shared) + { + /* If we are generating a shared object, we need to + output a R_386_RELATIVE reloc so that the dynamic + linker can adjust this GOT entry. */ + srelgot->_raw_size += sizeof (Elf32_External_Rel); + } } + else + local_got_refcounts[r_symndx] += 1; } - - sgot->_raw_size += 4; - break; case R_386_PLT32: @@ -588,8 +585,13 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - + if (h->plt.refcount == -1) + { + h->plt.refcount = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + else + h->plt.refcount += 1; break; case R_386_32: @@ -766,14 +768,81 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; + bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; + asection *sec; + const Elf_Internal_Rela *relocs; { - /* ??? It would seem that the existing i386 code does no sort - of reference counting or whatnot on its GOT and PLT entries, - so it is not possible to garbage collect them at this time. */ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + bfd *dynobj; + asection *sgot; + asection *srelgot; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj == NULL) + return true; + + sgot = bfd_get_section_by_name (dynobj, ".got"); + srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_386_GOT32: + case R_386_GOTOFF: + case R_386_GOTPC: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + { + h->got.refcount -= 1; + if (h->got.refcount == 0) + { + sgot->_raw_size -= 4; + srelgot->_raw_size -= sizeof (Elf32_External_Rel); + } + } + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + { + local_got_refcounts[r_symndx] -= 1; + if (local_got_refcounts[r_symndx] == 0) + { + sgot->_raw_size -= 4; + if (info->shared) + srelgot->_raw_size -= sizeof (Elf32_External_Rel); + } + } + } + break; + + case R_386_PLT32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + default: + break; + } return true; } @@ -812,16 +881,18 @@ elf_i386_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + if ((! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + || (info->shared && h->plt.refcount <= 0)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object. In such a case, we don't actually need to build - a procedure linkage table, and we can just do a PC32 - reloc instead. */ - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In + such a case, we don't actually need to build a procedure + linkage table, and we can just do a PC32 reloc instead. */ + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; return true; } @@ -859,13 +930,11 @@ elf_i386_adjust_dynamic_symbol (info, h) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); s->_raw_size += 4; /* We also need to make an entry in the .rel.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rel.plt"); BFD_ASSERT (s != NULL); s->_raw_size += sizeof (Elf32_External_Rel); @@ -1193,9 +1262,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); - sgot = NULL; - splt = NULL; sreloc = NULL; + splt = NULL; + sgot = NULL; + if (dynobj != NULL) + { + splt = bfd_get_section_by_name (dynobj, ".plt"); + sgot = bfd_get_section_by_name (dynobj, ".got"); + } rel = relocs; relend = relocs + input_section->reloc_count; @@ -1273,6 +1347,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sec = h->root.u.def.section; if (r_type == R_386_GOTPC || (r_type == R_386_PLT32 + && splt != NULL && h->plt.offset != (bfd_vma) -1) || (r_type == R_386_GOT32 && elf_hash_table (info)->dynamic_sections_created @@ -1291,7 +1366,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sections against symbols defined externally in shared libraries. We can't do anything with them here. */ - || (input_section->flags & SEC_DEBUGGING) != 0))) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some @@ -1313,14 +1390,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -1331,11 +1411,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_GOT32: /* Relocation is to the entry for this symbol in the global offset table. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + BFD_ASSERT (sgot != NULL); if (h != NULL) { @@ -1454,12 +1530,13 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocation is to the entry for this symbol in the procedure linkage table. */ - /* Resolve a PLT32 reloc again a local symbol directly, + /* Resolve a PLT32 reloc against a local symbol directly, without using the procedure linkage table. */ if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1) + if (h->plt.offset == (bfd_vma) -1 + || splt == NULL) { /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when @@ -1467,12 +1544,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); @@ -1739,17 +1810,21 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) + sgot->output_offset + (h->got.offset &~ 1)); - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. Likewise if - the symbol was forced to be local because of a version file. + /* If this is a static link, or it is a -Bsymbolic link and the + symbol is defined locally or was forced to be local because + of a version file, we just want to emit a RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + if (! elf_hash_table (info)->dynamic_sections_created + || (info->shared + && (info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + } else { + BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); } @@ -1923,27 +1998,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_386 #define ELF_MAXPAGESIZE 0x1000 -#define elf_info_to_howto elf_i386_info_to_howto -#define elf_info_to_howto_rel elf_i386_info_to_howto_rel -#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup -#define bfd_elf32_bfd_is_local_label_name \ - elf_i386_is_local_label_name -#define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections -#define bfd_elf32_bfd_link_hash_table_create \ - elf_i386_link_hash_table_create -#define elf_backend_check_relocs elf_i386_check_relocs -#define elf_backend_adjust_dynamic_symbol \ - elf_i386_adjust_dynamic_symbol -#define elf_backend_size_dynamic_sections \ - elf_i386_size_dynamic_sections -#define elf_backend_relocate_section elf_i386_relocate_section -#define elf_backend_finish_dynamic_symbol \ - elf_i386_finish_dynamic_symbol -#define elf_backend_finish_dynamic_sections \ - elf_i386_finish_dynamic_sections -#define elf_backend_gc_mark_hook elf_i386_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook #define elf_backend_can_gc_sections 1 #define elf_backend_want_got_plt 1 @@ -1952,4 +2006,22 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_ENTRY_SIZE +#define elf_info_to_howto elf_i386_info_to_howto +#define elf_info_to_howto_rel elf_i386_info_to_howto_rel + +#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link +#define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name +#define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create +#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup + +#define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol +#define elf_backend_check_relocs elf_i386_check_relocs +#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections +#define elf_backend_finish_dynamic_symbol elf_i386_finish_dynamic_symbol +#define elf_backend_gc_mark_hook elf_i386_gc_mark_hook +#define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook +#define elf_backend_relocate_section elf_i386_relocate_section +#define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections + #include "elf32-target.h" diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index cc622301755..b01523477b4 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -847,19 +847,19 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) unsigned long r_symndx; struct elf_link_hash_entry *h; bfd *dynobj; - asection *sgot = NULL; - asection *srelgot = NULL; + asection *sgot; + asection *srelgot; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); dynobj = elf_hash_table (info)->dynobj; - if (dynobj) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - } + if (dynobj == NULL) + return true; + + sgot = bfd_get_section_by_name (dynobj, ".got"); + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) @@ -887,7 +887,7 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) } } } - else + else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) { @@ -1479,14 +1479,17 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!(info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 5963a9eff6e..99e9c73596e 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -322,18 +322,8 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) flagword new_flags; /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian.\n"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -532,7 +522,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index d91bab97268..29e260e2130 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1520,7 +1520,7 @@ gprel16_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, reloc_entry->address += input_section->output_offset; /* Make sure it fit in 16 bits. */ - if (val >= 0x8000 && val < 0xffff8000) + if ((long) val >= 0x8000 || (long) val < -0x8000) return bfd_reloc_overflow; return bfd_reloc_ok; @@ -2460,21 +2460,8 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) boolean ok; /* Check if we have the same endianess */ - if (ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - const char *msg; - - if (bfd_big_endian (ibfd)) - msg = _("%s: compiled for a big endian system and target is little endian"); - else - msg = _("%s: compiled for a little endian system and target is big endian"); - - (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -5930,7 +5917,8 @@ mips_elf_calculate_relocation (abfd, and check to see if they exist by looking at their addresses. */ symbol = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic && !info->no_undefined + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0) { @@ -5948,7 +5936,8 @@ mips_elf_calculate_relocation (abfd, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->root.other))))) return bfd_reloc_undefined; symbol = 0; } @@ -6739,8 +6728,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma low_bits; bfd_vma high_bits; - if (addend & 0x80000000u) - sign_bits = 0xffffffffu; + if (addend & ((bfd_vma) 1 << 31)) + sign_bits = ((bfd_vma) 1 << 32) - 1; else sign_bits = 0; @@ -6859,8 +6848,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma low_bits; bfd_vma high_bits; - if (value & 0x80000000u) - sign_bits = 0xffffffffu; + if (value & ((bfd_vma) 1 << 31)) + sign_bits = ((bfd_vma) 1 << 32) - 1; else sign_bits = 0; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 242cfb730ab..6dc3effc3f1 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1399,21 +1399,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) boolean error; /* Check if we have the same endianess */ - if (ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - const char *msg; - - if (bfd_big_endian (ibfd)) - msg = _("%s: compiled for a big endian system and target is little endian"); - else - msg = _("%s: compiled for a little endian system and target is big endian"); - - (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -2540,7 +2527,7 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) if (h->got.refcount > 0) h->got.refcount--; } - else + else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx]--; @@ -3022,6 +3009,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { sec = h->root.u.def.section; if ((r_type == R_PPC_PLT32 + && splt != NULL && h->plt.offset != (bfd_vma) -1) || (r_type == R_PPC_LOCAL24PC && sec->output_section == NULL) @@ -3043,7 +3031,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, It's here to avoid a crash when generating a shared library with DWARF debugging information. */ - || (input_section->flags & SEC_DEBUGGING) != 0) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (r_type == R_PPC_ADDR32 || r_type == R_PPC_ADDR24 || r_type == R_PPC_ADDR16 @@ -3101,7 +3091,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { @@ -3111,7 +3103,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, input_section, rel->r_offset, (!info->shared - || info->no_undefined))) + || info->no_undefined + || ELF_ST_VISIBILITY (h->other)))) return false; relocation = 0; } diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 6913fa47f1c..7fe30ef1752 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1394,6 +1394,13 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) bfd_put_16 (abfd, insn, contents + nraddr); break; + case R_SH_SWITCH8: + voff += adjust; + if (voff < 0 || voff >= 0xff) + overflow = true; + bfd_put_8 (abfd, voff, contents + nraddr); + break; + case R_SH_SWITCH16: voff += adjust; if (voff < - 0x8000 || voff >= 0x8000) diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index e61a82fabeb..70d65a5f87b 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/sparc.h" +#include "opcode/sparc.h" static reloc_howto_type *elf32_sparc_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); @@ -36,6 +37,8 @@ static boolean elf32_sparc_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf32_sparc_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_sparc_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean elf32_sparc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -1059,6 +1062,23 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) return true; } + +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +/*ARGSUSED*/ +static boolean +elf32_sparc_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC ELF section. */ static boolean @@ -1213,14 +1233,17 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -1515,6 +1538,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } + r = bfd_reloc_continue; if (r_type == R_SPARC_WDISP16) { bfd_vma x; @@ -1546,7 +1570,97 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_putl32 (/*input_bfd,*/ x, contents + rel->r_offset); r = bfd_reloc_ok; } - else + else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30) + && SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + + /* Ensure the reloc fits into simm22. */ + if ((reloc & 3) == 0 + && ((reloc & ~(bfd_vma)0x7fffff) == 0 + || ((reloc | 0x7fffff) == ~(bfd_vma)0))) + { + reloc >>= 2; + + /* Check whether it fits into simm19 on v9. */ + if (((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + && (elf_elfheader (output_bfd)->e_flags & EF_SPARC_32PLUS)) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + + } + } + } + } + + if (r == bfd_reloc_continue) r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); @@ -1964,6 +2078,7 @@ elf32_sparc_final_write_processing (abfd, linker) #define ELF_MAXPAGESIZE 0x10000 #define bfd_elf32_bfd_reloc_type_lookup elf32_sparc_reloc_type_lookup +#define bfd_elf32_bfd_relax_section elf32_sparc_relax_section #define elf_info_to_howto elf32_sparc_info_to_howto #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 4da9e925c63..4c083fa4944 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -3475,14 +3475,17 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) relocation = 0; else { if (!((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->root.other))))) return false; relocation = 0; } diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c new file mode 100644 index 00000000000..b5b9f7f3f59 --- /dev/null +++ b/bfd/elf64-hppa.c @@ -0,0 +1,2633 @@ +/* Generic support for 64-bit ELF + Copyright 1999, 2000 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/hppa.h" +#include "libhppa.h" +#include "elf64-hppa.h" +#define ARCH_SIZE 64 + +#define PLT_ENTRY_SIZE 0x10 +#define DLT_ENTRY_SIZE 0x8 +#define OPD_ENTRY_SIZE 0x20 + +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl" + +/* The stub is supposed to load the target address and target's DP + value out of the PLT, then do an external branch to the target + address. + + LDD PLTOFF(%r27),%r1 + BVE (%r1) + LDD PLTOFF+8(%r27),%r27 + + Note that we must use the LDD with a 14 bit displacement, not the one + with a 5 bit displacement. */ +static char plt_stub[] = {0x53, 0x61, 0x00, 0x00, 0xe8, 0x20, 0xd0, 0x00, + 0x53, 0x7b, 0x00, 0x00 }; + +struct elf64_hppa_dyn_hash_entry +{ + struct bfd_hash_entry root; + + /* Offsets for this symbol in various linker sections. */ + bfd_vma dlt_offset; + bfd_vma plt_offset; + bfd_vma opd_offset; + bfd_vma stub_offset; + + /* The symbol table entry, if any, that this was derrived from. */ + struct elf_link_hash_entry *h; + + /* The index of the (possibly local) symbol in the input bfd and its + associated BFD. Needed so that we can have relocs against local + symbols in shared libraries. */ + unsigned long sym_indx; + bfd *owner; + + /* Dynamic symbols may need to have two different values. One for + the dynamic symbol table, one for the normal symbol table. + + In such cases we store the symbol's real value and section + index here so we can restore the real value before we write + the normal symbol table. */ + bfd_vma st_value; + int st_shndx; + + /* Used to count non-got, non-plt relocations for delayed sizing + of relocation sections. */ + struct elf64_hppa_dyn_reloc_entry + { + /* Next relocation in the chain. */ + struct elf64_hppa_dyn_reloc_entry *next; + + /* The type of the relocation. */ + int type; + + /* The input section of the relocation. */ + asection *sec; + + /* The index of the section symbol for the input section of + the relocation. Only needed when building shared libraries. */ + int sec_symndx; + + /* The offset within the input section of the relocation. */ + bfd_vma offset; + + /* The addend for the relocation. */ + bfd_vma addend; + + } *reloc_entries; + + /* Nonzero if this symbol needs an entry in one of the linker + sections. */ + unsigned want_dlt; + unsigned want_plt; + unsigned want_opd; + unsigned want_stub; +}; + +struct elf64_hppa_dyn_hash_table +{ + struct bfd_hash_table root; +}; + +struct elf64_hppa_link_hash_table +{ + struct elf_link_hash_table root; + + /* Shortcuts to get to the various linker defined sections. */ + asection *dlt_sec; + asection *dlt_rel_sec; + asection *plt_sec; + asection *plt_rel_sec; + asection *opd_sec; + asection *opd_rel_sec; + asection *other_rel_sec; + + /* Offset of __gp within .plt section. When the PLT gets large we want + to slide __gp into the PLT section so that we can continue to use + single DP relative instructions to load values out of the PLT. */ + bfd_vma gp_offset; + + /* Note this is not strictly correct. We should create a stub section for + each input section with calls. The stub section should be placed before + the section with the call. */ + asection *stub_sec; + + bfd_vma text_segment_base; + bfd_vma data_segment_base; + + struct elf64_hppa_dyn_hash_table dyn_hash_table; + + /* We build tables to map from an input section back to its + symbol index. This is the BFD for which we currently have + a map. */ + bfd *section_syms_bfd; + + /* Array of symbol numbers for each input section attached to the + current BFD. */ + int *section_syms; +}; + +#define elf64_hppa_hash_table(p) \ + ((struct elf64_hppa_link_hash_table *) ((p)->hash)) + +typedef struct bfd_hash_entry *(*new_hash_entry_func) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +static boolean elf64_hppa_dyn_hash_table_init + PARAMS ((struct elf64_hppa_dyn_hash_table *ht, bfd *abfd, + new_hash_entry_func new)); +static struct bfd_hash_entry *elf64_hppa_new_dyn_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_link_hash_table *elf64_hppa_hash_table_create + PARAMS ((bfd *abfd)); +static struct elf64_hppa_dyn_hash_entry *elf64_hppa_dyn_hash_lookup + PARAMS ((struct elf64_hppa_dyn_hash_table *table, const char *string, + boolean create, boolean copy)); +static void elf64_hppa_dyn_hash_traverse + PARAMS ((struct elf64_hppa_dyn_hash_table *table, + boolean (*func)(struct elf64_hppa_dyn_hash_entry *, PTR), + PTR info)); + +static const char *get_dyn_name + PARAMS ((bfd *abfd, struct elf_link_hash_entry *h, + const Elf_Internal_Rela *rel, char **pbuf, size_t *plen)); + + +/* This must follow the definitions of the various derived linker + hash tables and shared functions. */ +#include "elf-hppa.h" + + +static boolean elf64_hppa_object_p + PARAMS ((bfd *)); + +static boolean elf64_hppa_section_from_shdr + PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); + +static void elf64_hppa_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + +static boolean elf64_hppa_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static boolean elf64_hppa_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *)); + +static boolean elf64_hppa_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); + +static boolean elf64_hppa_mark_exported_functions + PARAMS ((struct elf_link_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_opd + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_dlt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_dlt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_plt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_stub + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_opd + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean get_reloc_section + PARAMS ((bfd *, struct elf64_hppa_link_hash_table *, asection *)); + +static boolean count_dyn_reloc + PARAMS ((bfd *, struct elf64_hppa_dyn_hash_entry *, + int, asection *, int, bfd_vma, bfd_vma)); + +static boolean allocate_dynrel_entries + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_dynreloc + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean get_opd + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_plt + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_dlt + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_stub + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean +elf64_hppa_dyn_hash_table_init (ht, abfd, new) + struct elf64_hppa_dyn_hash_table *ht; + bfd *abfd; + new_hash_entry_func new; +{ + memset (ht, 0, sizeof(*ht)); + return bfd_hash_table_init (&ht->root, new); +} + +static struct bfd_hash_entry* +elf64_hppa_new_dyn_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf64_hppa_dyn_hash_entry *ret; + ret = (struct elf64_hppa_dyn_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting 8 bit fields. */ + memset (ret, 0, sizeof(*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elf64_hppa_dyn_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + return &ret->root; +} + +/* Create the derived linker hash table. The PA64 ELF port uses this + derived hash table to keep information specific to the PA ElF + linker (without using static variables). */ + +static struct bfd_link_hash_table* +elf64_hppa_hash_table_create (abfd) + bfd *abfd; +{ + struct elf64_hppa_link_hash_table *ret; + + ret = bfd_zalloc (abfd, sizeof (*ret)); + if (!ret) + return 0; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + _bfd_elf_link_hash_newfunc)) + { + bfd_release (abfd, ret); + return 0; + } + + if (!elf64_hppa_dyn_hash_table_init (&ret->dyn_hash_table, abfd, + elf64_hppa_new_dyn_hash_entry)) + return 0; + return &ret->root.root; +} + +/* Look up an entry in a PA64 ELF linker hash table. */ + +static struct elf64_hppa_dyn_hash_entry * +elf64_hppa_dyn_hash_lookup(table, string, create, copy) + struct elf64_hppa_dyn_hash_table *table; + const char *string; + boolean create, copy; +{ + return ((struct elf64_hppa_dyn_hash_entry *) + bfd_hash_lookup (&table->root, string, create, copy)); +} + +/* Traverse a PA64 ELF linker hash table. */ + +static void +elf64_hppa_dyn_hash_traverse (table, func, info) + struct elf64_hppa_dyn_hash_table *table; + boolean (*func) PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + PTR info; +{ + (bfd_hash_traverse + (&table->root, + (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) func, + info)); +} + +/* Return nonzero if ABFD represents a PA2.0 ELF64 file. + + Additionally we set the default architecture and machine. */ +static boolean +elf64_hppa_object_p (abfd) + bfd *abfd; +{ + /* Set the right machine number for an HPPA ELF file. */ + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25); +} + +/* Given section type (hdr->sh_type), return a boolean indicating + whether or not the section is an elf64-hppa specific section. */ +static boolean +elf64_hppa_section_from_shdr (abfd, hdr, name) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + + switch (hdr->sh_type) + { + case SHT_PARISC_EXT: + if (strcmp (name, ".PARISC.archext") != 0) + return false; + break; + case SHT_PARISC_UNWIND: + if (strcmp (name, ".PARISC.unwind") != 0) + return false; + break; + case SHT_PARISC_DOC: + case SHT_PARISC_ANNOT: + default: + return false; + } + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + newsect = hdr->bfd_section; + + return true; +} + + +/* Construct a string for use in the elf64_hppa_dyn_hash_table. The + name describes what was once potentially anonymous memory. We + allocate memory as necessary, possibly reusing PBUF/PLEN. */ + +static const char * +get_dyn_name (abfd, h, rel, pbuf, plen) + bfd *abfd; + struct elf_link_hash_entry *h; + const Elf_Internal_Rela *rel; + char **pbuf; + size_t *plen; +{ + size_t nlen, tlen; + char *buf; + size_t len; + + if (h && rel->r_addend == 0) + return h->root.root.string; + + if (h) + nlen = strlen (h->root.root.string); + else + { + nlen = sizeof(void*)*2 + 1 + sizeof(bfd_vma)*4 + 1 + 1; + nlen += 10; /* %p slop */ + } + tlen = nlen + 1 + 16 + 1; + + len = *plen; + buf = *pbuf; + if (len < tlen) + { + if (buf) + free (buf); + *pbuf = buf = malloc (tlen); + *plen = len = tlen; + if (!buf) + return NULL; + } + + if (h) + { + memcpy (buf, h->root.root.string, nlen); + sprintf_vma (buf + nlen, rel->r_addend); + } + else + { + nlen = sprintf (buf, "%p:%lx", abfd, ELF64_R_SYM (rel->r_info)); + if (rel->r_addend) + { + buf[nlen++] = '+'; + sprintf_vma (buf + nlen, rel->r_addend); + } + } + + return buf; +} + +/* SEC is a section containing relocs for an input BFD when linking; return + a suitable section for holding relocs in the output BFD for a link. */ + +static boolean +get_reloc_section (abfd, hppa_info, sec) + bfd *abfd; + struct elf64_hppa_link_hash_table *hppa_info; + asection *sec; +{ + const char *srel_name; + asection *srel; + bfd *dynobj; + + srel_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (srel_name == NULL) + return false; + + BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+5) == 0) + || (strncmp (srel_name, ".rel", 4) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+4) == 0)); + + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + srel = bfd_get_section_by_name (dynobj, srel_name); + if (srel == NULL) + { + srel = bfd_make_section (dynobj, srel_name); + if (srel == NULL + || !bfd_set_section_flags (dynobj, srel, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, srel, 3)) + return false; + } + + hppa_info->other_rel_sec = srel; + return true; +} + +/* Add a new entry to the list of dynamic relocations against DYN_H. + + We use this to keep a record of all the FPTR relocations against a + particular symbol so that we can create FPTR relocations in the + output file. */ + +static boolean +count_dyn_reloc (abfd, dyn_h, type, sec, sec_symndx, offset, addend) + bfd *abfd; + struct elf64_hppa_dyn_hash_entry *dyn_h; + int type; + asection *sec; + int sec_symndx; + bfd_vma offset; + bfd_vma addend; +{ + struct elf64_hppa_dyn_reloc_entry *rent; + + rent = (struct elf64_hppa_dyn_reloc_entry *) + bfd_alloc (abfd, sizeof (*rent)); + if (!rent) + return false; + + rent->next = dyn_h->reloc_entries; + rent->type = type; + rent->sec = sec; + rent->sec_symndx = sec_symndx; + rent->offset = offset; + rent->addend = addend; + dyn_h->reloc_entries = rent; + + return true; +} + +/* Scan the RELOCS and record the type of dynamic entries that each + referenced symbol needs. */ + +static boolean +elf64_hppa_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct elf64_hppa_link_hash_table *hppa_info; + const Elf_Internal_Rela *relend; + Elf_Internal_Shdr *symtab_hdr; + const Elf_Internal_Rela *rel; + asection *dlt, *plt, *stubs; + char *buf; + size_t buf_len; + int sec_symndx; + + if (info->relocateable) + return true; + + /* If this is the first dynamic object found in the link, create + the special sections required for dynamic linking. */ + if (! elf_hash_table (info)->dynamic_sections_created) + { + if (! bfd_elf64_link_create_dynamic_sections (abfd, info)) + return false; + } + + hppa_info = elf64_hppa_hash_table (info); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* If necessary, build a new table holding section symbols indices + for this BFD. This is disgusting. */ + + if (info->shared && hppa_info->section_syms_bfd != abfd) + { + int i, highest_shndx; + asection *section; + Elf_Internal_Sym *local_syms, *isym; + Elf64_External_Sym *ext_syms, *esym; + + /* We're done with the old cache of section index to section symbol + index information. Free it. + + ?!? Note we leak the last section_syms array. Presumably we + could free it in one of the later routines in this file. */ + if (hppa_info->section_syms) + free (hppa_info->section_syms); + + /* Allocate memory for the internal and external symbols. */ + local_syms + = (Elf_Internal_Sym *) bfd_malloc (symtab_hdr->sh_info + * sizeof (Elf_Internal_Sym)); + if (local_syms == NULL) + return false; + + ext_syms + = (Elf64_External_Sym *) bfd_malloc (symtab_hdr->sh_info + * sizeof (Elf64_External_Sym)); + if (ext_syms == NULL) + { + free (local_syms); + return false; + } + + /* Read in the local symbols. */ + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_read (ext_syms, 1, + (symtab_hdr->sh_info + * sizeof (Elf64_External_Sym)), abfd) + != (symtab_hdr->sh_info * sizeof (Elf64_External_Sym))) + { + free (local_syms); + free (ext_syms); + return false; + } + + /* Swap in the local symbols, also record the highest section index + referenced by the local symbols. */ + isym = local_syms; + esym = ext_syms; + highest_shndx = 0; + for (i = 0; i < symtab_hdr->sh_info; i++, esym++, isym++) + { + bfd_elf64_swap_symbol_in (abfd, esym, isym); + if (isym->st_shndx > highest_shndx) + highest_shndx = isym->st_shndx; + } + + /* Now we can free the external symbols. */ + free (ext_syms); + + /* Allocate an array to hold the section index to section symbol index + mapping. Bump by one since we start counting at zero. */ + highest_shndx++; + hppa_info->section_syms = (int *) bfd_malloc (highest_shndx + * sizeof (int)); + + /* Now walk the local symbols again. If we find a section symbol, + record the index of the symbol into the section_syms array. */ + for (isym = local_syms, i = 0; i < symtab_hdr->sh_info; i++, isym++) + { + if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) + hppa_info->section_syms[isym->st_shndx] = i; + } + + /* We are finished with the local symbols. Get rid of them. */ + free (local_syms); + + /* Record which BFD we built the section_syms mapping for. */ + hppa_info->section_syms_bfd = abfd; + } + + /* Record the symbol index for this input section. We may need it for + relocations when building shared libraries. When not building shared + libraries this value is never really used, but assign it to zero to + prevent out of bounds memory accesses in other routines. */ + if (info->shared) + { + sec_symndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + /* If we did not find a section symbol for this section, then + something went terribly wrong above. */ + if (sec_symndx == -1) + return false; + + sec_symndx = hppa_info->section_syms[sec_symndx]; + } + else + sec_symndx = 0; + + dlt = plt = stubs = NULL; + buf = NULL; + buf_len = 0; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_DLT = 1, + NEED_PLT = 2, + NEED_STUB = 4, + NEED_OPD = 8, + NEED_DYNREL = 16, + }; + + struct elf_link_hash_entry *h = NULL; + unsigned long r_symndx = ELF64_R_SYM (rel->r_info); + struct elf64_hppa_dyn_hash_entry *dyn_h; + int need_entry; + const char *addr_name; + boolean maybe_dynamic; + int dynrel_type = R_PARISC_NONE; + static reloc_howto_type *howto; + + if (r_symndx >= symtab_hdr->sh_info) + { + /* We're dealing with a global symbol -- find its hash entry + and mark it as being referenced. */ + long indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared && ! info->symbolic) + || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + howto = elf_hppa_howto_table + ELF64_R_TYPE (rel->r_info); + need_entry = 0; + switch (howto->type) + { + /* These are simple indirect references to symbols through the + DLT. We need to create a DLT entry for any symbols which + appears in a DLTIND relocation. */ + case R_PARISC_DLTIND21L: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14WR: + case R_PARISC_DLTIND14DR: + need_entry = NEED_DLT; + break; + + /* ?!? These need a DLT entry. But I have no idea what to do with + the "link time TP value. */ + case R_PARISC_LTOFF_TP21L: + case R_PARISC_LTOFF_TP14R: + case R_PARISC_LTOFF_TP14F: + case R_PARISC_LTOFF_TP64: + case R_PARISC_LTOFF_TP14WR: + case R_PARISC_LTOFF_TP14DR: + case R_PARISC_LTOFF_TP16F: + case R_PARISC_LTOFF_TP16WF: + case R_PARISC_LTOFF_TP16DF: + need_entry = NEED_DLT; + break; + + /* These are function calls. Depending on their precise target we + may need to make a stub for them. The stub uses the PLT, so we + need to create PLT entries for these symbols too. */ + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + case R_PARISC_PCREL32: + case R_PARISC_PCREL64: + case R_PARISC_PCREL21L: + case R_PARISC_PCREL17R: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL14R: + case R_PARISC_PCREL14F: + case R_PARISC_PCREL22C: + case R_PARISC_PCREL14WR: + case R_PARISC_PCREL14DR: + case R_PARISC_PCREL16F: + case R_PARISC_PCREL16WF: + case R_PARISC_PCREL16DF: + need_entry = (NEED_PLT | NEED_STUB); + break; + + case R_PARISC_PLTOFF21L: + case R_PARISC_PLTOFF14R: + case R_PARISC_PLTOFF14F: + case R_PARISC_PLTOFF14WR: + case R_PARISC_PLTOFF14DR: + case R_PARISC_PLTOFF16F: + case R_PARISC_PLTOFF16WF: + case R_PARISC_PLTOFF16DF: + need_entry = (NEED_PLT); + break; + + case R_PARISC_DIR64: + if (info->shared || maybe_dynamic) + need_entry = (NEED_DYNREL); + dynrel_type = R_PARISC_DIR64; + break; + + /* This is an indirect reference through the DLT to get the address + of a OPD descriptor. Thus we need to make a DLT entry that points + to an OPD entry. */ + case R_PARISC_LTOFF_FPTR21L: + case R_PARISC_LTOFF_FPTR14R: + case R_PARISC_LTOFF_FPTR14WR: + case R_PARISC_LTOFF_FPTR14DR: + case R_PARISC_LTOFF_FPTR32: + case R_PARISC_LTOFF_FPTR64: + case R_PARISC_LTOFF_FPTR16F: + case R_PARISC_LTOFF_FPTR16WF: + case R_PARISC_LTOFF_FPTR16DF: + if (info->shared || maybe_dynamic) + need_entry = (NEED_DLT | NEED_OPD); + else + need_entry = (NEED_DLT | NEED_OPD); + dynrel_type = R_PARISC_FPTR64; + break; + + /* This is a simple OPD entry. */ + case R_PARISC_FPTR64: + if (info->shared || maybe_dynamic) + need_entry = (NEED_OPD | NEED_DYNREL); + else + need_entry = (NEED_OPD); + dynrel_type = R_PARISC_FPTR64; + break; + + /* Add more cases as needed. */ + } + + if (!need_entry) + continue; + + /* Collect a canonical name for this address. */ + addr_name = get_dyn_name (abfd, h, rel, &buf, &buf_len); + + /* Collect the canonical entry data for this address. */ + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + addr_name, true, true); + BFD_ASSERT (dyn_h); + + /* Stash away enough information to be able to find this symbol + regardless of whether or not it is local or global. */ + dyn_h->h = h; + dyn_h->owner = abfd; + dyn_h->sym_indx = r_symndx; + + /* ?!? We may need to do some error checking in here. */ + /* Create what's needed. */ + if (need_entry & NEED_DLT) + { + if (! hppa_info->dlt_sec + && ! get_dlt (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_dlt = 1; + } + + if (need_entry & NEED_PLT) + { + if (! hppa_info->plt_sec + && ! get_plt (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_plt = 1; + } + + if (need_entry & NEED_STUB) + { + if (! hppa_info->stub_sec + && ! get_stub (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_stub = 1; + } + + if (need_entry & NEED_OPD) + { + if (! hppa_info->opd_sec + && ! get_opd (abfd, info, hppa_info)) + goto err_out; + + dyn_h->want_opd = 1; + + /* FPTRs are not allocated by the dynamic linker for PA64, though + it is possible that will change in the future. */ + + /* This could be a local function that had its address taken, in + which case H will be NULL. */ + if (h) + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + + /* Add a new dynamic relocation to the chain of dynamic + relocations for this symbol. */ + if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC)) + { + if (! hppa_info->other_rel_sec + && ! get_reloc_section (abfd, hppa_info, sec)) + goto err_out; + + if (!count_dyn_reloc (abfd, dyn_h, dynrel_type, sec, + sec_symndx, rel->r_offset, rel->r_addend)) + goto err_out; + + /* If we are building a shared library and we just recorded + a dynamic R_PARISC_FPTR64 relocation, then make sure the + section symbol for this section ends up in the dynamic + symbol table. */ + if (info->shared && dynrel_type == R_PARISC_FPTR64 + && ! (_bfd_elf64_link_record_local_dynamic_symbol + (info, abfd, sec_symndx))) + return false; + } + } + + if (buf) + free (buf); + return true; + + err_out: + if (buf) + free (buf); + return false; +} + +struct elf64_hppa_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + +/* Should we do dynamic things to this symbol? */ + +static boolean +elf64_hppa_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx == -1) + return false; + + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + return true; + + if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$') + return false; + + if ((info->shared && !info->symbolic) + || ((h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) + == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) + return true; + + return false; +} + +/* Mark all funtions exported by this file so that we can later allocate + entries in .opd for them. */ + +static boolean +elf64_hppa_mark_exported_functions (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + if (h + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section != NULL + && h->type == STT_FUNC) + { + struct elf64_hppa_dyn_hash_entry *dyn_h; + + /* Add this symbol to the PA64 linker hash table. */ + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + h->root.root.string, true, true); + BFD_ASSERT (dyn_h); + dyn_h->h = h; + + if (! hppa_info->opd_sec + && ! get_opd (hppa_info->root.dynobj, info, hppa_info)) + return false; + + dyn_h->want_opd = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + + return true; +} + +/* Allocate space for a DLT entry. */ + +static boolean +allocate_global_data_dlt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_dlt) + { + struct elf_link_hash_entry *h = dyn_h->h; + + if (x->info->shared) + { + /* Possibly add the symbol to the local dynamic symbol + table since we might need to create a dynamic relocation + against it. */ + if (! h + || (h && h->dynindx == -1)) + { + bfd *owner; + owner = (h ? h->root.u.def.section->owner : dyn_h->owner); + + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, owner, dyn_h->sym_indx)) + return false; + } + } + + dyn_h->dlt_offset = x->ofs; + x->ofs += DLT_ENTRY_SIZE; + } + return true; +} + +/* Allocate space for a DLT.PLT entry. */ + +static boolean +allocate_global_data_plt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_plt + && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info) + && !((dyn_h->h->root.type == bfd_link_hash_defined + || dyn_h->h->root.type == bfd_link_hash_defweak) + && dyn_h->h->root.u.def.section->output_section != NULL)) + { + dyn_h->plt_offset = x->ofs; + x->ofs += PLT_ENTRY_SIZE; + if (dyn_h->plt_offset < 0x2000) + elf64_hppa_hash_table (x->info)->gp_offset = dyn_h->plt_offset; + } + else + dyn_h->want_plt = 0; + + return true; +} + +/* Allocate space for a STUB entry. */ + +static boolean +allocate_global_data_stub (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_stub + && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info) + && !((dyn_h->h->root.type == bfd_link_hash_defined + || dyn_h->h->root.type == bfd_link_hash_defweak) + && dyn_h->h->root.u.def.section->output_section != NULL)) + { + dyn_h->stub_offset = x->ofs; + x->ofs += sizeof (plt_stub); + } + else + dyn_h->want_stub = 0; + return true; +} + +/* Allocate space for a FPTR entry. */ + +static boolean +allocate_global_data_opd (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_opd) + { + struct elf_link_hash_entry *h = dyn_h->h; + + if (h) + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* We never need an opd entry for a symbol which is not + defined by this output file. */ + if (h && h->root.type == bfd_link_hash_undefined) + dyn_h->want_opd = 0; + + /* If we are creating a shared library, took the address of a local + function or might export this function from this object file, then + we have to create an opd descriptor. */ + else if (x->info->shared + || h == NULL + || h->dynindx == -1 + || ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section != NULL)) + { + /* If we are creating a shared library, then we will have to + create a runtime relocation for the symbol to properly + initialize the .opd entry. Make sure the symbol gets + added to the dynamic symbol table. */ + if (x->info->shared + && (h == NULL || (h->dynindx == -1))) + { + bfd *owner; + owner = (h ? h->root.u.def.section->owner : dyn_h->owner); + + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, owner, dyn_h->sym_indx)) + return false; + } + + /* This may not be necessary or desirable anymore now that + we have some support for dealing with section symbols + in dynamic relocs. But name munging does make the result + much easier to debug. ie, the EPLT reloc will reference + a symbol like .foobar, instead of .text + offset. */ + if (x->info->shared && h) + { + char *new_name; + struct elf_link_hash_entry *nh; + + new_name = alloca (strlen (h->root.root.string) + 2); + new_name[0] = '.'; + strcpy (new_name + 1, h->root.root.string); + + nh = elf_link_hash_lookup (elf_hash_table (x->info), + new_name, true, true, true); + + nh->root.type = h->root.type; + nh->root.u.def.value = h->root.u.def.value; + nh->root.u.def.section = h->root.u.def.section; + + if (! bfd_elf64_link_record_dynamic_symbol (x->info, nh)) + return false; + + } + dyn_h->opd_offset = x->ofs; + x->ofs += OPD_ENTRY_SIZE; + } + + /* Otherwise we do not need an opd entry. */ + else + dyn_h->want_opd = 0; + } + return true; +} + +/* HP requires the EI_OSABI field to be filled in. The assignment to + EI_ABIVERSION may not be strictly necessary. */ + +static void +elf64_hppa_post_process_headers (abfd, link_info) + bfd * abfd; + struct bfd_link_info * link_info ATTRIBUTE_UNUSED; +{ + Elf_Internal_Ehdr * i_ehdrp; + + i_ehdrp = elf_elfheader (abfd); + + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + i_ehdrp->e_ident[EI_ABIVERSION] = 1; +} + +/* Create function descriptor section (.opd). This section is called .opd + because it contains "official prodecure descriptors". The "official" + refers to the fact that these descriptors are used when taking the address + of a procedure, thus ensuring a unique address for each procedure. */ + +static boolean +get_opd (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *opd; + bfd *dynobj; + + opd = hppa_info->opd_sec; + if (!opd) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + opd = bfd_make_section (dynobj, ".opd"); + if (!opd + || !bfd_set_section_flags (dynobj, opd, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, opd, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->opd_sec = opd; + } + + return true; +} + +/* Create the PLT section. */ + +static boolean +get_plt (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *plt; + bfd *dynobj; + + plt = hppa_info->plt_sec; + if (!plt) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + plt = bfd_make_section (dynobj, ".plt"); + if (!plt + || !bfd_set_section_flags (dynobj, plt, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, plt, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->plt_sec = plt; + } + + return true; +} + +/* Create the DLT section. */ + +static boolean +get_dlt (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *dlt; + bfd *dynobj; + + dlt = hppa_info->dlt_sec; + if (!dlt) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + dlt = bfd_make_section (dynobj, ".dlt"); + if (!dlt + || !bfd_set_section_flags (dynobj, dlt, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, dlt, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->dlt_sec = dlt; + } + + return true; +} + +/* Create the stubs section. */ + +static boolean +get_stub (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *stub; + bfd *dynobj; + + stub = hppa_info->stub_sec; + if (!stub) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + stub = bfd_make_section (dynobj, ".stub"); + if (!stub + || !bfd_set_section_flags (dynobj, stub, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, stub, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->stub_sec = stub; + } + + return true; +} + +/* Create sections necessary for dynamic linking. This is only a rough + cut and will likely change as we learn more about the somewhat + unusual dynamic linking scheme HP uses. + + .stub: + Contains code to implement cross-space calls. The first time one + of the stubs is used it will call into the dynamic linker, later + calls will go straight to the target. + + The only stub we support right now looks like + + ldd OFFSET(%dp),%r1 + bve %r0(%r1) + ldd OFFSET+8(%dp),%dp + + Other stubs may be needed in the future. We may want the remove + the break/nop instruction. It is only used right now to keep the + offset of a .plt entry and a .stub entry in sync. + + .dlt: + This is what most people call the .got. HP used a different name. + Losers. + + .rela.dlt: + Relocations for the DLT. + + .plt: + Function pointers as address,gp pairs. + + .rela.plt: + Should contain dynamic IPLT (and EPLT?) relocations. + + .opd: + FPTRS + + .rela.opd: + EPLT relocations for symbols exported from shared libraries. */ + +static boolean +elf64_hppa_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *s; + + if (! get_stub (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_dlt (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_plt (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_opd (abfd, info, elf64_hppa_hash_table (info))) + return false; + + s = bfd_make_section(abfd, ".rela.dlt"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->dlt_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.plt"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->plt_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.data"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->other_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.opd"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->opd_rel_sec = s; + + return true; +} + +/* Allocate dynamic relocations for those symbols that turned out + to be dynamic. */ + +static boolean +allocate_dynrel_entries (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_reloc_entry *rent; + boolean dynamic_symbol, shared; + + hppa_info = elf64_hppa_hash_table (x->info); + dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info); + shared = x->info->shared; + + /* We may need to allocate relocations for a non-dynamic symbol + when creating a shared library. */ + if (!dynamic_symbol && !shared) + return true; + + /* Take care of the normal data relocations. */ + + for (rent = dyn_h->reloc_entries; rent; rent = rent->next) + { + switch (rent->type) + { + case R_PARISC_FPTR64: + /* Allocate one iff we are not building a shared library and + !want_opd, which by this point will be true only if we're + actually allocating one statically in the main executable. */ + if (!x->info->shared && dyn_h->want_opd) + continue; + break; + } + hppa_info->other_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + /* Make sure this symbol gets into the dynamic symbol table if it is + not already recorded. ?!? This should not be in the loop since + the symbol need only be added once. */ + if (dyn_h->h == 0 || dyn_h->h->dynindx == -1) + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, rent->sec->owner, dyn_h->sym_indx)) + return false; + } + + /* Take care of the GOT and PLT relocations. */ + + if ((dynamic_symbol || shared) && dyn_h->want_dlt) + hppa_info->dlt_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + /* If we are building a shared library, then every symbol that has an + opd entry will need an EPLT relocation to relocate the symbol's address + and __gp value based on the runtime load address. */ + if (shared && dyn_h->want_opd) + hppa_info->opd_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + if (dyn_h->want_plt && dynamic_symbol) + { + bfd_size_type t = 0; + + /* Dynamic symbols get one IPLT relocation. Local symbols in + shared libraries get two REL relocations. Local symbols in + main applications get nothing. */ + if (dynamic_symbol) + t = sizeof (Elf64_External_Rela); + else if (shared) + t = 2 * sizeof (Elf64_External_Rela); + + hppa_info->plt_rel_sec->_raw_size += t; + } + + return true; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. */ + +static boolean +elf64_hppa_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + /* ??? Undefined symbols with PLT entries should be re-defined + to be the PLT entry. */ + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->weakdef != NULL) + { + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; + return true; + } + + /* If this is a reference to a symbol defined by a dynamic object which + is not a function, we might allocate the symbol in our .dynbss section + and allocate a COPY dynamic relocation. + + But PA64 code is canonically PIC, so as a rule we can avoid this sort + of hackery. */ + + return true; +} + +/* Set the final sizes of the dynamic sections and allocate memory for + the contents of our special sections. */ + +static boolean +elf64_hppa_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *s; + boolean plt; + boolean relocs; + boolean reltext; + boolean stubs; + struct elf64_hppa_allocate_data data; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + s = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (s != NULL); + s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; + s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; + } + } + else + { + /* We may have created entries in the .rela.got section. + However, if we are not creating the dynamic sections, we will + not actually use these entries. Reset the size of .rela.dlt, + which will cause it to get stripped from the output file + below. */ + s = bfd_get_section_by_name (dynobj, ".rela.dlt"); + if (s != NULL) + s->_raw_size = 0; + } + + /* Allocate the GOT entries. */ + + data.info = info; + if (elf64_hppa_hash_table (info)->dlt_sec) + { + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_dlt, &data); + hppa_info->dlt_sec->_raw_size = data.ofs; + + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_plt, &data); + hppa_info->plt_sec->_raw_size = data.ofs; + + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_stub, &data); + hppa_info->stub_sec->_raw_size = data.ofs; + } + + /* Mark each function this program exports so that we will allocate + space in the .opd section for each function's FPTR. + + We have to traverse the main linker hash table since we have to + find functions which may not have been mentioned in any relocs. */ + elf_link_hash_traverse (elf_hash_table (info), + elf64_hppa_mark_exported_functions, + info); + + /* Allocate space for entries in the .opd section. */ + if (elf64_hppa_hash_table (info)->opd_sec) + { + data.ofs = 0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_opd, &data); + hppa_info->opd_sec->_raw_size = data.ofs; + } + + /* Now allocate space for dynamic relocations, if necessary. */ + if (hppa_info->root.dynamic_sections_created) + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_dynrel_entries, &data); + + /* The sizes of all the sections are set. Allocate memory for them. */ + plt = false; + relocs = false; + reltext = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + boolean strip; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + strip = 0; + + if (strcmp (name, ".plt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + else + { + /* Remember whether there is a PLT. */ + plt = true; + } + } + else if (strcmp (name, ".dlt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + } + else if (strcmp (name, ".opd") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + } + else if (strncmp (name, ".rela", 4) == 0) + { + if (s->_raw_size == 0) + { + /* If we don't need this section, strip it from the + output file. This is mostly to handle .rela.bss and + .rela.plt. We must create both sections in + create_dynamic_sections, because they must be created + before the linker maps input sections to output + sections. The linker does that before + adjust_dynamic_symbol is called, and it is that + function which decides whether anything needs to go + into these sections. */ + strip = true; + } + else + { + asection *target; + + /* Remember whether there are any reloc sections other + than .rela.plt. */ + if (strcmp (name, ".rela.plt") != 0) + { + const char *outname; + + relocs = true; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL + entry. The entries in the .rela.plt section + really apply to the .got section, which we + created ourselves and so know is not readonly. */ + outname = bfd_get_section_name (output_bfd, + s->output_section); + target = bfd_get_section_by_name (output_bfd, outname + 4); + if (target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) + reltext = true; + } + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + } + else if (strncmp (name, ".dlt", 4) != 0 + && strcmp (name, ".stub") != 0 + && strcmp (name, ".got") != 0) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + if (strip) + { + _bfd_strip_section_from_output (info, s); + continue; + } + + /* Allocate memory for the section contents if it has not + been allocated already. */ + if (s->contents == NULL) + { + s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return false; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Always create a DT_PLTGOT. It actually has nothing to do with + the PLT, it is how we communicate the __gp value of a load + module to the dynamic linker. */ + if (! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_FLAGS, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)) + return false; + + /* Add some entries to the .dynamic section. We fill in the + values later, in elf64_hppa_finish_dynamic_sections, but we + must add the entries now so that we get the correct size for + the .dynamic section. The DT_DEBUG entry is filled in by the + dynamic linker and used by the debugger. */ + if (! info->shared) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_HOOK, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_HP_LOAD_MAP, 0)) + return false; + } + + if (plt) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) + || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + return false; + } + + if (relocs) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, + sizeof (Elf64_External_Rela))) + return false; + } + + if (reltext) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + } + } + + return true; +} + +/* Called after we have output the symbol into the dynamic symbol + table, but before we output the symbol into the normal symbol + table. + + For some symbols we had to change their address when outputting + the dynamic symbol table. We undo that change here so that + the symbols have their expected value in the normal symbol + table. Ick. */ + +static boolean +elf64_hppa_link_output_symbol_hook (abfd, info, name, sym, input_sec) + bfd *abfd; + struct bfd_link_info *info; + const char *name; + Elf_Internal_Sym *sym; + asection *input_sec; +{ + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_hash_entry *dyn_h; + + /* We may be called with the file symbol or section symbols. + They never need munging, so it is safe to ignore them. */ + if (!name) + return true; + + /* Get the PA dyn_symbol (if any) associated with NAME. */ + hppa_info = elf64_hppa_hash_table (info); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + name, false, false); + + /* Function symbols for which we created .opd entries were munged + by finish_dynamic_symbol and have to be un-munged here. */ + if (dyn_h && dyn_h->want_opd) + { + /* Restore the saved value and section index. */ + sym->st_value = dyn_h->st_value; + sym->st_shndx = dyn_h->st_shndx; + } + + return true; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) + bfd *output_bfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + asection *stub, *splt, *sdlt, *sopd, *spltrel, *sdltrel; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_hash_entry *dyn_h; + + hppa_info = elf64_hppa_hash_table (info); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + h->root.root.string, false, false); + + stub = hppa_info->stub_sec; + splt = hppa_info->plt_sec; + sdlt = hppa_info->dlt_sec; + sopd = hppa_info->opd_sec; + spltrel = hppa_info->plt_rel_sec; + sdltrel = hppa_info->dlt_rel_sec; + + BFD_ASSERT (stub != NULL && splt != NULL + && sopd != NULL && sdlt != NULL) + + /* Incredible. It is actually necessary to NOT use the symbol's real + value when building the dynamic symbol table for a shared library. + At least for symbols that refer to functions. + + We will store a new value and section index into the symbol long + enough to output it into the dynamic symbol table, then we restore + the original values (in elf64_hppa_link_output_symbol_hook). */ + if (dyn_h && dyn_h->want_opd) + { + /* Save away the original value and section index so that we + can restore them later. */ + dyn_h->st_value = sym->st_value; + dyn_h->st_shndx = sym->st_shndx; + + /* For the dynamic symbol table entry, we want the value to be + address of this symbol's entry within the .opd section. */ + sym->st_value = (dyn_h->opd_offset + + sopd->output_offset + + sopd->output_section->vma); + sym->st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, + sopd->output_section); + } + + /* Initialize a .plt entry if requested. */ + if (dyn_h && dyn_h->want_plt + && elf64_hppa_dynamic_symbol_p (dyn_h->h, info)) + { + bfd_vma value; + Elf_Internal_Rela rel; + + /* We do not actually care about the value in the PLT entry + if we are creating a shared library and the symbol is + still undefined, we create a dynamic relocation to fill + in the correct value. */ + if (info->shared && h->root.type == bfd_link_hash_undefined) + value = 0; + else + value = (h->root.u.def.value + h->root.u.def.section->vma); + + /* Fill in the entry in the procedure linkage table. + + The format of a plt entry is + <__gp>. + + plt_offset is the offset within the PLT section at which to + install the PLT entry. + + We are modifying the in-memory PLT contents here, so we do not add + in the output_offset of the PLT section. */ + + bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset); + value = _bfd_get_gp_value (splt->output_section->owner); + bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset + 0x8); + + /* Create a dynamic IPLT relocation for this entry. + + We are creating a relocation in the output file's PLT section, + which is included within the DLT secton. So we do need to include + the PLT's output_offset in the computation of the relocation's + address. */ + rel.r_offset = (dyn_h->plt_offset + splt->output_offset + + splt->output_section->vma); + rel.r_info = ELF64_R_INFO (h->dynindx, R_PARISC_IPLT); + rel.r_addend = 0; + + bfd_elf64_swap_reloca_out (splt->output_section->owner, &rel, + (((Elf64_External_Rela *) + spltrel->contents) + + spltrel->reloc_count)); + spltrel->reloc_count++; + } + + /* Initialize an external call stub entry if requested. */ + if (dyn_h && dyn_h->want_stub + && elf64_hppa_dynamic_symbol_p (dyn_h->h, info)) + { + bfd_vma value; + int insn; + + /* Install the generic stub template. + + We are modifying the contents of the stub section, so we do not + need to include the stub section's output_offset here. */ + memcpy (stub->contents + dyn_h->stub_offset, plt_stub, sizeof (plt_stub)); + + /* Fix up the first ldd instruction. + + We are modifying the contents of the STUB section in memory, + so we do not need to include its output offset in this computation. + + Note the plt_offset value is the value of the PLT entry relative to + the start of the PLT section. These instructions will reference + data relative to the value of __gp, which may not necessarily have + the same address as the start of the PLT section. + + gp_offset contains the offset of __gp within the PLT section. */ + value = dyn_h->plt_offset - hppa_info->gp_offset; + + insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset); + insn &= 0xffffc00e; + insn |= ((value & 0x2000) >> 13); + value &= 0x1ff8; + value <<= 1; + bfd_put_32 (stub->owner, (insn | value), + stub->contents + dyn_h->stub_offset); + + /* Fix up the second ldd instruction. */ + value = dyn_h->plt_offset - hppa_info->gp_offset + 8; + + insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset + 8); + insn &= 0xffffc00e; + insn |= ((value & 0x2000) >> 13); + value &= 0x1ff8; + value <<= 1; + bfd_put_32 (stub->owner, (insn | value), + stub->contents + dyn_h->stub_offset + 8); + } + + /* Millicode symbols should not be put in the dynamic + symbol table under any circumstances. */ + if (ELF_ST_TYPE (sym->st_info) == STT_PARISC_MILLI) + h->dynindx = -1; + + return true; +} + +/* The .opd section contains FPTRs for each function this file + exports. Initialize the FPTR entries. */ + +static boolean +elf64_hppa_finalize_opd (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf_link_hash_entry *h = dyn_h->h; + asection *sopd; + asection *sopdrel; + + hppa_info = elf64_hppa_hash_table (info); + sopd = hppa_info->opd_sec; + sopdrel = hppa_info->opd_rel_sec; + + if (h && dyn_h && dyn_h->want_opd) + { + bfd_vma value; + + /* The first two words of an .opd entry are zero. + + We are modifying the contents of the OPD section in memory, so we + do not need to include its output offset in this computation. */ + memset (sopd->contents + dyn_h->opd_offset, 0, 16); + + value = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + + /* The next word is the address of the function. */ + bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 16); + + /* The last word is our local __gp value. */ + value = _bfd_get_gp_value (sopd->output_section->owner); + bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 24); + } + + /* If we are generating a shared library, we must generate EPLT relocations + for each entry in the .opd, even for static functions (they may have + had their address taken). */ + if (info->shared && dyn_h && dyn_h->want_opd) + { + Elf64_Internal_Rela rel; + bfd_vma value; + int dynindx; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + /* The offset of this relocation is the absolute address of the + .opd entry for this symbol. */ + rel.r_offset = (dyn_h->opd_offset + sopd->output_offset + + sopd->output_section->vma); + + /* If H is non-null, then we have an external symbol. + + It is imperative that we use a different dynamic symbol for the + EPLT relocation if the symbol has global scope. + + In the dynamic symbol table, the function symbol will have a value + which is address of the function's .opd entry. + + Thus, we can not use that dynamic symbol for the EPLT relocation + (if we did, the data in the .opd would reference itself rather + than the actual address of the function). Instead we have to use + a new dynamic symbol which has the same value as the original global + function symbol. + + We prefix the original symbol with a "." and use the new symbol in + the EPLT relocation. This new symbol has already been recorded in + the symbol table, we just have to look it up and use it. + + We do not have such problems with static functions because we do + not make their addresses in the dynamic symbol table point to + the .opd entry. Ultimately this should be safe since a static + function can not be directly referenced outside of its shared + library. + + We do have to play similar games for FPTR relocations in shared + libraries, including those for static symbols. See the FPTR + handling in elf64_hppa_finalize_dynreloc. */ + if (h) + { + char *new_name; + struct elf_link_hash_entry *nh; + + new_name = alloca (strlen (h->root.root.string) + 2); + new_name[0] = '.'; + strcpy (new_name + 1, h->root.root.string); + + nh = elf_link_hash_lookup (elf_hash_table (info), + new_name, false, false, false); + + /* All we really want from the new symbol is its dynamic + symbol index. */ + dynindx = nh->dynindx; + } + + rel.r_addend = 0; + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT); + + bfd_elf64_swap_reloca_out (sopd->output_section->owner, &rel, + (((Elf64_External_Rela *) + sopdrel->contents) + + sopdrel->reloc_count)); + sopdrel->reloc_count++; + } + return true; +} + +/* The .dlt section contains addresses for items referenced through the + dlt. Note that we can have a DLTIND relocation for a local symbol, thus + we can not depend on finish_dynamic_symbol to initialize the .dlt. */ + +static boolean +elf64_hppa_finalize_dlt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + asection *sdlt, *sdltrel; + struct elf_link_hash_entry *h = dyn_h->h; + + hppa_info = elf64_hppa_hash_table (info); + + sdlt = hppa_info->dlt_sec; + sdltrel = hppa_info->dlt_rel_sec; + + /* H/DYN_H may refer to a local variable and we know it's + address, so there is no need to create a relocation. Just install + the proper value into the DLT, note this shortcut can not be + skipped when building a shared library. */ + if (! info->shared && h && dyn_h && dyn_h->want_dlt) + { + bfd_vma value; + + /* If we had an LTOFF_FPTR style relocation we want the DLT entry + to point to the FPTR entry in the .opd section. + + We include the OPD's output offset in this computation as + we are referring to an absolute address in the resulting + object file. */ + if (dyn_h->want_opd) + { + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_offset + + hppa_info->opd_sec->output_section->vma); + } + else + { + value = (h->root.u.def.value + + h->root.u.def.section->output_offset); + + if (h->root.u.def.section->output_section) + value += h->root.u.def.section->output_section->vma; + else + value += h->root.u.def.section->vma; + } + + /* We do not need to include the output offset of the DLT section + here because we are modifying the in-memory contents. */ + bfd_put_64 (sdlt->owner, value, sdlt->contents + dyn_h->dlt_offset); + } + + /* Create a relocation for the DLT entry assocated with this symbol. + When building a shared library the symbol does not have to be dynamic. */ + if (dyn_h->want_dlt + && (elf64_hppa_dynamic_symbol_p (dyn_h->h, info) || info->shared)) + { + Elf64_Internal_Rela rel; + int dynindx; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + + /* Create a dynamic relocation for this entry. Do include the output + offset of the DLT entry since we need an absolute address in the + resulting object file. */ + rel.r_offset = (dyn_h->dlt_offset + sdlt->output_offset + + sdlt->output_section->vma); + if (h && h->type == STT_FUNC) + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_FPTR64); + else + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64); + rel.r_addend = 0; + + bfd_elf64_swap_reloca_out (sdlt->output_section->owner, &rel, + (((Elf64_External_Rela *) + sdltrel->contents) + + sdltrel->reloc_count)); + sdltrel->reloc_count++; + } + return true; +} + +/* Finalize the dynamic relocations. Specifically the FPTR relocations + for dynamic functions used to initialize static data. */ + +static boolean +elf64_hppa_finalize_dynreloc (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf_link_hash_entry *h; + int dynamic_symbol; + + dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, info); + + if (!dynamic_symbol && !info->shared) + return true; + + if (dyn_h->reloc_entries) + { + struct elf64_hppa_dyn_reloc_entry *rent; + int dynindx; + + hppa_info = elf64_hppa_hash_table (info); + h = dyn_h->h; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + for (rent = dyn_h->reloc_entries; rent; rent = rent->next) + { + Elf64_Internal_Rela rel; + + switch (rent->type) + { + case R_PARISC_FPTR64: + /* Allocate one iff we are not building a shared library and + !want_opd, which by this point will be true only if we're + actually allocating one statically in the main executable. */ + if (!info->shared && dyn_h->want_opd) + continue; + break; + } + + /* Create a dynamic relocation for this entry. + + We need the output offset for the reloc's section because + we are creating an absolute address in the resulting object + file. */ + rel.r_offset = (rent->offset + rent->sec->output_offset + + rent->sec->output_section->vma); + + /* An FPTR64 relocation implies that we took the address of + a function and that the function has an entry in the .opd + section. We want the FPTR64 relocation to reference the + entry in .opd. + + We could munge the symbol value in the dynamic symbol table + (in fact we already do for functions with global scope) to point + to the .opd entry. Then we could use that dynamic symbol in + this relocation. + + Or we could do something sensible, not munge the symbol's + address and instead just use a different symbol to reference + the .opd entry. At least that seems sensible until you + realize there's no local dynamic symbols we can use for that + purpose. Thus the hair in the check_relocs routine. + + We use a section symbol recorded by check_relocs as the + base symbol for the relocation. The addend is the difference + between the section symbol and the address of the .opd entry. */ + if (info->shared && rent->type == R_PARISC_FPTR64) + { + bfd_vma value, value2; + asymbol *sym; + int elf_index; + + /* First compute the address of the opd entry for this symbol. */ + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_section->vma + + hppa_info->opd_sec->output_offset); + + /* Compute the value of the start of the section with + the relocation. */ + value2 = (rent->sec->output_section->vma + + rent->sec->output_offset); + + /* Compute the difference between the start of the section + with the relocation and the opd entry. */ + value -= value2; + + /* The result becomes the addend of the relocation. */ + rel.r_addend = value; + + /* The section symbol becomes the symbol for the dynamic + relocation. */ + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, + rent->sec->owner, + rent->sec_symndx); + } + else + rel.r_addend = rent->addend; + + rel.r_info = ELF64_R_INFO (dynindx, rent->type); + + bfd_elf64_swap_reloca_out (hppa_info->other_rel_sec->output_section->owner, + &rel, + (((Elf64_External_Rela *) + hppa_info->other_rel_sec->contents) + + hppa_info->other_rel_sec->reloc_count)); + hppa_info->other_rel_sec->reloc_count++; + } + } + + return true; +} + +/* Finish up the dynamic sections. */ + +static boolean +elf64_hppa_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *sdyn; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + /* Finalize the contents of the .opd section. */ + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_opd, + info); + + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_dynreloc, + info); + + /* Finalize the contents of the .dlt section. */ + dynobj = elf_hash_table (info)->dynobj; + /* Finalize the contents of the .dlt section. */ + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_dlt, + info); + + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (elf_hash_table (info)->dynamic_sections_created) + { + Elf64_External_Dyn *dyncon, *dynconend; + struct elf_link_hash_entry *h; + + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + asection *s; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + break; + + case DT_HP_LOAD_MAP: + /* Compute the absolute address of 16byte scratchpad area + for the dynamic linker. + + By convention the linker script will allocate the scratchpad + area at the start of the .data section. So all we have to + to is find the start of the .data section. */ + s = bfd_get_section_by_name (output_bfd, ".data"); + dyn.d_un.d_ptr = s->vma; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTGOT: + /* HP's use PLTGOT to set the GOT register. */ + dyn.d_un.d_ptr = _bfd_get_gp_value (output_bfd); + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_JMPREL: + s = hppa_info->plt_rel_sec; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: + s = hppa_info->plt_rel_sec; + dyn.d_un.d_val = s->_raw_size; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_RELA: + s = hppa_info->other_rel_sec; + if (! s) + s = hppa_info->dlt_rel_sec; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_RELASZ: + s = hppa_info->other_rel_sec; + dyn.d_un.d_val = s->_raw_size; + s = hppa_info->dlt_rel_sec; + dyn.d_un.d_val += s->_raw_size; + s = hppa_info->opd_rel_sec; + dyn.d_un.d_val += s->_raw_size; + /* There is some question about whether or not the size of + the PLT relocs should be included here. HP's tools do + it, so we'll emulate them. */ + s = hppa_info->plt_rel_sec; + dyn.d_un.d_val += s->_raw_size; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + } + } + } + + return true; +} + + +/* Return the number of additional phdrs we will need. + + The generic ELF code only creates PT_PHDRs for executables. The HP + dynamic linker requires PT_PHDRs for dynamic libraries too. + + This routine indicates that the backend needs one additional program + header for that case. + + Note we do not have access to the link info structure here, so we have + to guess whether or not we are building a shared library based on the + existence of a .interp section. */ + +static int +elf64_hppa_additional_program_headers (abfd) + bfd *abfd; +{ + asection *s; + + /* If we are creating a shared library, then we have to create a + PT_PHDR segment. HP's dynamic linker chokes without it. */ + s = bfd_get_section_by_name (abfd, ".interp"); + if (! s) + return 1; + return 0; +} + +/* Allocate and initialize any program headers required by this + specific backend. + + The generic ELF code only creates PT_PHDRs for executables. The HP + dynamic linker requires PT_PHDRs for dynamic libraries too. + + This allocates the PT_PHDR and initializes it in a manner suitable + for the HP linker. + + Note we do not have access to the link info structure here, so we have + to guess whether or not we are building a shared library based on the + existence of a .interp section. */ + +static boolean +elf64_hppa_modify_segment_map (abfd) + bfd *abfd; +{ + struct elf_segment_map *m, **pm; + asection *s; + + s = bfd_get_section_by_name (abfd, ".interp"); + if (! s) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_PHDR) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_PHDR; + m->p_flags = PF_R | PF_X; + m->p_flags_valid = 1; + m->p_paddr_valid = 1; + m->includes_phdrs = 1; + + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } + } + + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + { + int i; + + for (i = 0; i < m->count; i++) + { + /* The code "hint" is not really a hint. It is a requirement + for certain versions of the HP dynamic linker. Worse yet, + it must be set even if the shared library does not have + any code in its "text" segment (thus the check for .hash + to catch this situation). */ + if (m->sections[i]->flags & SEC_CODE + || (strcmp (m->sections[i]->name, ".hash") == 0)) + m->p_flags |= (PF_X | PF_HP_CODE); + } + } + + return true; +} + +/* The hash bucket size is the standard one, namely 4. */ + +const struct elf_size_info hppa64_elf_size_info = +{ + sizeof (Elf64_External_Ehdr), + sizeof (Elf64_External_Phdr), + sizeof (Elf64_External_Shdr), + sizeof (Elf64_External_Rel), + sizeof (Elf64_External_Rela), + sizeof (Elf64_External_Sym), + sizeof (Elf64_External_Dyn), + sizeof (Elf_External_Note), + 4, + 1, + 64, 8, + ELFCLASS64, EV_CURRENT, + bfd_elf64_write_out_phdrs, + bfd_elf64_write_shdrs_and_ehdr, + bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_out, + bfd_elf64_slurp_reloc_table, + bfd_elf64_slurp_symbol_table, + bfd_elf64_swap_dyn_in, + bfd_elf64_swap_dyn_out, + NULL, + NULL, + NULL, + NULL +}; + +#define TARGET_BIG_SYM bfd_elf64_hppa_vec +#define TARGET_BIG_NAME "elf64-hppa" +#define ELF_ARCH bfd_arch_hppa +#define ELF_MACHINE_CODE EM_PARISC +/* This is not strictly correct. The maximum page size for PA2.0 is + 64M. But everything still uses 4k. */ +#define ELF_MAXPAGESIZE 0x1000 +#define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup +#define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name +#define elf_info_to_howto elf_hppa_info_to_howto +#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel + +#define elf_backend_section_from_shdr elf64_hppa_section_from_shdr +#define elf_backend_object_p elf64_hppa_object_p +#define elf_backend_final_write_processing \ + elf_hppa_final_write_processing +#define elf_backend_fake_sections elf_hppa_fake_sections +#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook + +#define elf_backend_relocate_section elf_hppa_relocate_section + +#define bfd_elf64_bfd_final_link elf_hppa_final_link + +#define elf_backend_create_dynamic_sections \ + elf64_hppa_create_dynamic_sections +#define elf_backend_post_process_headers elf64_hppa_post_process_headers + +#define elf_backend_adjust_dynamic_symbol \ + elf64_hppa_adjust_dynamic_symbol + +#define elf_backend_size_dynamic_sections \ + elf64_hppa_size_dynamic_sections + +#define elf_backend_finish_dynamic_symbol \ + elf64_hppa_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + elf64_hppa_finish_dynamic_sections + +/* Stuff for the BFD linker: */ +#define bfd_elf64_bfd_link_hash_table_create \ + elf64_hppa_hash_table_create + +#define elf_backend_check_relocs \ + elf64_hppa_check_relocs + +#define elf_backend_size_info \ + hppa64_elf_size_info + +#define elf_backend_additional_program_headers \ + elf64_hppa_additional_program_headers + +#define elf_backend_modify_segment_map \ + elf64_hppa_modify_segment_map + +#define elf_backend_link_output_symbol_hook \ + elf64_hppa_link_output_symbol_hook + + +#define elf_backend_want_got_plt 0 +#define elf_backend_plt_readonly 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size 0 +#define elf_backend_plt_header_size 0 +#define elf_backend_type_change_ok true + +#include "elf64-target.h" diff --git a/bfd/elf64-hppa.h b/bfd/elf64-hppa.h new file mode 100644 index 00000000000..5098e0c42b3 --- /dev/null +++ b/bfd/elf64-hppa.h @@ -0,0 +1,47 @@ +/* ELF64/HPPA support + + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF64_HPPA_H +#define _ELF64_HPPA_H + +#include "elf-bfd.h" +#include "libhppa.h" +#include "elf/hppa.h" + +extern elf_hppa_reloc_type ** _bfd_elf64_hppa_gen_reloc_type + PARAMS ((bfd *, elf_hppa_reloc_type, int, int, int, asymbol *)); + +/* Define groups of basic relocations. FIXME: These should + be the only basic relocations created by GAS. The rest + should be internal to the BFD backend. + + The idea is both SOM and ELF define these basic relocation + types so they map into a SOM or ELF specific relocation + as appropriate. This allows GAS to share much more code + between the two target object formats. */ + +#define R_HPPA_NONE R_PARISC_NONE +#define R_HPPA R_PARISC_DIR64 +#define R_HPPA_GOTOFF R_PARISC_DLTREL21L +#define R_HPPA_PCREL_CALL R_PARISC_PCREL21L +#define R_HPPA_ABS_CALL R_PARISC_DIR17F +#define R_HPPA_COMPLEX R_PARISC_UNIMPLEMENTED + +#endif /* _ELF64_HPPA_H */ diff --git a/bfd/elf64-ia64.c b/bfd/elf64-ia64.c new file mode 100644 index 00000000000..2fafeb18b29 --- /dev/null +++ b/bfd/elf64-ia64.c @@ -0,0 +1,4097 @@ +/* IA-64 support for 64-bit ELF + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "opcode/ia64.h" +#include "elf/ia64.h" + + +/* + * THE RULES for all the stuff the linker creates -- + * + * GOT Entries created in response to LTOFF or LTOFF_FPTR + * relocations. Dynamic relocs created for dynamic + * symbols in an application; REL relocs for locals + * in a shared library. + * + * FPTR The canonical function descriptor. Created for local + * symbols in applications. Descriptors for dynamic symbols + * and local symbols in shared libraries are created by + * ld.so. Thus there are no dynamic relocs against these + * objects. The FPTR relocs for such _are_ passed through + * to the dynamic relocation tables. + * + * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol. + * Requires the creation of a PLTOFF entry. This does not + * require any dynamic relocations. + * + * PLTOFF Created by PLTOFF relocations. For local symbols, this + * is an alternate function descriptor, and in shared libraries + * requires two REL relocations. Note that this cannot be + * transformed into an FPTR relocation, since it must be in + * range of the GP. For dynamic symbols, this is a function + * descriptor for a MIN_PLT entry, and requires one IPLT reloc. + * + * MIN_PLT Created by PLTOFF entries against dynamic symbols. This + * does not reqire dynamic relocations. + */ + +#define USE_RELA /* we want RELA relocs, not REL */ + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +typedef struct bfd_hash_entry *(*new_hash_entry_func) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +/* In dynamically (linker-) created sections, we generally need to keep track + of the place a symbol or expression got allocated to. This is done via hash + tables that store entries of the following type. */ + +struct elf64_ia64_dyn_sym_info +{ + /* The addend for which this entry is relevant. */ + bfd_vma addend; + + /* Next addend in the list. */ + struct elf64_ia64_dyn_sym_info *next; + + bfd_vma got_offset; + bfd_vma fptr_offset; + bfd_vma pltoff_offset; + bfd_vma plt_offset; + bfd_vma plt2_offset; + + /* The symbol table entry, if any, that this was derrived from. */ + struct elf_link_hash_entry *h; + + /* Used to count non-got, non-plt relocations for delayed sizing + of relocation sections. */ + struct elf64_ia64_dyn_reloc_entry + { + struct elf64_ia64_dyn_reloc_entry *next; + asection *srel; + int type; + int count; + } *reloc_entries; + + /* True when the section contents have been updated. */ + unsigned got_done : 1; + unsigned fptr_done : 1; + unsigned pltoff_done : 1; + + /* True for the different kinds of linker data we want created. */ + unsigned want_got : 1; + unsigned want_fptr : 1; + unsigned want_ltoff_fptr : 1; + unsigned want_plt : 1; + unsigned want_plt2 : 1; + unsigned want_pltoff : 1; +}; + +struct elf64_ia64_local_hash_entry +{ + struct bfd_hash_entry root; + struct elf64_ia64_dyn_sym_info *info; +}; + +struct elf64_ia64_local_hash_table +{ + struct bfd_hash_table root; + /* No additional fields for now. */ +}; + +struct elf64_ia64_link_hash_entry +{ + struct elf_link_hash_entry root; + struct elf64_ia64_dyn_sym_info *info; +}; + +struct elf64_ia64_link_hash_table +{ + /* The main hash table */ + struct elf_link_hash_table root; + + asection *got_sec; /* the linkage table section (or NULL) */ + asection *rel_got_sec; /* dynamic relocation section for same */ + asection *fptr_sec; /* function descriptor table (or NULL) */ + asection *plt_sec; /* the primary plt section (or NULL) */ + asection *pltoff_sec; /* private descriptors for plt (or NULL) */ + asection *rel_pltoff_sec; /* dynamic relocation section for same */ + + bfd_size_type minplt_entries; /* number of minplt entries */ + + struct elf64_ia64_local_hash_table loc_hash_table; +}; + +#define elf64_ia64_hash_table(p) \ + ((struct elf64_ia64_link_hash_table *) ((p)->hash)) + +static bfd_reloc_status_type elf64_ia64_reloc + PARAMS ((bfd *abfd, arelent *reloc, asymbol *sym, PTR data, + asection *input_section, bfd *output_bfd, char **error_message)); +static reloc_howto_type * lookup_howto + PARAMS ((unsigned int rtype)); +static reloc_howto_type *elf64_ia64_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code)); +static void elf64_ia64_info_to_howto + PARAMS ((bfd *abfd, arelent *bfd_reloc, Elf64_Internal_Rela *elf_reloc)); +static boolean elf64_ia64_relax_section + PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, + boolean *again)); +static boolean elf64_ia64_section_from_shdr + PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); +static boolean elf64_ia64_fake_sections + PARAMS ((bfd *abfd, Elf64_Internal_Shdr *hdr, asection *sec)); +static boolean elf64_ia64_add_symbol_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym, + const char **namep, flagword *flagsp, asection **secp, + bfd_vma *valp)); +static int elf64_ia64_additional_program_headers + PARAMS ((bfd *abfd)); +static boolean elf64_ia64_is_local_label_name + PARAMS ((bfd *abfd, const char *name)); +static boolean elf64_ia64_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *h, struct bfd_link_info *info)); +static boolean elf64_ia64_local_hash_table_init + PARAMS ((struct elf64_ia64_local_hash_table *ht, bfd *abfd, + new_hash_entry_func new)); +static struct bfd_hash_entry *elf64_ia64_new_loc_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_hash_entry *elf64_ia64_new_elf_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_link_hash_table *elf64_ia64_hash_table_create + PARAMS ((bfd *abfd)); +static struct elf64_ia64_local_hash_entry *elf64_ia64_local_hash_lookup + PARAMS ((struct elf64_ia64_local_hash_table *table, const char *string, + boolean create, boolean copy)); +static void elf64_ia64_dyn_sym_traverse + PARAMS ((struct elf64_ia64_link_hash_table *ia64_info, + boolean (*func)(struct elf64_ia64_dyn_sym_info *, PTR), + PTR info)); +static boolean elf64_ia64_create_dynamic_sections + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static struct elf64_ia64_dyn_sym_info * get_dyn_sym_info + PARAMS ((struct elf64_ia64_link_hash_table *ia64_info, + struct elf_link_hash_entry *h, + bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); +static asection *get_got + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_link_hash_table *ia64_info)); +static asection *get_fptr + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_link_hash_table *ia64_info)); +static asection *get_pltoff + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_link_hash_table *ia64_info)); +static asection *get_reloc_section + PARAMS ((bfd *abfd, struct elf64_ia64_link_hash_table *ia64_info, + asection *sec, boolean create)); +static boolean count_dyn_reloc + PARAMS ((bfd *abfd, struct elf64_ia64_dyn_sym_info *dyn_i, + asection *srel, int type)); +static boolean elf64_ia64_check_relocs + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs)); +static boolean elf64_ia64_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); +static unsigned long global_sym_index + PARAMS ((struct elf_link_hash_entry *h)); +static boolean allocate_fptr + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_data_got + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_fptr_got + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_local_got + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_pltoff_entries + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt_entries + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt2_entries + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_dynrel_entries + PARAMS ((struct elf64_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean elf64_ia64_size_dynamic_sections + PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); +static bfd_reloc_status_type elf64_ia64_install_value + PARAMS ((bfd *abfd, bfd_byte *hit_addr, bfd_vma val, unsigned int r_type)); +static void elf64_ia64_install_dyn_reloc + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + asection *srel, bfd_vma offset, unsigned int type, + long dynindx, bfd_vma addend)); +static bfd_vma set_got_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_dyn_sym_info *dyn_i, long dynindx, + bfd_vma addend, bfd_vma value, unsigned int dyn_r_type)); +static bfd_vma set_fptr_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_dyn_sym_info *dyn_i, + bfd_vma value)); +static bfd_vma set_pltoff_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elf64_ia64_dyn_sym_info *dyn_i, + bfd_vma value, boolean)); +static boolean elf64_ia64_final_link + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static boolean elf64_ia64_relocate_section + PARAMS ((bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, + asection *input_section, bfd_byte *contents, + Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, + asection **local_sections)); +static boolean elf64_ia64_finish_dynamic_symbol + PARAMS ((bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); +static boolean elf64_ia64_finish_dynamic_sections + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static boolean elf64_ia64_set_private_flags + PARAMS ((bfd *abfd, flagword flags)); +static boolean elf64_ia64_copy_private_bfd_data + PARAMS ((bfd *ibfd, bfd *obfd)); +static boolean elf64_ia64_merge_private_bfd_data + PARAMS ((bfd *ibfd, bfd *obfd)); +static boolean elf64_ia64_print_private_bfd_data + PARAMS ((bfd *abfd, PTR ptr)); + + +/* ia64-specific relocation */ + +/* Perform a relocation. Not much to do here as all the hard work is + done in elf64_ia64_final_link_relocate. */ +static bfd_reloc_status_type +elf64_ia64_reloc (abfd, reloc, sym, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc; + asymbol *sym; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + if (output_bfd) + { + reloc->address += input_section->output_offset; + return bfd_reloc_ok; + } + *error_message = "Unsupported call to elf64_ia64_reloc"; + return bfd_reloc_notsupported; +} + +#define IA64_HOWTO(TYPE, NAME, SIZE, PCREL, IN) \ + HOWTO (TYPE, 0, SIZE, 0, PCREL, 0, complain_overflow_signed, \ + elf64_ia64_reloc, NAME, false, 0, 0, IN) + +/* This table has to be sorted according to increasing number of the + TYPE field. */ +static reloc_howto_type ia64_howto_table[] = + { + IA64_HOWTO (R_IA64_NONE, "NONE", 0, false, true), + + IA64_HOWTO (R_IA64_IMM14, "IMM14", 0, false, true), + IA64_HOWTO (R_IA64_IMM22, "IMM22", 0, false, true), + IA64_HOWTO (R_IA64_IMM64, "IMM64", 0, false, true), + IA64_HOWTO (R_IA64_DIR32MSB, "DIR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR32LSB, "DIR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR64MSB, "DIR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_DIR64LSB, "DIR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_GPREL22, "GPREL22", 0, false, true), + IA64_HOWTO (R_IA64_GPREL64I, "GPREL64I", 0, false, true), + IA64_HOWTO (R_IA64_GPREL32MSB, "GPREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL32LSB, "GPREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL64MSB, "GPREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_GPREL64LSB, "GPREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTOFF22, "LTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF64I, "LTOFF64I", 0, false, true), + + IA64_HOWTO (R_IA64_PLTOFF22, "PLTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64I, "PLTOFF64I", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64MSB, "PLTOFF64MSB", 4, false, true), + IA64_HOWTO (R_IA64_PLTOFF64LSB, "PLTOFF64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_FPTR64I, "FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_FPTR32MSB, "FPTR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR32LSB, "FPTR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR64MSB, "FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_FPTR64LSB, "FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL60B, "PCREL60B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21B, "PCREL21B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21M, "PCREL21M", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21F, "PCREL21F", 0, true, true), + IA64_HOWTO (R_IA64_PCREL32MSB, "PCREL32MSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL32LSB, "PCREL32LSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL64MSB, "PCREL64MSB", 4, true, true), + IA64_HOWTO (R_IA64_PCREL64LSB, "PCREL64LSB", 4, true, true), + + IA64_HOWTO (R_IA64_LTOFF_FPTR22, "LTOFF_FPTR22", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64I, "LTOFF_FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SEGBASE, "SEGBASE", 4, false, true), + IA64_HOWTO (R_IA64_SEGREL32MSB, "SEGREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL32LSB, "SEGREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL64MSB, "SEGREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SEGREL64LSB, "SEGREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SECREL32MSB, "SECREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL32LSB, "SECREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL64MSB, "SECREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SECREL64LSB, "SECREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_REL32MSB, "REL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_REL32LSB, "REL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_REL64MSB, "REL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_REL64LSB, "REL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTV32MSB, "LTV32MSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV32LSB, "LTV32LSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV64MSB, "LTV64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTV64LSB, "LTV64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL21BI, "PCREL21BI", 0, true, true), + IA64_HOWTO (R_IA64_PCREL22, "PCREL22", 0, true, true), + IA64_HOWTO (R_IA64_PCREL64I, "PCREL64I", 0, true, true), + + IA64_HOWTO (R_IA64_IPLTMSB, "IPLTMSB", 4, false, true), + IA64_HOWTO (R_IA64_IPLTLSB, "IPLTLSB", 4, false, true), + IA64_HOWTO (R_IA64_EPLTMSB, "EPLTMSB", 4, false, true), + IA64_HOWTO (R_IA64_EPLTLSB, "EPLTLSB", 4, false, true), + IA64_HOWTO (R_IA64_COPY, "COPY", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF22X, "LTOFF22X", 0, false, true), + IA64_HOWTO (R_IA64_LDXMOV, "LDXMOV", 0, false, true), + + IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, false, false), + IA64_HOWTO (R_IA64_TPREL64MSB, "TPREL64MSB", 8, false, false), + IA64_HOWTO (R_IA64_TPREL64LSB, "TPREL64LSB", 8, false, false), + IA64_HOWTO (R_IA64_LTOFF_TP22, "LTOFF_TP22", 0, false, false), + }; + +static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1]; + +/* Given a BFD reloc type, return the matching HOWTO structure. */ + +static reloc_howto_type* +lookup_howto (rtype) + unsigned int rtype; +{ + static int inited = 0; + int i; + + if (!inited) + { + inited = 1; + + memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index)); + for (i = 0; i < NELEMS (ia64_howto_table); ++i) + elf_code_to_howto_index[ia64_howto_table[i].type] = i; + } + + BFD_ASSERT (rtype <= R_IA64_MAX_RELOC_CODE); + i = elf_code_to_howto_index[rtype]; + if (i >= NELEMS (ia64_howto_table)) + return 0; + return ia64_howto_table + i; +} + +static reloc_howto_type* +elf64_ia64_reloc_type_lookup (abfd, bfd_code) + bfd *abfd; + bfd_reloc_code_real_type bfd_code; +{ + unsigned int rtype; + + switch (bfd_code) + { + case BFD_RELOC_NONE: rtype = R_IA64_NONE; break; + + case BFD_RELOC_IA64_IMM14: rtype = R_IA64_IMM14; break; + case BFD_RELOC_IA64_IMM22: rtype = R_IA64_IMM22; break; + case BFD_RELOC_IA64_IMM64: rtype = R_IA64_IMM64; break; + + case BFD_RELOC_IA64_DIR32MSB: rtype = R_IA64_DIR32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: rtype = R_IA64_DIR32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: rtype = R_IA64_DIR64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: rtype = R_IA64_DIR64LSB; break; + + case BFD_RELOC_IA64_GPREL22: rtype = R_IA64_GPREL22; break; + case BFD_RELOC_IA64_GPREL64I: rtype = R_IA64_GPREL64I; break; + case BFD_RELOC_IA64_GPREL32MSB: rtype = R_IA64_GPREL32MSB; break; + case BFD_RELOC_IA64_GPREL32LSB: rtype = R_IA64_GPREL32LSB; break; + case BFD_RELOC_IA64_GPREL64MSB: rtype = R_IA64_GPREL64MSB; break; + case BFD_RELOC_IA64_GPREL64LSB: rtype = R_IA64_GPREL64LSB; break; + + case BFD_RELOC_IA64_LTOFF22: rtype = R_IA64_LTOFF22; break; + case BFD_RELOC_IA64_LTOFF64I: rtype = R_IA64_LTOFF64I; break; + + case BFD_RELOC_IA64_PLTOFF22: rtype = R_IA64_PLTOFF22; break; + case BFD_RELOC_IA64_PLTOFF64I: rtype = R_IA64_PLTOFF64I; break; + case BFD_RELOC_IA64_PLTOFF64MSB: rtype = R_IA64_PLTOFF64MSB; break; + case BFD_RELOC_IA64_PLTOFF64LSB: rtype = R_IA64_PLTOFF64LSB; break; + case BFD_RELOC_IA64_FPTR64I: rtype = R_IA64_FPTR64I; break; + case BFD_RELOC_IA64_FPTR32MSB: rtype = R_IA64_FPTR32MSB; break; + case BFD_RELOC_IA64_FPTR32LSB: rtype = R_IA64_FPTR32LSB; break; + case BFD_RELOC_IA64_FPTR64MSB: rtype = R_IA64_FPTR64MSB; break; + case BFD_RELOC_IA64_FPTR64LSB: rtype = R_IA64_FPTR64LSB; break; + + case BFD_RELOC_IA64_PCREL21B: rtype = R_IA64_PCREL21B; break; + case BFD_RELOC_IA64_PCREL21BI: rtype = R_IA64_PCREL21BI; break; + case BFD_RELOC_IA64_PCREL21M: rtype = R_IA64_PCREL21M; break; + case BFD_RELOC_IA64_PCREL21F: rtype = R_IA64_PCREL21F; break; + case BFD_RELOC_IA64_PCREL22: rtype = R_IA64_PCREL22; break; + case BFD_RELOC_IA64_PCREL60B: rtype = R_IA64_PCREL60B; break; + case BFD_RELOC_IA64_PCREL64I: rtype = R_IA64_PCREL64I; break; + case BFD_RELOC_IA64_PCREL32MSB: rtype = R_IA64_PCREL32MSB; break; + case BFD_RELOC_IA64_PCREL32LSB: rtype = R_IA64_PCREL32LSB; break; + case BFD_RELOC_IA64_PCREL64MSB: rtype = R_IA64_PCREL64MSB; break; + case BFD_RELOC_IA64_PCREL64LSB: rtype = R_IA64_PCREL64LSB; break; + + case BFD_RELOC_IA64_LTOFF_FPTR22: rtype = R_IA64_LTOFF_FPTR22; break; + case BFD_RELOC_IA64_LTOFF_FPTR64I: rtype = R_IA64_LTOFF_FPTR64I; break; + case BFD_RELOC_IA64_LTOFF_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break; + case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break; + + case BFD_RELOC_IA64_SEGBASE: rtype = R_IA64_SEGBASE; break; + case BFD_RELOC_IA64_SEGREL32MSB: rtype = R_IA64_SEGREL32MSB; break; + case BFD_RELOC_IA64_SEGREL32LSB: rtype = R_IA64_SEGREL32LSB; break; + case BFD_RELOC_IA64_SEGREL64MSB: rtype = R_IA64_SEGREL64MSB; break; + case BFD_RELOC_IA64_SEGREL64LSB: rtype = R_IA64_SEGREL64LSB; break; + + case BFD_RELOC_IA64_SECREL32MSB: rtype = R_IA64_SECREL32MSB; break; + case BFD_RELOC_IA64_SECREL32LSB: rtype = R_IA64_SECREL32LSB; break; + case BFD_RELOC_IA64_SECREL64MSB: rtype = R_IA64_SECREL64MSB; break; + case BFD_RELOC_IA64_SECREL64LSB: rtype = R_IA64_SECREL64LSB; break; + + case BFD_RELOC_IA64_REL32MSB: rtype = R_IA64_REL32MSB; break; + case BFD_RELOC_IA64_REL32LSB: rtype = R_IA64_REL32LSB; break; + case BFD_RELOC_IA64_REL64MSB: rtype = R_IA64_REL64MSB; break; + case BFD_RELOC_IA64_REL64LSB: rtype = R_IA64_REL64LSB; break; + + case BFD_RELOC_IA64_LTV32MSB: rtype = R_IA64_LTV32MSB; break; + case BFD_RELOC_IA64_LTV32LSB: rtype = R_IA64_LTV32LSB; break; + case BFD_RELOC_IA64_LTV64MSB: rtype = R_IA64_LTV64MSB; break; + case BFD_RELOC_IA64_LTV64LSB: rtype = R_IA64_LTV64LSB; break; + + case BFD_RELOC_IA64_IPLTMSB: rtype = R_IA64_IPLTMSB; break; + case BFD_RELOC_IA64_IPLTLSB: rtype = R_IA64_IPLTLSB; break; + case BFD_RELOC_IA64_EPLTMSB: rtype = R_IA64_EPLTMSB; break; + case BFD_RELOC_IA64_EPLTLSB: rtype = R_IA64_EPLTLSB; break; + case BFD_RELOC_IA64_COPY: rtype = R_IA64_COPY; break; + case BFD_RELOC_IA64_LTOFF22X: rtype = R_IA64_LTOFF22X; break; + case BFD_RELOC_IA64_LDXMOV: rtype = R_IA64_LDXMOV; break; + + case BFD_RELOC_IA64_TPREL22: rtype = R_IA64_TPREL22; break; + case BFD_RELOC_IA64_TPREL64MSB: rtype = R_IA64_TPREL64MSB; break; + case BFD_RELOC_IA64_TPREL64LSB: rtype = R_IA64_TPREL64LSB; break; + case BFD_RELOC_IA64_LTOFF_TP22: rtype = R_IA64_LTOFF_TP22; break; + + default: return 0; + } + return lookup_howto (rtype); +} + +/* Given a ELF reloc, return the matching HOWTO structure. */ + +static void +elf64_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) + bfd *abfd; + arelent *bfd_reloc; + Elf64_Internal_Rela *elf_reloc; +{ + bfd_reloc->howto = lookup_howto (ELF64_R_TYPE (elf_reloc->r_info)); +} + +#define PLT_HEADER_SIZE (3 * 16) +#define PLT_MIN_ENTRY_SIZE (1 * 16) +#define PLT_FULL_ENTRY_SIZE (2 * 16) +#define PLT_RESERVED_WORDS 3 + +static const bfd_byte plt_header[PLT_HEADER_SIZE] = +{ + 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */ + 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */ + 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */ + 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] = +{ + 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */ + 0x00, 0x00, 0x00, 0x40 /* br.few 0 ;; */ +}; + +static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = +{ + 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */ + 0x00, 0x41, 0x3c, 0x30, 0x28, 0xc0, /* ld8 r16=[r15],8 */ + 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */ + 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* Select out of range branch fixup type. Note that Itanium does + not support brl, and so it gets emulated by the kernel. */ +#undef USE_BRL + +static const bfd_byte oor_brl[16] = +{ + 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */ + 0x00, 0x00, 0x00, 0xc0 +}; + +static const bfd_byte oor_ip[48] = +{ + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */ + 0x01, 0x00, 0x00, 0x60, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */ + 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */ + 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */ + 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br b6;; */ +}; + +/* These functions do relaxation for IA-64 ELF. + + This is primarily to support branches to targets out of range; + relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV not yet supported. */ + +static boolean +elf64_ia64_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + struct one_fixup + { + struct one_fixup *next; + asection *tsec; + bfd_vma toff; + bfd_vma trampoff; + }; + + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents; + bfd_byte *free_contents; + Elf64_External_Sym *extsyms; + Elf64_External_Sym *free_extsyms; + struct elf64_ia64_link_hash_table *ia64_info; + struct one_fixup *fixups = NULL; + boolean changed_contents = false; + boolean changed_relocs = false; + + /* Assume we're not going to change any sizes, and we we'll only + need one pass. */ + *again = false; + + /* Nothing to do if there are no relocations. */ + if ((sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0) + return true; + + /* If this is the first time we have been called for this section, + initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Load the relocations for this section. */ + internal_relocs = (_bfd_elf64_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + free_relocs = NULL; + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + ia64_info = elf64_ia64_hash_table (link_info); + irelend = internal_relocs + sec->reloc_count; + + for (irel = internal_relocs; irel < irelend; irel++) + if (ELF64_R_TYPE (irel->r_info) == (int) R_IA64_PCREL21B) + break; + + /* No branch-type relocations. */ + if (irel == irelend) + { + if (free_relocs != NULL) + free (free_relocs); + return true; + } + + /* Get the section contents. */ + free_contents = NULL; + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + + /* Read this BFD's symbols. */ + free_extsyms = NULL; + if (symtab_hdr->contents != NULL) + extsyms = (Elf64_External_Sym *) symtab_hdr->contents; + else + { + extsyms = (Elf64_External_Sym *) bfd_malloc (symtab_hdr->sh_size); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) + != symtab_hdr->sh_size)) + goto error_return; + } + + for (; irel < irelend; irel++) + { + bfd_vma symaddr, reladdr, trampoff, toff, roff; + Elf_Internal_Sym isym; + asection *tsec; + struct one_fixup *f; + + if (ELF64_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B) + continue; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + bfd_elf64_swap_symbol_in (abfd, + extsyms + ELF64_R_SYM (irel->r_info), + &isym); + if (isym.st_shndx == SHN_UNDEF) + continue; /* We can't do anthing with undefined symbols. */ + else if (isym.st_shndx == SHN_ABS) + tsec = bfd_abs_section_ptr; + else if (isym.st_shndx == SHN_COMMON) + tsec = bfd_com_section_ptr; + else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE) + tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + else + continue; /* who knows. */ + + toff = isym.st_value; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + + indx = ELF64_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, irel, false); + + /* For branches to dynamic symbols, we're interested instead + in a branch to the PLT entry. */ + if (dyn_i && dyn_i->want_plt2) + { + tsec = ia64_info->plt_sec; + toff = dyn_i->plt2_offset; + } + else + { + /* We can't do anthing with undefined symbols. */ + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + continue; + + tsec = h->root.u.def.section; + toff = h->root.u.def.value; + } + } + + symaddr = (tsec->output_section->vma + + tsec->output_offset + + toff + + irel->r_addend); + + roff = irel->r_offset; + reladdr = (sec->output_section->vma + + sec->output_offset + + roff) & -4; + + /* If the branch is in range, no need to do anything. */ + if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 + && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) + continue; + + /* If the branch and target are in the same section, you've + got one honking big section and we can't help you. You'll + get an error message later. */ + if (tsec == sec) + continue; + + /* Look for an existing fixup to this address. */ + for (f = fixups; f ; f = f->next) + if (f->tsec == tsec && f->toff == toff) + break; + + if (f == NULL) + { + /* Two alternatives: If it's a branch to a PLT entry, we can + make a copy of the FULL_PLT entry. Otherwise, we'll have + to use a `brl' insn to get where we're going. */ + + int size; + + if (tsec == ia64_info->plt_sec) + size = sizeof (plt_full_entry); + else + { +#ifdef USE_BRL + size = sizeof (oor_brl); +#else + size = sizeof (oor_ip); +#endif + } + + /* Resize the current section to make room for the new branch. */ + trampoff = (sec->_cooked_size + 15) & -16; + contents = (bfd_byte *) bfd_realloc (contents, trampoff + size); + if (contents == NULL) + goto error_return; + sec->_cooked_size = trampoff + size; + + if (tsec == ia64_info->plt_sec) + { + memcpy (contents + trampoff, plt_full_entry, size); + + /* Hijack the old relocation for use as the PLTOFF reloc. */ + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_IA64_PLTOFF22); + irel->r_offset = trampoff; + } + else + { +#ifdef USE_BRL + memcpy (contents + trampoff, oor_brl, size); + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_IA64_PCREL60B); + irel->r_offset = trampoff + 2; +#else + memcpy (contents + trampoff, oor_ip, size); + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_IA64_PCREL64I); + irel->r_addend -= 16; + irel->r_offset = trampoff + 2; +#endif + } + + /* Record the fixup so we don't do it again this section. */ + f = (struct one_fixup *) bfd_malloc (sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; + } + else + { + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELF64_R_INFO (0, R_IA64_NONE); + } + + /* Fix up the existing branch to hit the trampoline. Hope like + hell this doesn't overflow too. */ + if (elf64_ia64_install_value (abfd, contents + roff, + f->trampoff - (roff & -4), + R_IA64_PCREL21B) != bfd_reloc_ok) + goto error_return; + + changed_contents = true; + changed_relocs = true; + } + + /* Clean up and go home. */ + while (fixups) + { + struct one_fixup *f = fixups; + fixups = fixups->next; + free (f); + } + + if (changed_relocs) + elf_section_data (sec)->relocs = internal_relocs; + else if (free_relocs != NULL) + free (free_relocs); + + if (changed_contents) + elf_section_data (sec)->this_hdr.contents = contents; + else if (free_contents != NULL) + { + if (! link_info->keep_memory) + free (free_contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (free_extsyms != NULL) + { + if (! link_info->keep_memory) + free (free_extsyms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = extsyms; + } + } + + *again = changed_contents || changed_relocs; + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + if (free_contents != NULL) + free (free_contents); + if (free_extsyms != NULL) + free (free_extsyms); + return false; +} + +/* Handle an IA-64 specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static boolean +elf64_ia64_section_from_shdr (abfd, hdr, name) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + + /* There ought to be a place to keep ELF backend specific flags, but + at the moment there isn't one. We just keep track of the + sections by their name, instead. Fortunately, the ABI gives + suggested names for all the MIPS specific sections, so we will + probably get away with this. */ + switch (hdr->sh_type) + { + case SHT_IA_64_UNWIND: + if (strcmp (name, ELF_STRING_ia64_unwind) != 0) + return false; + break; + + case SHT_IA_64_EXT: + if (strcmp (name, ELF_STRING_ia64_archext) != 0) + return false; + break; + + default: + return false; + } + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + newsect = hdr->bfd_section; + + if (hdr->sh_flags & SHF_IA_64_SHORT) + newsect->flags |= SEC_SMALL_DATA; + + return true; +} + +/* Set the correct type for an IA-64 ELF section. We do this by the + section name, which is a hack, but ought to work. */ + +static boolean +elf64_ia64_fake_sections (abfd, hdr, sec) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + asection *sec; +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ELF_STRING_ia64_unwind) == 0) + hdr->sh_type = SHT_IA_64_UNWIND; + else if (strcmp (name, ELF_STRING_ia64_archext) == 0) + hdr->sh_type = SHT_IA_64_EXT; + else if (strcmp (name, ".reloc") == 0) + /* + * This is an ugly, but unfortunately necessary hack that is + * needed when producing EFI binaries on IA-64. It tells + * elf.c:elf_fake_sections() not to consider ".reloc" as a section + * containing ELF relocation info. We need this hack in order to + * be able to generate ELF binaries that can be translated into + * EFI applications (which are essentially COFF objects). Those + * files contain a COFF ".reloc" section inside an ELF64 object, + * which would normally cause BFD to segfault because it would + * attempt to interpret this section as containing relocation + * entries for section "oc". With this hack enabled, ".reloc" + * will be treated as a normal data section, which will avoid the + * segfault. However, you won't be able to create an ELF64 binary + * with a section named "oc" that needs relocations, but that's + * the kind of ugly side-effects you get when detecting section + * types based on their names... In practice, this limitation is + * unlikely to bite. + */ + hdr->sh_type = SHT_PROGBITS; + + if (sec->flags & SEC_SMALL_DATA) + hdr->sh_flags |= SHF_IA_64_SHORT; + + return true; +} + +/* Hook called by the linker routine which adds symbols from an object + file. We use it to put .comm items in .sbss, and not .bss. */ + +static boolean +elf64_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) + bfd *abfd; + struct bfd_link_info *info; + const Elf_Internal_Sym *sym; + const char **namep; + flagword *flagsp; + asection **secp; + bfd_vma *valp; +{ + if (sym->st_shndx == SHN_COMMON + && !info->relocateable + && sym->st_size <= bfd_get_gp_size (abfd)) + { + /* Common symbols less than or equal to -G nn bytes are + automatically put into .sbss. */ + + asection *scomm = bfd_get_section_by_name (abfd, ".scommon"); + + if (scomm == NULL) + { + scomm = bfd_make_section (abfd, ".scommon"); + if (scomm == NULL + || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC + | SEC_IS_COMMON + | SEC_LINKER_CREATED))) + return false; + } + + *secp = scomm; + *valp = sym->st_size; + } + + return true; +} + +/* Return the number of additional phdrs we will need. */ + +static int +elf64_ia64_additional_program_headers (abfd) + bfd *abfd; +{ + asection *s; + int ret = 0; + + /* See if we need a PT_IA_64_ARCHEXT segment. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + if (s && (s->flags & SEC_LOAD)) + ++ret; + + /* See if we need a PT_IA_64_UNWIND segment. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); + if (s && (s->flags & SEC_LOAD)) + ++ret; + + return ret; +} + +static boolean +elf64_ia64_modify_segment_map (abfd) + bfd *abfd; +{ + struct elf_segment_map *m, **pm; + asection *s; + + /* If we need a PT_IA_64_ARCHEXT segment, it must come before + all PT_LOAD segments. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + if (s && (s->flags & SEC_LOAD)) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_IA_64_ARCHEXT) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_ARCHEXT; + m->count = 1; + m->sections[0] = s; + + /* We want to put it after the PHDR and INTERP segments. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL + && ((*pm)->p_type == PT_PHDR + || (*pm)->p_type == PT_INTERP)) + pm = &(*pm)->next; + + m->next = *pm; + *pm = m; + } + } + + /* Install the PT_IA_64_UNWIND segment, if needed. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); + if (s && (s->flags & SEC_LOAD)) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_IA_64_UNWIND) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_UNWIND; + m->count = 1; + m->sections[0] = s; + m->next = NULL; + + /* We want to put it last. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL) + pm = &(*pm)->next; + *pm = m; + } + } + + /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + { + int i; + for (i = m->count - 1; i >= 0; --i) + { + struct bfd_link_order *order = m->sections[i]->link_order_head; + while (order) + { + if (order->type == bfd_indirect_link_order) + { + asection *is = order->u.indirect.section; + bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; + if (flags & SHF_IA_64_NORECOV) + { + m->p_flags |= PF_IA_64_NORECOV; + goto found; + } + } + order = order->next; + } + } + found:; + } + + return true; +} + + +/* According to the Tahoe assembler spec, all labels starting with a + '.' are local. */ + +static boolean +elf64_ia64_is_local_label_name (abfd, name) + bfd *abfd; + const char *name; +{ + return name[0] == '.'; +} + +/* Should we do dynamic things to this symbol? */ + +static boolean +elf64_ia64_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx == -1) + return false; + + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + return true; + + if ((info->shared && !info->symbolic) + || ((h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) + == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) + return true; + + return false; +} + +static boolean +elf64_ia64_local_hash_table_init (ht, abfd, new) + struct elf64_ia64_local_hash_table *ht; + bfd *abfd; + new_hash_entry_func new; +{ + memset (ht, 0, sizeof(*ht)); + return bfd_hash_table_init (&ht->root, new); +} + +static struct bfd_hash_entry* +elf64_ia64_new_loc_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf64_ia64_local_hash_entry *ret; + ret = (struct elf64_ia64_local_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof(*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elf64_ia64_local_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static struct bfd_hash_entry* +elf64_ia64_new_elf_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf64_ia64_link_hash_entry *ret; + ret = (struct elf64_ia64_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof(*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elf64_ia64_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static void +elf64_ia64_hash_copy_indirect (xdir, xind) + struct elf_link_hash_entry *xdir, *xind; +{ + struct elf64_ia64_link_hash_entry *dir, *ind; + + dir = (struct elf64_ia64_link_hash_entry *)xdir; + ind = (struct elf64_ia64_link_hash_entry *)xind; + + /* Copy down any references that we may have already seen to the + symbol which just became indirect. */ + + dir->root.elf_link_hash_flags |= + (ind->root.elf_link_hash_flags + & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + + /* Copy over the got and plt data. This would have been done + by check_relocs. */ + + if (dir->info == NULL) + { + struct elf64_ia64_dyn_sym_info *dyn_i; + + dir->info = dyn_i = ind->info; + ind->info = NULL; + + /* Fix up the dyn_sym_info pointers to the global symbol. */ + for (; dyn_i; dyn_i = dyn_i->next) + dyn_i->h = &dir->root; + } + BFD_ASSERT (ind->info == NULL); + + /* Copy over the dynindx. */ + + if (dir->root.dynindx == -1) + { + dir->root.dynindx = ind->root.dynindx; + dir->root.dynstr_index = ind->root.dynstr_index; + ind->root.dynindx = -1; + ind->root.dynstr_index = 0; + } + BFD_ASSERT (ind->root.dynindx == -1); +} + +static void +elf64_ia64_hash_hide_symbol (xh) + struct elf_link_hash_entry *xh; +{ + struct elf64_ia64_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + + h = (struct elf64_ia64_link_hash_entry *)xh; + + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + h->root.dynindx = -1; + + for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) + dyn_i->want_plt2 = 0; +} + +/* Create the derived linker hash table. The IA-64 ELF port uses this + derived hash table to keep information specific to the IA-64 ElF + linker (without using static variables). */ + +static struct bfd_link_hash_table* +elf64_ia64_hash_table_create (abfd) + bfd *abfd; +{ + struct elf64_ia64_link_hash_table *ret; + + ret = bfd_alloc (abfd, sizeof (*ret)); + if (!ret) + return 0; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + elf64_ia64_new_elf_hash_entry)) + { + bfd_release (abfd, ret); + return 0; + } + + if (!elf64_ia64_local_hash_table_init (&ret->loc_hash_table, abfd, + elf64_ia64_new_loc_hash_entry)) + return 0; + return &ret->root.root; +} + +/* Look up an entry in a Alpha ELF linker hash table. */ + +static INLINE struct elf64_ia64_local_hash_entry * +elf64_ia64_local_hash_lookup(table, string, create, copy) + struct elf64_ia64_local_hash_table *table; + const char *string; + boolean create, copy; +{ + return ((struct elf64_ia64_local_hash_entry *) + bfd_hash_lookup (&table->root, string, create, copy)); +} + +/* Traverse both local and global hash tables. */ + +struct elf64_ia64_dyn_sym_traverse_data +{ + boolean (*func) PARAMS ((struct elf64_ia64_dyn_sym_info *, PTR)); + PTR data; +}; + +static boolean +elf64_ia64_global_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elf64_ia64_link_hash_entry *entry + = (struct elf64_ia64_link_hash_entry *) xentry; + struct elf64_ia64_dyn_sym_traverse_data *data + = (struct elf64_ia64_dyn_sym_traverse_data *) xdata; + struct elf64_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static boolean +elf64_ia64_local_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elf64_ia64_local_hash_entry *entry + = (struct elf64_ia64_local_hash_entry *) xentry; + struct elf64_ia64_dyn_sym_traverse_data *data + = (struct elf64_ia64_dyn_sym_traverse_data *) xdata; + struct elf64_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static void +elf64_ia64_dyn_sym_traverse (ia64_info, func, data) + struct elf64_ia64_link_hash_table *ia64_info; + boolean (*func) PARAMS ((struct elf64_ia64_dyn_sym_info *, PTR)); + PTR data; +{ + struct elf64_ia64_dyn_sym_traverse_data xdata; + + xdata.func = func; + xdata.data = data; + + elf_link_hash_traverse (&ia64_info->root, + elf64_ia64_global_dyn_sym_thunk, &xdata); + bfd_hash_traverse (&ia64_info->loc_hash_table.root, + elf64_ia64_local_dyn_sym_thunk, &xdata); +} + +static boolean +elf64_ia64_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elf64_ia64_link_hash_table *ia64_info; + struct elf_link_hash_entry *h; + asection *s; + + if (! _bfd_elf_create_dynamic_sections (abfd, info)) + return false; + + ia64_info = elf64_ia64_hash_table (info); + + ia64_info->plt_sec = bfd_get_section_by_name (abfd, ".plt"); + ia64_info->got_sec = bfd_get_section_by_name (abfd, ".got"); + + { + flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec); + bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags); + } + + if (!get_pltoff (abfd, info, ia64_info)) + return false; + + s = bfd_make_section(abfd, ".rela.IA_64.pltoff"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_pltoff_sec = s; + + s = bfd_make_section(abfd, ".rela.got"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_got_sec = s; + + return true; +} + +/* Find and/or create a descriptor for dynamic symbol info. This will + vary based on global or local symbol, and the addend to the reloc. */ + +static struct elf64_ia64_dyn_sym_info * +get_dyn_sym_info (ia64_info, h, abfd, rel, create) + struct elf64_ia64_link_hash_table *ia64_info; + struct elf_link_hash_entry *h; + bfd *abfd; + const Elf_Internal_Rela *rel; + boolean create; +{ + struct elf64_ia64_dyn_sym_info **pp; + struct elf64_ia64_dyn_sym_info *dyn_i; + bfd_vma addend = rel ? rel->r_addend : 0; + + if (h) + pp = &((struct elf64_ia64_link_hash_entry *)h)->info; + else + { + struct elf64_ia64_local_hash_entry *loc_h; + char *addr_name; + size_t len; + + /* Construct a string for use in the elf64_ia64_local_hash_table. + The name describes what was once anonymous memory. */ + + len = sizeof(void*)*2 + 1 + sizeof(bfd_vma)*4 + 1 + 1; + len += 10; /* %p slop */ + + addr_name = alloca (len); + sprintf (addr_name, "%p:%lx", abfd, ELF64_R_SYM (rel->r_info)); + + /* Collect the canonical entry data for this address. */ + loc_h = elf64_ia64_local_hash_lookup (&ia64_info->loc_hash_table, + addr_name, create, create); + BFD_ASSERT (loc_h); + + pp = &loc_h->info; + } + + for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp) + pp = &dyn_i->next; + + if (dyn_i == NULL && create) + { + dyn_i = (struct elf64_ia64_dyn_sym_info *) + bfd_zalloc (abfd, sizeof *dyn_i); + *pp = dyn_i; + dyn_i->addend = addend; + } + + return dyn_i; +} + +static asection * +get_got (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_link_hash_table *ia64_info; +{ + asection *got, *srel; + bfd *dynobj; + + got = ia64_info->got_sec; + if (!got) + { + flagword flags; + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return 0; + + got = bfd_get_section_by_name (dynobj, ".got"); + BFD_ASSERT (got); + ia64_info->got_sec = got; + + flags = bfd_get_section_flags (abfd, got); + bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags); + } + + return got; +} + +/* Create function descriptor section (.opd). This section is called .opd + because it contains "official prodecure descriptors". The "official" + refers to the fact that these descriptors are used when taking the address + of a procedure, thus ensuring a unique address for each procedure. */ + +static asection * +get_fptr (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_link_hash_table *ia64_info; +{ + asection *fptr; + bfd *dynobj; + + fptr = ia64_info->fptr_sec; + if (!fptr) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + fptr = bfd_make_section (dynobj, ".opd"); + if (!fptr + || !bfd_set_section_flags (dynobj, fptr, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, fptr, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->fptr_sec = fptr; + } + + return fptr; +} + +static asection * +get_pltoff (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_link_hash_table *ia64_info; +{ + asection *pltoff; + bfd *dynobj; + + pltoff = ia64_info->pltoff_sec; + if (!pltoff) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + pltoff = bfd_make_section (dynobj, ELF_STRING_ia64_pltoff); + if (!pltoff + || !bfd_set_section_flags (dynobj, pltoff, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_SMALL_DATA + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, pltoff, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->pltoff_sec = pltoff; + } + + return pltoff; +} + +static asection * +get_reloc_section (abfd, ia64_info, sec, create) + bfd *abfd; + struct elf64_ia64_link_hash_table *ia64_info; + asection *sec; + boolean create; +{ + const char *srel_name; + asection *srel; + bfd *dynobj; + + srel_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (srel_name == NULL) + return NULL; + + BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+5) == 0) + || (strncmp (srel_name, ".rel", 4) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+4) == 0)); + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + srel = bfd_get_section_by_name (dynobj, srel_name); + if (srel == NULL && create) + { + srel = bfd_make_section (dynobj, srel_name); + if (srel == NULL + || !bfd_set_section_flags (dynobj, srel, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, srel, 3)) + return NULL; + } + + return srel; +} + +static boolean +count_dyn_reloc (abfd, dyn_i, srel, type) + bfd *abfd; + struct elf64_ia64_dyn_sym_info *dyn_i; + asection *srel; + int type; +{ + struct elf64_ia64_dyn_reloc_entry *rent; + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + if (rent->srel == srel && rent->type == type) + break; + + if (!rent) + { + rent = (struct elf64_ia64_dyn_reloc_entry *) + bfd_alloc (abfd, sizeof (*rent)); + if (!rent) + return false; + + rent->next = dyn_i->reloc_entries; + rent->srel = srel; + rent->type = type; + rent->count = 0; + dyn_i->reloc_entries = rent; + } + rent->count++; + + return true; +} + +static boolean +elf64_ia64_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct elf64_ia64_link_hash_table *ia64_info; + const Elf_Internal_Rela *relend; + Elf_Internal_Shdr *symtab_hdr; + const Elf_Internal_Rela *rel; + asection *got, *fptr, *srel; + + if (info->relocateable) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + ia64_info = elf64_ia64_hash_table (info); + + got = fptr = srel = NULL; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_GOT = 1, + NEED_FPTR = 2, + NEED_PLTOFF = 4, + NEED_MIN_PLT = 8, + NEED_FULL_PLT = 16, + NEED_DYNREL = 32, + NEED_LTOFF_FPTR = 64, + }; + + struct elf_link_hash_entry *h = NULL; + unsigned long r_symndx = ELF64_R_SYM (rel->r_info); + struct elf64_ia64_dyn_sym_info *dyn_i; + int need_entry; + boolean maybe_dynamic; + int dynrel_type; + + if (r_symndx >= symtab_hdr->sh_info) + { + /* We're dealing with a global symbol -- find its hash entry + and mark it as being referenced. */ + long indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared && ! info->symbolic) + || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + need_entry = 0; + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_IA64_TPREL22: + case R_IA64_TPREL64MSB: + case R_IA64_TPREL64LSB: + case R_IA64_LTOFF_TP22: + return false; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR; + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + if (info->shared || h) + need_entry = NEED_FPTR | NEED_DYNREL; + else + need_entry = NEED_FPTR; + dynrel_type = R_IA64_FPTR64LSB; + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + need_entry = NEED_GOT; + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + need_entry = NEED_PLTOFF; + if (h) + { + if (maybe_dynamic) + need_entry |= NEED_MIN_PLT; + } + else + { + (*info->callbacks->warning) + (info, _("@pltoff reloc against local symbol"), 0, + abfd, 0, 0); + } + break; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* Depending on where this symbol is defined, we may or may not + need a full plt entry. Only skip if we know we'll not need + the entry -- static or symbolic, and the symbol definition + has already been seen. */ + if (maybe_dynamic && rel->r_addend == 0) + need_entry = NEED_FULL_PLT; + break; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Shared objects will always need at least a REL relocation. */ + if (info->shared || maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_DIR64LSB; + break; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + if (maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_PCREL64LSB; + break; + } + + if (!need_entry) + continue; + + if ((need_entry & NEED_FPTR) != 0 + && rel->r_addend) + { + (*info->callbacks->warning) + (info, _("non-zero addend in @fptr reloc"), 0, + abfd, 0, 0); + } + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true); + + /* Record whether or not this is a local symbol. */ + dyn_i->h = h; + + /* Create what's needed. */ + if (need_entry & NEED_GOT) + { + if (!got) + { + got = get_got (abfd, info, ia64_info); + if (!got) + return false; + } + dyn_i->want_got = 1; + } + if (need_entry & NEED_FPTR) + { + if (!fptr) + { + fptr = get_fptr (abfd, info, ia64_info); + if (!fptr) + return false; + } + + /* FPTRs for shared libraries are allocated by the dynamic + linker. Make sure this local symbol will appear in the + dynamic symbol table. */ + if (!h && info->shared) + { + if (! (_bfd_elf64_link_record_local_dynamic_symbol + (info, abfd, r_symndx))) + return false; + } + + dyn_i->want_fptr = 1; + } + if (need_entry & NEED_LTOFF_FPTR) + dyn_i->want_ltoff_fptr = 1; + if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT)) + { + if (!ia64_info->root.dynobj) + ia64_info->root.dynobj = abfd; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + dyn_i->want_plt = 1; + } + if (need_entry & NEED_FULL_PLT) + dyn_i->want_plt2 = 1; + if (need_entry & NEED_PLTOFF) + dyn_i->want_pltoff = 1; + if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC)) + { + if (!srel) + { + srel = get_reloc_section (abfd, ia64_info, sec, true); + if (!srel) + return false; + } + if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type)) + return false; + } + } + + return true; +} + +struct elf64_ia64_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + +/* For cleanliness, and potentially faster dynamic loading, allocate + external GOT entries first. */ + +static boolean +allocate_global_data_got (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_got + && ! dyn_i->want_fptr + && elf64_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Next, allocate all the GOT entries used by LTOFF_FPTR relocs. */ + +static boolean +allocate_global_fptr_got (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_got + && dyn_i->want_fptr + && elf64_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Lastly, allocate all the GOT entries for local data. */ + +static boolean +allocate_local_got (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_got + && ! elf64_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Search for the index of a global symbol in it's defining object file. */ + +static unsigned long +global_sym_index (h) + struct elf_link_hash_entry *h; +{ + struct elf_link_hash_entry **p; + bfd *obj; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + + obj = h->root.u.def.section->owner; + for (p = elf_sym_hashes (obj); *p != h; ++p) + continue; + + return p - elf_sym_hashes (obj) + elf_tdata (obj)->symtab_hdr.sh_info; +} + +/* Allocate function descriptors. We can do these for every function + in a main executable that is not exported. */ + +static boolean +allocate_fptr (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_fptr) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (x->info->shared) + { + if (h && h->dynindx == -1) + { + BFD_ASSERT ((h->root.type == bfd_link_hash_defined) + || (h->root.type == bfd_link_hash_defweak)); + + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, h->root.u.def.section->owner, + global_sym_index (h))) + return false; + } + + dyn_i->want_fptr = 0; + } + else if (h == NULL || h->dynindx == -1) + { + dyn_i->fptr_offset = x->ofs; + x->ofs += 16; + } + else + dyn_i->want_fptr = 0; + } + return true; +} + +/* Allocate all the minimal PLT entries. */ + +static boolean +allocate_plt_entries (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_plt) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT. */ + if (elf64_ia64_dynamic_symbol_p (h, x->info)) + { + bfd_size_type offset = x->ofs; + if (offset == 0) + offset = PLT_HEADER_SIZE; + dyn_i->plt_offset = offset; + x->ofs = offset + PLT_MIN_ENTRY_SIZE; + + dyn_i->want_pltoff = 1; + } + else + { + dyn_i->want_plt = 0; + dyn_i->want_plt2 = 0; + } + } + return true; +} + +/* Allocate all the full PLT entries. */ + +static boolean +allocate_plt2_entries (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_plt2) + { + struct elf_link_hash_entry *h = dyn_i->h; + bfd_size_type ofs = x->ofs; + + dyn_i->plt2_offset = ofs; + x->ofs = ofs + PLT_FULL_ENTRY_SIZE; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + dyn_i->h->plt.offset = ofs; + } + return true; +} + +/* Allocate all the PLTOFF entries requested by relocations and + plt entries. We can't share space with allocated FPTR entries, + because the latter are not necessarily addressable by the GP. + ??? Relaxation might be able to determine that they are. */ + +static boolean +allocate_pltoff_entries (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + + if (dyn_i->want_pltoff) + { + dyn_i->pltoff_offset = x->ofs; + x->ofs += 16; + } + return true; +} + +/* Allocate dynamic relocations for those symbols that turned out + to be dynamic. */ + +static boolean +allocate_dynrel_entries (dyn_i, data) + struct elf64_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elf64_ia64_allocate_data *x = (struct elf64_ia64_allocate_data *)data; + struct elf64_ia64_link_hash_table *ia64_info; + struct elf64_ia64_dyn_reloc_entry *rent; + boolean dynamic_symbol, shared; + + ia64_info = elf64_ia64_hash_table (x->info); + dynamic_symbol = elf64_ia64_dynamic_symbol_p (dyn_i->h, x->info); + shared = x->info->shared; + + /* Take care of the normal data relocations. */ + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + { + switch (rent->type) + { + case R_IA64_FPTR64LSB: + /* Allocate one iff !want_fptr, which by this point will + be true only if we're actually allocating one statically + in the main executable. */ + if (dyn_i->want_fptr) + continue; + break; + case R_IA64_PCREL64LSB: + if (!dynamic_symbol) + continue; + break; + case R_IA64_DIR64LSB: + if (!dynamic_symbol && !shared) + continue; + break; + } + rent->srel->_raw_size += sizeof (Elf64_External_Rela) * rent->count; + } + + /* Take care of the GOT and PLT relocations. */ + + if (((dynamic_symbol || shared) && dyn_i->want_got) + || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1)) + ia64_info->rel_got_sec->_raw_size += sizeof (Elf64_External_Rela); + + if (dyn_i->want_pltoff) + { + bfd_size_type t = 0; + + /* Dynamic symbols get one IPLT relocation. Local symbols in + shared libraries get two REL relocations. Local symbols in + main applications get nothing. */ + if (dynamic_symbol) + t = sizeof (Elf64_External_Rela); + else if (shared) + t = 2 * sizeof (Elf64_External_Rela); + + ia64_info->rel_pltoff_sec->_raw_size += t; + } + + return true; +} + +static boolean +elf64_ia64_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + /* ??? Undefined symbols with PLT entries should be re-defined + to be the PLT entry. */ + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->weakdef != NULL) + { + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; + return true; + } + + /* If this is a reference to a symbol defined by a dynamic object which + is not a function, we might allocate the symbol in our .dynbss section + and allocate a COPY dynamic relocation. + + But IA-64 code is canonically PIC, so as a rule we can avoid this sort + of hackery. */ + + return true; +} + +static boolean +elf64_ia64_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elf64_ia64_allocate_data data; + struct elf64_ia64_link_hash_table *ia64_info; + asection *sec; + bfd *dynobj; + boolean reltext = false; + boolean relplt = false; + + dynobj = elf_hash_table(info)->dynobj; + ia64_info = elf64_ia64_hash_table (info); + BFD_ASSERT(dynobj != NULL); + data.info = info; + + /* Set the contents of the .interp section to the interpreter. */ + if (ia64_info->root.dynamic_sections_created + && !info->shared) + { + sec = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (sec != NULL); + sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; + sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; + } + + /* DT_INIT and DT_FINI get function descriptors not raw code addresses. + Force their symbols to have pltoff entries so we can use those. */ + if (ia64_info->root.dynamic_sections_created) + { + struct elf_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + + if (info->init_function + && (h = elf_link_hash_lookup (elf_hash_table (info), + info->init_function, false, + false, false)) + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true); + dyn_i->want_pltoff = 1; + } + + if (info->fini_function + && (h = elf_link_hash_lookup (elf_hash_table (info), + info->fini_function, false, + false, false)) + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true); + dyn_i->want_pltoff = 1; + } + } + + /* Allocate the GOT entries. */ + + if (ia64_info->got_sec) + { + data.ofs = 0; + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data); + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data); + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data); + ia64_info->got_sec->_raw_size = data.ofs; + } + + /* Allocate the FPTR entries. */ + + if (ia64_info->fptr_sec) + { + data.ofs = 0; + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_fptr, &data); + ia64_info->fptr_sec->_raw_size = data.ofs; + } + + /* Now that we've seen all of the input files, we can decide which + symbols need plt entries. Allocate the minimal PLT entries first. + We do this even though dynamic_sections_created may be false, because + this has the side-effect of clearing want_plt and want_plt2. */ + + data.ofs = 0; + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_plt_entries, &data); + + ia64_info->minplt_entries = 0; + if (data.ofs) + { + ia64_info->minplt_entries + = (data.ofs - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + } + + /* Align the pointer for the plt2 entries. */ + data.ofs = (data.ofs + 31) & -32; + + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data); + if (data.ofs != 0) + { + BFD_ASSERT (ia64_info->root.dynamic_sections_created); + + ia64_info->plt_sec->_raw_size = data.ofs; + + /* If we've got a .plt, we need some extra memory for the dynamic + linker. We stuff these in .got.plt. */ + sec = bfd_get_section_by_name (dynobj, ".got.plt"); + sec->_raw_size = 8 * PLT_RESERVED_WORDS; + } + + /* Allocate the PLTOFF entries. */ + + if (ia64_info->pltoff_sec) + { + data.ofs = 0; + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_pltoff_entries, &data); + ia64_info->pltoff_sec->_raw_size = data.ofs; + } + + if (ia64_info->root.dynamic_sections_created) + { + /* Allocate space for the dynamic relocations that turned out to be + required. */ + + elf64_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data); + } + + /* We have now determined the sizes of the various dynamic sections. + Allocate memory for them. */ + for (sec = dynobj->sections; sec != NULL; sec = sec->next) + { + boolean strip; + + if (!(sec->flags & SEC_LINKER_CREATED)) + continue; + + /* If we don't need this section, strip it from the output file. + There were several sections primarily related to dynamic + linking that must be create before the linker maps input + sections to output sections. The linker does that before + bfd_elf_size_dynamic_sections is called, and it is that + function which decides whether anything needs to go into + these sections. */ + + strip = (sec->_raw_size == 0); + + if (sec == ia64_info->got_sec) + strip = false; + else if (sec == ia64_info->rel_got_sec) + { + if (strip) + ia64_info->rel_got_sec = NULL; + else + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + else if (sec == ia64_info->fptr_sec) + { + if (strip) + ia64_info->fptr_sec = NULL; + } + else if (sec == ia64_info->plt_sec) + { + if (strip) + ia64_info->plt_sec = NULL; + } + else if (sec == ia64_info->pltoff_sec) + { + if (strip) + ia64_info->pltoff_sec = NULL; + } + else if (sec == ia64_info->rel_pltoff_sec) + { + if (strip) + ia64_info->rel_pltoff_sec = NULL; + else + { + relplt = true; + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + } + else + { + const char *name; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, sec); + + if (strcmp (name, ".got.plt") == 0) + strip = false; + else if (strncmp (name, ".rel", 4) == 0) + { + if (!strip) + { + const char *outname; + asection *target; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL entry. */ + outname = bfd_get_section_name (output_bfd, + sec->output_section); + if (outname[4] == 'a') + outname += 5; + else + outname += 4; + + target = bfd_get_section_by_name (output_bfd, outname); + if (target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) + reltext = true; + + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + } + else + continue; + } + + if (strip) + _bfd_strip_section_from_output (info, sec); + else + { + /* Allocate memory for the section contents. */ + sec->contents = (bfd_byte *) bfd_zalloc(dynobj, sec->_raw_size); + if (sec->contents == NULL && sec->_raw_size != 0) + return false; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the values + later (in finish_dynamic_sections) but we must add the entries now + so that we get the correct size for the .dynamic section. */ + + if (!info->shared) + { + /* The DT_DEBUG entry is filled in by the dynamic linker and used + by the debugger. */ + if (!bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)) + return false; + } + + if (! bfd_elf64_add_dynamic_entry (info, DT_IA_64_PLT_RESERVE, 0)) + return false; + if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)) + return false; + + if (relplt) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA) + || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)) + return false; + } + + if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, + sizeof(Elf64_External_Rela))) + return false; + + if (reltext) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + } + } + + /* ??? Perhaps force __gp local. */ + + return true; +} + +static bfd_reloc_status_type +elf64_ia64_install_value (abfd, hit_addr, val, r_type) + bfd *abfd; + bfd_byte *hit_addr; + bfd_vma val; + unsigned int r_type; +{ + const struct ia64_operand *op; + int bigendian = 0, shift = 0; + bfd_vma t0, t1, insn, dword; + enum ia64_opnd opnd; + const char *err; + size_t size = 8; + + opnd = IA64_OPND_NIL; + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + return bfd_reloc_ok; + + /* Instruction relocations. */ + + case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break; + + case R_IA64_PCREL21F: opnd = IA64_OPND_TGT25; break; + case R_IA64_PCREL21M: opnd = IA64_OPND_TGT25b; break; + case R_IA64_PCREL60B: opnd = IA64_OPND_TGT64; break; + case R_IA64_PCREL21B: + case R_IA64_PCREL21BI: + opnd = IA64_OPND_TGT25c; + break; + + case R_IA64_IMM22: + case R_IA64_GPREL22: + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_PLTOFF22: + case R_IA64_PCREL22: + case R_IA64_LTOFF_FPTR22: + opnd = IA64_OPND_IMM22; + break; + + case R_IA64_IMM64: + case R_IA64_GPREL64I: + case R_IA64_LTOFF64I: + case R_IA64_PLTOFF64I: + case R_IA64_PCREL64I: + case R_IA64_FPTR64I: + case R_IA64_LTOFF_FPTR64I: + opnd = IA64_OPND_IMMU64; + break; + + /* Data relocations. */ + + case R_IA64_DIR32MSB: + case R_IA64_GPREL32MSB: + case R_IA64_FPTR32MSB: + case R_IA64_PCREL32MSB: + case R_IA64_SEGREL32MSB: + case R_IA64_SECREL32MSB: + case R_IA64_LTV32MSB: + size = 4; bigendian = 1; + break; + + case R_IA64_DIR32LSB: + case R_IA64_GPREL32LSB: + case R_IA64_FPTR32LSB: + case R_IA64_PCREL32LSB: + case R_IA64_SEGREL32LSB: + case R_IA64_SECREL32LSB: + case R_IA64_LTV32LSB: + size = 4; bigendian = 0; + break; + + case R_IA64_DIR64MSB: + case R_IA64_GPREL64MSB: + case R_IA64_PLTOFF64MSB: + case R_IA64_FPTR64MSB: + case R_IA64_PCREL64MSB: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_SEGREL64MSB: + case R_IA64_SECREL64MSB: + case R_IA64_LTV64MSB: + size = 8; bigendian = 1; + break; + + case R_IA64_DIR64LSB: + case R_IA64_GPREL64LSB: + case R_IA64_PLTOFF64LSB: + case R_IA64_FPTR64LSB: + case R_IA64_PCREL64LSB: + case R_IA64_LTOFF_FPTR64LSB: + case R_IA64_SEGREL64LSB: + case R_IA64_SECREL64LSB: + case R_IA64_LTV64LSB: + size = 8; bigendian = 0; + break; + + /* Unsupported / Dynamic relocations. */ + + case R_IA64_REL32MSB: + case R_IA64_REL32LSB: + case R_IA64_REL64MSB: + case R_IA64_REL64LSB: + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + case R_IA64_EPLTMSB: + case R_IA64_EPLTLSB: + case R_IA64_COPY: + + case R_IA64_SEGBASE: + + case R_IA64_TPREL22: + case R_IA64_TPREL64MSB: + case R_IA64_TPREL64LSB: + case R_IA64_LTOFF_TP22: + + default: + return bfd_reloc_notsupported; + } + + switch (opnd) + { + case IA64_OPND_IMMU64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | (( (0x07fLL << 13) | (0x1ffLL << 27) + | (0x01fLL << 22) | (0x001LL << 21) + | (0x001LL << 36)) << 23)); + + t0 |= ((val >> 22) & 0x03ffffLL) << 46; /* 18 lsbs of imm41 */ + t1 |= ((val >> 40) & 0x7fffffLL) << 0; /* 23 msbs of imm41 */ + t1 |= ( (((val >> 0) & 0x07f) << 13) /* imm7b */ + | (((val >> 7) & 0x1ff) << 27) /* imm9d */ + | (((val >> 16) & 0x01f) << 22) /* imm5c */ + | (((val >> 21) & 0x001) << 21) /* ic */ + | (((val >> 63) & 0x001) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + case IA64_OPND_TGT64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | ((1LL << 36 | 0xfffffLL << 13) << 23)); + + val >>= 4; + t0 |= ((val >> 20) & 0xffffLL) << 2 << 46; /* 16 lsbs of imm39 */ + t1 |= ((val >> 36) & 0x7fffffLL) << 0; /* 23 msbs of imm39 */ + t1 |= ((((val >> 0) & 0xfffffLL) << 13) /* imm20b */ + | (((val >> 59) & 0x1LL) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + default: + switch ((long) hit_addr & 0x3) + { + case 0: shift = 5; break; + case 1: shift = 14; hit_addr += 3; break; + case 2: shift = 23; hit_addr += 6; break; + case 3: return bfd_reloc_notsupported; /* shouldn't happen... */ + } + dword = bfd_get_64 (abfd, hit_addr); + insn = (dword >> shift) & 0x1ffffffffffLL; + + op = elf64_ia64_operands + opnd; + err = (*op->insert) (op, val, &insn); + if (err) + return bfd_reloc_overflow; + + dword &= ~(0x1ffffffffffLL << shift); + dword |= (insn << shift); + bfd_put_64 (abfd, dword, hit_addr); + break; + + case IA64_OPND_NIL: + /* A data relocation. */ + if (bigendian) + if (size == 4) + bfd_putb32 (val, hit_addr); + else + bfd_putb64 (val, hit_addr); + else + if (size == 4) + bfd_putl32 (val, hit_addr); + else + bfd_putl64 (val, hit_addr); + break; + } + + return bfd_reloc_ok; +} + +static void +elf64_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, + dynindx, addend) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + asection *srel; + bfd_vma offset; + unsigned int type; + long dynindx; + bfd_vma addend; +{ + Elf_Internal_Rela outrel; + + outrel.r_offset = (sec->output_section->vma + + sec->output_offset + + offset); + + BFD_ASSERT (dynindx != -1); + outrel.r_info = ELF64_R_INFO (dynindx, type); + outrel.r_addend = addend; + + if (elf_section_data (sec)->stab_info != NULL) + { + /* This may be NULL for linker-generated relocations, as it is + inconvenient to pass all the bits around. And this shouldn't + happen. */ + BFD_ASSERT (info != NULL); + + offset = (_bfd_stab_section_offset + (abfd, &elf_hash_table (info)->stab_info, sec, + &elf_section_data (sec)->stab_info, offset)); + if (offset == (bfd_vma) -1) + { + /* Run for the hills. We shouldn't be outputting a relocation + for this. So do what everyone else does and output a no-op. */ + outrel.r_info = ELF64_R_INFO (0, R_IA64_NONE); + outrel.r_addend = 0; + offset = 0; + } + outrel.r_offset = offset; + } + + bfd_elf64_swap_reloca_out (abfd, &outrel, + ((Elf64_External_Rela *) srel->contents + + srel->reloc_count++)); + BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count + <= srel->_cooked_size); +} + +/* Store an entry for target address TARGET_ADDR in the linkage table + and return the gp-relative address of the linkage table entry. */ + +static bfd_vma +set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_dyn_sym_info *dyn_i; + long dynindx; + bfd_vma addend; + bfd_vma value; + unsigned int dyn_r_type; +{ + struct elf64_ia64_link_hash_table *ia64_info; + asection *got_sec; + + ia64_info = elf64_ia64_hash_table (info); + got_sec = ia64_info->got_sec; + + BFD_ASSERT ((dyn_i->got_offset & 7) == 0); + + if (! dyn_i->got_done) + { + dyn_i->got_done = true; + + /* Store the target address in the linkage table entry. */ + bfd_put_64 (abfd, value, got_sec->contents + dyn_i->got_offset); + + /* Install a dynamic relocation if needed. */ + if (info->shared + || elf64_ia64_dynamic_symbol_p (dyn_i->h, info) + || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) + { + if (dynindx == -1) + { + dyn_r_type = R_IA64_REL64LSB; + dynindx = 0; + addend = value; + } + + if (bfd_big_endian (abfd)) + { + switch (dyn_r_type) + { + case R_IA64_REL64LSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_DIR64MSB; + break; + case R_IA64_FPTR64LSB: + dyn_r_type = R_IA64_FPTR64MSB; + break; + default: + BFD_ASSERT (false); + break; + } + } + + elf64_ia64_install_dyn_reloc (abfd, NULL, got_sec, + ia64_info->rel_got_sec, + dyn_i->got_offset, dyn_r_type, + dynindx, addend); + } + } + + /* Return the address of the linkage table entry. */ + value = (got_sec->output_section->vma + + got_sec->output_offset + + dyn_i->got_offset); + + return value; +} + +/* Fill in a function descriptor consisting of the function's code + address and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_fptr_entry (abfd, info, dyn_i, value) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_dyn_sym_info *dyn_i; + bfd_vma value; +{ + struct elf64_ia64_link_hash_table *ia64_info; + asection *fptr_sec; + + ia64_info = elf64_ia64_hash_table (info); + fptr_sec = ia64_info->fptr_sec; + + if (!dyn_i->fptr_done) + { + dyn_i->fptr_done = 1; + + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, fptr_sec->contents + dyn_i->fptr_offset); + bfd_put_64 (abfd, _bfd_get_gp_value (abfd), + fptr_sec->contents + dyn_i->fptr_offset + 8); + } + + /* Return the descriptor's address. */ + value = (fptr_sec->output_section->vma + + fptr_sec->output_offset + + dyn_i->fptr_offset); + + return value; +} + +/* Fill in a PLTOFF entry consisting of the function's code address + and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_pltoff_entry (abfd, info, dyn_i, value, is_plt) + bfd *abfd; + struct bfd_link_info *info; + struct elf64_ia64_dyn_sym_info *dyn_i; + bfd_vma value; + boolean is_plt; +{ + struct elf64_ia64_link_hash_table *ia64_info; + asection *pltoff_sec; + + ia64_info = elf64_ia64_hash_table (info); + pltoff_sec = ia64_info->pltoff_sec; + + /* Don't do anything if this symbol uses a real PLT entry. In + that case, we'll fill this in during finish_dynamic_symbol. */ + if ((! dyn_i->want_plt || is_plt) + && !dyn_i->pltoff_done) + { + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, pltoff_sec->contents + dyn_i->pltoff_offset); + bfd_put_64 (abfd, _bfd_get_gp_value (abfd), + pltoff_sec->contents + dyn_i->pltoff_offset + 8); + + /* Install dynamic relocations if needed. */ + if (!is_plt && info->shared) + { + unsigned int dyn_r_type; + + if (bfd_big_endian (abfd)) + dyn_r_type = R_IA64_REL64MSB; + else + dyn_r_type = R_IA64_REL64LSB; + + elf64_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset, + dyn_r_type, 0, 0); + elf64_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset + 8, + dyn_r_type, 0, 0); + } + + dyn_i->pltoff_done = 1; + } + + /* Return the descriptor's address. */ + value = (pltoff_sec->output_section->vma + + pltoff_sec->output_offset + + dyn_i->pltoff_offset); + + return value; +} + +static boolean +elf64_ia64_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elf64_ia64_link_hash_table *ia64_info; + ia64_info = elf64_ia64_hash_table (info); + + /* Make sure we've got ourselves a nice fat __gp value. */ + if (!info->relocateable) + { + bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; + bfd_vma min_short_vma = min_vma, max_short_vma = 0; + struct elf_link_hash_entry *gp; + bfd_vma gp_val; + asection *os; + + /* Find the min and max vma of all sections marked short. Also + collect min and max vma of any type, for use in selecting a + nice gp. */ + for (os = abfd->sections; os ; os = os->next) + { + bfd_vma lo, hi; + + if ((os->flags & SEC_ALLOC) == 0) + continue; + + lo = os->vma; + hi = os->vma + os->_raw_size; + if (hi < lo) + hi = (bfd_vma) -1; + + if (min_vma > lo) + min_vma = lo; + if (max_vma < hi) + max_vma = hi; + if (os->flags & SEC_SMALL_DATA) + { + if (min_short_vma > lo) + min_short_vma = lo; + if (max_short_vma < hi) + max_short_vma = hi; + } + } + + /* See if the user wants to force a value. */ + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false, + false, false); + + if (gp + && (gp->root.type == bfd_link_hash_defined + || gp->root.type == bfd_link_hash_defweak)) + { + asection *gp_sec = gp->root.u.def.section; + gp_val = (gp->root.u.def.value + + gp_sec->output_section->vma + + gp_sec->output_offset); + } + else + { + /* Pick a sensible value. */ + + asection *got_sec = ia64_info->got_sec; + + /* Start with just the address of the .got. */ + if (got_sec) + gp_val = got_sec->output_section->vma; + else if (max_short_vma != 0) + gp_val = min_short_vma; + else + gp_val = min_vma; + + /* If it is possible to address the entire image, but we + don't with the choice above, adjust. */ + if (max_vma - min_vma < 0x400000 + && max_vma - gp_val <= 0x200000 + && gp_val - min_vma > 0x200000) + gp_val = min_vma + 0x200000; + else if (max_short_vma != 0) + { + /* If we don't cover all the short data, adjust. */ + if (max_short_vma - gp_val >= 0x200000) + gp_val = min_short_vma + 0x200000; + + /* If we're addressing stuff past the end, adjust back. */ + if (gp_val > max_vma) + gp_val = max_vma - 0x200000 + 8; + } + } + + /* Validate whether all SHF_IA_64_SHORT sections are within + range of the chosen GP. */ + + if (max_short_vma != 0) + { + if (max_short_vma - min_short_vma >= 0x400000) + { + (*_bfd_error_handler) + (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), + bfd_get_filename (abfd), + (unsigned long)(max_short_vma - min_short_vma)); + return false; + } + else if ((gp_val > min_short_vma + && gp_val - min_short_vma > 0x200000) + || (gp_val < max_short_vma + && max_short_vma - gp_val >= 0x200000)) + { + (*_bfd_error_handler) + (_("%s: __gp does not cover short data segment"), + bfd_get_filename (abfd)); + return false; + } + } + + _bfd_set_gp_value (abfd, gp_val); + } + + /* Tricky bits. DT_INIT and DT_FINI use a pltoff entry, which is + normally initialized in finish_dynamic_sections. Except that + we need all non-plt pltoff entries to be initialized before + finish_dynamic_symbols. This because the array of relocations + used for plt entries (aka DT_JMPREL) begins after all the + non-plt pltoff relocations. If the order gets confused, we + munge either the array or the array base. */ + if (ia64_info->root.dynamic_sections_created) + { + struct elf_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + bfd_vma addr; + + if (info->init_function + && (h = elf_link_hash_lookup (elf_hash_table (info), + info->init_function, false, + false, false)) + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + addr = (h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset + + h->root.u.def.value); + (void) set_pltoff_entry (abfd, info, dyn_i, addr, false); + } + + if (info->fini_function + && (h = elf_link_hash_lookup (elf_hash_table (info), + info->fini_function, false, + false, false)) + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + addr = (h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset + + h->root.u.def.value); + (void) set_pltoff_entry (abfd, info, dyn_i, addr, false); + } + } + + /* Invoke the regular ELF backend linker to do all the work. */ + return bfd_elf64_bfd_final_link (abfd, info); +} + +static boolean +elf64_ia64_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + struct elf64_ia64_link_hash_table *ia64_info; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + asection *srel; + boolean ret_val = true; /* for non-fatal errors */ + bfd_vma gp_val; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + ia64_info = elf64_ia64_hash_table (info); + + /* Infect various flags from the input section to the output section. */ + if (info->relocateable) + { + bfd_vma flags; + + flags = elf_section_data(input_section)->this_hdr.sh_flags; + flags &= SHF_IA_64_NORECOV; + + elf_section_data(input_section->output_section) + ->this_hdr.sh_flags |= flags; + } + + gp_val = _bfd_get_gp_value (output_bfd); + srel = get_reloc_section (input_bfd, ia64_info, input_section, false); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; ++rel) + { + struct elf_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + bfd_reloc_status_type r; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + unsigned int r_type; + bfd_vma value; + asection *sym_sec; + bfd_byte *hit_addr; + boolean dynamic_symbol_p; + boolean undef_weak_ref; + + r_type = ELF64_R_TYPE (rel->r_info); + if (r_type > R_IA64_MAX_RELOC_CODE) + { + (*_bfd_error_handler) + (_("%s: unknown relocation type %d"), + bfd_get_filename (input_bfd), (int)r_type); + bfd_set_error (bfd_error_bad_value); + ret_val = false; + continue; + } + howto = lookup_howto (r_type); + r_symndx = ELF64_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sym_sec = local_sections[r_symndx]; + rel->r_addend += sym_sec->output_offset; + } + } + continue; + } + + /* This is a final link. */ + + h = NULL; + sym = NULL; + sym_sec = NULL; + undef_weak_ref = false; + + if (r_symndx < symtab_hdr->sh_info) + { + /* Reloc against local symbol. */ + sym = local_syms + r_symndx; + sym_sec = local_sections[r_symndx]; + value = (sym_sec->output_section->vma + + sym_sec->output_offset + + sym->st_value); + } + else + { + long indx; + + /* Reloc against global symbol. */ + indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + value = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sym_sec = h->root.u.def.section; + + /* Detect the cases that sym_sec->output_section is + expected to be NULL -- all cases in which the symbol + is defined in another shared module. This includes + PLT relocs for which we've created a PLT entry and + other relocs for which we're prepared to create + dynamic relocations. */ + /* ??? Just accept it NULL and continue. */ + + if (sym_sec->output_section != NULL) + { + value = (h->root.u.def.value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + } + else if (h->root.type == bfd_link_hash_undefweak) + undef_weak_ref = true; + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + ; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + ret_val = false; + continue; + } + } + + hit_addr = contents + rel->r_offset; + value += rel->r_addend; + dynamic_symbol_p = elf64_ia64_dynamic_symbol_p (h, info); + + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + continue; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Install a dynamic relocation for this reloc. */ + if ((dynamic_symbol_p || info->shared) + && (input_section->flags & SEC_ALLOC) != 0) + { + unsigned int dyn_r_type; + long dynindx; + + BFD_ASSERT (srel != NULL); + + /* If we don't need dynamic symbol lookup, find a + matching RELATIVE relocation. */ + dyn_r_type = r_type; + if (dynamic_symbol_p) + dynindx = h->dynindx; + else + { + switch (r_type) + { + case R_IA64_DIR32MSB: + dyn_r_type = R_IA64_REL32MSB; + break; + case R_IA64_DIR32LSB: + dyn_r_type = R_IA64_REL32LSB; + break; + case R_IA64_DIR64MSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_REL64LSB; + break; + + default: + /* We can't represent this without a dynamic symbol. + Adjust the relocation to be against an output + section symbol, which are always present in the + dynamic symbol table. */ + /* ??? People shouldn't be doing non-pic code in + shared libraries. Hork. */ + (*_bfd_error_handler) + (_("%s: linking non-pic code in a shared library"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + dynindx = 0; + } + + elf64_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, dyn_r_type, + dynindx, rel->r_addend); + } + /* FALLTHRU */ + + case R_IA64_LTV32MSB: + case R_IA64_LTV32LSB: + case R_IA64_LTV64MSB: + case R_IA64_LTV64LSB: + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_GPREL22: + case R_IA64_GPREL64I: + case R_IA64_GPREL32MSB: + case R_IA64_GPREL32LSB: + case R_IA64_GPREL64MSB: + case R_IA64_GPREL64LSB: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: @gprel relocation against dynamic symbol %s"), + bfd_get_filename (input_bfd), h->root.root.string); + ret_val = false; + continue; + } + value -= gp_val; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_got_entry (input_bfd, info, dyn_i, (h ? h->dynindx : -1), + rel->r_addend, value, R_IA64_DIR64LSB); + value -= gp_val; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_pltoff_entry (output_bfd, info, dyn_i, value, false); + value -= gp_val; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + } + else + { + long dynindx; + + /* Otherwise, we expect the dynamic linker to create + the entry. */ + + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + { + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + } + + elf64_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + dynindx, rel->r_addend); + value = 0; + } + + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + { + long dynindx; + + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + BFD_ASSERT (h == NULL || h->dynindx == -1) + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + dynindx = -1; + } + else + { + /* Otherwise, we expect the dynamic linker to create + the entry. */ + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + value = 0; + } + + value = set_got_entry (output_bfd, info, dyn_i, dynindx, + rel->r_addend, value, R_IA64_FPTR64LSB); + value -= gp_val; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + } + break; + + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + /* Install a dynamic relocation for this reloc. */ + if (dynamic_symbol_p) + { + BFD_ASSERT (srel != NULL); + + elf64_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + h->dynindx, rel->r_addend); + } + goto finish_pcrel; + + case R_IA64_PCREL21BI: + case R_IA64_PCREL21F: + case R_IA64_PCREL21M: + /* ??? These two are only used for speculation fixup code. + They should never be dynamic. */ + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: dynamic relocation against speculation fixup"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + if (undef_weak_ref) + { + (*_bfd_error_handler) + (_("%s: speculation fixup against undefined weak symbol"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* We should have created a PLT entry for any dynamic symbol. */ + dyn_i = NULL; + if (h) + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + if (dyn_i && dyn_i->want_plt2) + { + /* Should have caught this earlier. */ + BFD_ASSERT (rel->r_addend == 0); + + value = (ia64_info->plt_sec->output_section->vma + + ia64_info->plt_sec->output_offset + + dyn_i->plt2_offset); + } + else + { + /* Since there's no PLT entry, Validate that this is + locally defined. */ + BFD_ASSERT (undef_weak_ref || sym_sec->output_section != NULL); + + /* If the symbol is undef_weak, we shouldn't be trying + to call it. There's every chance that we'd wind up + with an out-of-range fixup here. Don't bother setting + any value at all. */ + if (undef_weak_ref) + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + finish_pcrel: + /* Make pc-relative. */ + value -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset) & ~ (bfd_vma) 0x3; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_SEGREL32MSB: + case R_IA64_SEGREL32LSB: + case R_IA64_SEGREL64MSB: + case R_IA64_SEGREL64LSB: + { + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + /* Find the segment that contains the output_section. */ + for (m = elf_tdata (output_bfd)->segment_map, + p = elf_tdata (output_bfd)->phdr; + m != NULL; + m = m->next, p++) + { + int i; + for (i = m->count - 1; i >= 0; i--) + if (m->sections[i] == sym_sec->output_section) + break; + if (i >= 0) + break; + } + + if (m == NULL) + { + /* If the input section was discarded from the output, then + do nothing. */ + + if (bfd_is_abs_section (sym_sec->output_section)) + r = bfd_reloc_ok; + else + r = bfd_reloc_notsupported; + } + else + { + /* The VMA of the segment is the vaddr of the associated + program header. */ + if (value > p->p_vaddr) + value -= p->p_vaddr; + else + value = 0; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, + r_type); + } + break; + } + + case R_IA64_SECREL32MSB: + case R_IA64_SECREL32LSB: + case R_IA64_SECREL64MSB: + case R_IA64_SECREL64LSB: + /* Make output-section relative. */ + if (value > input_section->output_section->vma) + value -= input_section->output_section->vma; + else + value = 0; + r = elf64_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_SEGBASE: + + case R_IA64_REL32MSB: + case R_IA64_REL32LSB: + case R_IA64_REL64MSB: + case R_IA64_REL64LSB: + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + case R_IA64_EPLTMSB: + case R_IA64_EPLTLSB: + case R_IA64_COPY: + + case R_IA64_TPREL22: + case R_IA64_TPREL64MSB: + case R_IA64_TPREL64LSB: + case R_IA64_LTOFF_TP22: + default: + r = bfd_reloc_notsupported; + break; + } + + switch (r) + { + case bfd_reloc_ok: + break; + + case bfd_reloc_undefined: + /* This can happen for global table relative relocs if + __gp is undefined. This is a panic situation so we + don't try to continue. */ + (*info->callbacks->undefined_symbol) + (info, "__gp", input_bfd, input_section, rel->r_offset, 1); + return false; + + case bfd_reloc_notsupported: + { + const char *name; + + if (h) + name = h->root.root.string; + else + { + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return false; + if (*name == '\0') + name = bfd_section_name (input_bfd, input_section); + } + if (!(*info->callbacks->warning) (info, _("unsupported reloc"), + name, input_bfd, + input_section, rel->r_offset)) + return false; + ret_val = false; + } + break; + + case bfd_reloc_dangerous: + case bfd_reloc_outofrange: + case bfd_reloc_overflow: + default: + { + const char *name; + + if (h) + name = h->root.root.string; + else + { + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return false; + if (*name == '\0') + name = bfd_section_name (input_bfd, input_section); + } + if (!(*info->callbacks->reloc_overflow) (info, name, + howto->name, 0, + input_bfd, + input_section, + rel->r_offset)) + return false; + ret_val = false; + } + break; + } + } + + return ret_val; +} + +static boolean +elf64_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) + bfd *output_bfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + struct elf64_ia64_link_hash_table *ia64_info; + struct elf64_ia64_dyn_sym_info *dyn_i; + + ia64_info = elf64_ia64_hash_table (info); + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + /* Fill in the PLT data, if required. */ + if (dyn_i && dyn_i->want_plt) + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + asection *plt_sec; + bfd_vma plt_addr, pltoff_addr, gp_val, index; + Elf64_External_Rela *rel; + + gp_val = _bfd_get_gp_value (output_bfd); + + /* Initialize the minimal PLT entry. */ + + index = (dyn_i->plt_offset - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + plt_sec = ia64_info->plt_sec; + loc = plt_sec->contents + dyn_i->plt_offset; + + memcpy (loc, plt_min_entry, PLT_MIN_ENTRY_SIZE); + elf64_ia64_install_value (output_bfd, loc, index, R_IA64_IMM22); + elf64_ia64_install_value (output_bfd, loc+2, -dyn_i->plt_offset, + R_IA64_PCREL21B); + + plt_addr = (plt_sec->output_section->vma + + plt_sec->output_offset + + dyn_i->plt_offset); + pltoff_addr = set_pltoff_entry (output_bfd, info, dyn_i, plt_addr, true); + + /* Initialize the FULL PLT entry, if needed. */ + if (dyn_i->want_plt2) + { + loc = plt_sec->contents + dyn_i->plt2_offset; + + memcpy (loc, plt_full_entry, PLT_FULL_ENTRY_SIZE); + elf64_ia64_install_value (output_bfd, loc, pltoff_addr - gp_val, + R_IA64_IMM22); + + /* Mark the symbol as undefined, rather than as defined in the + plt section. Leave the value alone. */ + /* ??? We didn't redefine it in adjust_dynamic_symbol in the + first place. But perhaps elflink.h did some for us. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym->st_shndx = SHN_UNDEF; + } + + /* Create the dynamic relocation. */ + outrel.r_offset = pltoff_addr; + if (bfd_little_endian (output_bfd)) + outrel.r_info = ELF64_R_INFO (h->dynindx, R_IA64_IPLTLSB); + else + outrel.r_info = ELF64_R_INFO (h->dynindx, R_IA64_IPLTMSB); + outrel.r_addend = 0; + + /* This is fun. In the .IA_64.pltoff section, we've got entries + that correspond both to real PLT entries, and those that + happened to resolve to local symbols but need to be created + to satisfy @pltoff relocations. The .rela.IA_64.pltoff + relocations for the real PLT should come at the end of the + section, so that they can be indexed by plt entry at runtime. + + We emitted all of the relocations for the non-PLT @pltoff + entries during relocate_section. So we can consider the + existing sec->reloc_count to be the base of the array of + PLT relocations. */ + + rel = (Elf64_External_Rela *)ia64_info->rel_pltoff_sec->contents; + rel += ia64_info->rel_pltoff_sec->reloc_count; + + bfd_elf64_swap_reloca_out (output_bfd, &outrel, rel + index); + } + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +static boolean +elf64_ia64_finish_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elf64_ia64_link_hash_table *ia64_info; + bfd *dynobj; + + ia64_info = elf64_ia64_hash_table (info); + dynobj = ia64_info->root.dynobj; + + if (elf_hash_table (info)->dynamic_sections_created) + { + Elf64_External_Dyn *dyncon, *dynconend; + asection *sdyn, *sgotplt; + bfd_vma gp_val; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + BFD_ASSERT (sdyn != NULL); + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + + gp_val = _bfd_get_gp_value (abfd); + + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + const char *name; + asection *s; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + case DT_PLTGOT: + dyn.d_un.d_ptr = gp_val; + break; + + case DT_PLTRELSZ: + dyn.d_un.d_val = (ia64_info->minplt_entries + * sizeof (Elf64_External_Rela)); + break; + + case DT_JMPREL: + /* See the comment above in finish_dynamic_symbol. */ + dyn.d_un.d_ptr = (ia64_info->rel_pltoff_sec->output_section->vma + + ia64_info->rel_pltoff_sec->output_offset + + (ia64_info->rel_pltoff_sec->reloc_count + * sizeof (Elf64_External_Rela))); + break; + + case DT_IA_64_PLT_RESERVE: + dyn.d_un.d_ptr = (sgotplt->output_section->vma + + sgotplt->output_offset); + break; + + case DT_RELASZ: + /* Do not have RELASZ include JMPREL. This makes things + easier on ld.so. This is not what the rest of BFD set up. */ + dyn.d_un.d_val -= (ia64_info->minplt_entries + * sizeof (Elf64_External_Rela)); + break; + + case DT_INIT: + case DT_FINI: + { + struct elf_link_hash_entry *h; + struct elf64_ia64_dyn_sym_info *dyn_i; + const char *which; + + if (dyn.d_tag == DT_INIT) + which = info->init_function; + else + which = info->fini_function; + + h = elf_link_hash_lookup (elf_hash_table (info), which, + false, false, false); + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + dyn.d_un.d_ptr = set_pltoff_entry (abfd, info, dyn_i, + dyn.d_un.d_ptr, 0); + } + } + + bfd_elf64_swap_dyn_out (abfd, &dyn, dyncon); + } + + /* Initialize the PLT0 entry */ + if (ia64_info->plt_sec) + { + bfd_byte *loc = ia64_info->plt_sec->contents; + bfd_vma pltres; + + memcpy (loc, plt_header, PLT_HEADER_SIZE); + + pltres = (sgotplt->output_section->vma + + sgotplt->output_offset + - gp_val); + + elf64_ia64_install_value (abfd, loc+1, pltres, R_IA64_GPREL22); + } + } + + return true; +} + +/* ELF file flag handling: */ + +/* Function to keep IA-64 specific file flags. */ +static boolean +elf64_ia64_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Copy backend specific data from one object module to another */ +static boolean +elf64_ia64_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + BFD_ASSERT (!elf_flags_init (obfd) + || (elf_elfheader (obfd)->e_flags + == elf_elfheader (ibfd)->e_flags)); + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ +static boolean +elf64_ia64_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + flagword out_flags; + flagword in_flags; + boolean ok = true; + + /* Don't even pretend to support mixed-format linking. */ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return false; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = in_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd)); + } + + return true; + } + + /* Check flag compatibility. */ + if (in_flags == out_flags) + return true; + + if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) + { + (*_bfd_error_handler) + (_("%s: linking trap-on-NULL-dereference with non-trapping files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) + { + (*_bfd_error_handler) + (_("%s: linking big-endian files with little-endian files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) + { + (*_bfd_error_handler) + (_("%s: linking 64-bit files with 32-bit files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + + return ok; +} + +static boolean +elf64_ia64_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + flagword flags = elf_elfheader (abfd)->e_flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + fprintf (file, "private flags = %s%s%s%s\n", + (flags & EF_IA_64_TRAPNIL) ? "TRAPNIL, " : "", + (flags & EF_IA_64_EXT) ? "EXT, " : "", + (flags & EF_IA_64_BE) ? "BE, " : "LE, ", + (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32"); + _bfd_elf_print_private_bfd_data (abfd, ptr); + return true; +} + +#define TARGET_LITTLE_SYM bfd_elf64_ia64_little_vec +#define TARGET_LITTLE_NAME "elf64-ia64-little" +#define TARGET_BIG_SYM bfd_elf64_ia64_big_vec +#define TARGET_BIG_NAME "elf64-ia64-big" +#define ELF_ARCH bfd_arch_ia64 +#define ELF_MACHINE_CODE EM_IA_64 +#define ELF_MACHINE_ALT1 1999 /* EAS2.3 */ +#define ELF_MACHINE_ALT2 1998 /* EAS2.2 */ +#define ELF_MAXPAGESIZE 0x10000 /* 64KB */ + +#define elf_backend_section_from_shdr \ + elf64_ia64_section_from_shdr +#define elf_backend_fake_sections \ + elf64_ia64_fake_sections +#define elf_backend_add_symbol_hook \ + elf64_ia64_add_symbol_hook +#define elf_backend_additional_program_headers \ + elf64_ia64_additional_program_headers +#define elf_backend_modify_segment_map \ + elf64_ia64_modify_segment_map +#define elf_info_to_howto \ + elf64_ia64_info_to_howto + +#define bfd_elf64_bfd_reloc_type_lookup \ + elf64_ia64_reloc_type_lookup +#define bfd_elf64_bfd_is_local_label_name \ + elf64_ia64_is_local_label_name +#define bfd_elf64_bfd_relax_section \ + elf64_ia64_relax_section + +/* Stuff for the BFD linker: */ +#define bfd_elf64_bfd_link_hash_table_create \ + elf64_ia64_hash_table_create +#define elf_backend_create_dynamic_sections \ + elf64_ia64_create_dynamic_sections +#define elf_backend_check_relocs \ + elf64_ia64_check_relocs +#define elf_backend_adjust_dynamic_symbol \ + elf64_ia64_adjust_dynamic_symbol +#define elf_backend_size_dynamic_sections \ + elf64_ia64_size_dynamic_sections +#define elf_backend_relocate_section \ + elf64_ia64_relocate_section +#define elf_backend_finish_dynamic_symbol \ + elf64_ia64_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + elf64_ia64_finish_dynamic_sections +#define bfd_elf64_bfd_final_link \ + elf64_ia64_final_link + +#define bfd_elf64_bfd_copy_private_bfd_data \ + elf64_ia64_copy_private_bfd_data +#define bfd_elf64_bfd_merge_private_bfd_data \ + elf64_ia64_merge_private_bfd_data +#define bfd_elf64_bfd_set_private_flags \ + elf64_ia64_set_private_flags +#define bfd_elf64_bfd_print_private_bfd_data \ + elf64_ia64_print_private_bfd_data + +#define elf_backend_plt_readonly 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 5 +#define elf_backend_got_header_size 0 +#define elf_backend_plt_header_size PLT_HEADER_SIZE +#define elf_backend_want_got_plt 1 +#define elf_backend_may_use_rel_p 1 +#define elf_backend_may_use_rela_p 1 +#define elf_backend_default_use_rela_p 1 +#define elf_backend_want_dynbss 0 +#define elf_backend_copy_indirect_symbol elf64_ia64_hash_copy_indirect +#define elf_backend_hide_symbol elf64_ia64_hash_hide_symbol + +#include "elf64-target.h" diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 46e777552f2..ca2e7c1d2f4 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" +#include "opcode/sparc.h" /* This is defined if one wants to build upward compatible binaries with the original sparc64-elf toolchain. The support is kept in for @@ -65,6 +66,8 @@ static void sparc64_elf_symbol_processing static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static boolean sparc64_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean sparc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -212,7 +215,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = static reloc_howto_type * sparc64_elf_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { unsigned int i; @@ -226,7 +229,7 @@ sparc64_elf_reloc_type_lookup (abfd, code) static void sparc64_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf64_Internal_Rela *dst; { @@ -240,7 +243,7 @@ sparc64_elf_info_to_howto (abfd, cache_ptr, dst) static long sparc64_elf_get_reloc_upper_bound (abfd, sec) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asection *sec; { return (sec->reloc_count * 2 + 1) * sizeof (arelent *); @@ -266,7 +269,6 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) asymbol **symbols; boolean dynamic; { - struct elf_backend_data * const ebd = get_elf_backend_data (abfd); PTR allocated = NULL; bfd_byte *native_relocs; arelent *relent; @@ -501,7 +503,6 @@ sparc64_elf_write_relocs (abfd, sec, data) for (idx = 0; idx < sec->reloc_count; idx++) { bfd_vma addr; - unsigned int i; ++count; @@ -723,13 +724,13 @@ sparc_elf_notsup_reloc (abfd, input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry ATTRIBUTE_UNUSED; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section ATTRIBUTE_UNUSED; + bfd *output_bfd ATTRIBUTE_UNUSED; + char **error_message ATTRIBUTE_UNUSED; { return bfd_reloc_notsupported; } @@ -745,7 +746,7 @@ sparc_elf_wdisp16_reloc (abfd, reloc_entry, symbol, data, input_section, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -783,7 +784,7 @@ sparc_elf_hix22_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -820,7 +821,7 @@ sparc_elf_lox10_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -1265,9 +1266,9 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) struct bfd_link_info *info; const Elf_Internal_Sym *sym; const char **namep; - flagword *flagsp; - asection **secp; - bfd_vma *valp; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp ATTRIBUTE_UNUSED; + bfd_vma *valp ATTRIBUTE_UNUSED; { static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; @@ -1387,7 +1388,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) static boolean sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; PTR finfo; boolean (*func) PARAMS ((PTR, const char *, @@ -1460,7 +1461,7 @@ sparc64_elf_get_symbol_type (elf_sym, type) static void sparc64_elf_symbol_processing (abfd, asym) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asymbol *asym; { elf_symbol_type *elfsym; @@ -1855,6 +1856,22 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) return true; } +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +/*ARGSUSED*/ +static boolean +sparc64_elf_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC64 ELF section. */ static boolean @@ -1898,7 +1915,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { int r_type; reloc_howto_type *howto; - long r_symndx; + unsigned long r_symndx; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sec; @@ -2049,14 +2066,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -2393,6 +2413,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + sparc64_elf_plt_entry_offset (h->plt.offset)); + if (r_type == R_SPARC_WPLT30) + goto do_wplt30; goto do_default; case R_SPARC_OLO10: @@ -2468,6 +2490,97 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; + case R_SPARC_WDISP30: + do_wplt30: + if (SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + if (reloc & 3) + goto do_default; + + /* Ensure the branch fits into simm22. */ + if ((reloc & ~(bfd_vma)0x7fffff) + && ((reloc | 0x7fffff) != MINUS_ONE)) + goto do_default; + reloc >>= 2; + + /* Check whether it fits into simm19. */ + if ((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + break; + } + } + } + /* FALLTHROUGH */ + default: do_default: r = _bfd_final_link_relocate (howto, input_bfd, input_section, @@ -2806,8 +2919,8 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) /* We don't want dynamic objects memory ordering and architecture to have any role. That's what dynamic linker should do. */ - old_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1); - old_flags |= (new_flags + new_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1); + new_flags |= (old_flags & (EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)); @@ -2860,7 +2973,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) static const char * sparc64_elf_print_symbol_all (abfd, filep, symbol) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; PTR filep; asymbol *symbol; { @@ -2960,6 +3073,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_canonicalize_dynamic_reloc #define bfd_elf64_bfd_reloc_type_lookup \ sparc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_relax_section \ + sparc64_elf_relax_section #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/bfd/elfcode.h b/bfd/elfcode.h index c5edf9b8250..b1ce9d820fd 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -118,6 +118,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_add_dynamic_entry NAME(bfd_elf,add_dynamic_entry) #define elf_write_shdrs_and_ehdr NAME(bfd_elf,write_shdrs_and_ehdr) #define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs) +#define elf_write_relocs NAME(bfd_elf,write_relocs) +#define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table) #define elf_link_create_dynamic_sections \ NAME(bfd_elf,link_create_dynamic_sections) #define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol @@ -168,10 +170,6 @@ static void elf_swap_shdr_out static boolean elf_slurp_reloc_table_from_section PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, arelent *, asymbol **, boolean)); -static boolean elf_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, boolean)); - -static void write_relocs PARAMS ((bfd *, asection *, PTR)); static boolean elf_file_p PARAMS ((Elf_External_Ehdr *)); @@ -746,8 +744,8 @@ elf_object_p (abfd) /* Write out the relocs. */ -static void -write_relocs (abfd, sec, data) +void +elf_write_relocs (abfd, sec, data) bfd *abfd; asection *sec; PTR data; @@ -1325,7 +1323,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, /* Read in and swap the external relocs. */ -static boolean +boolean elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd *abfd; asection *asect; @@ -1533,7 +1531,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { ELFCLASS, EV_CURRENT, elf_write_out_phdrs, elf_write_shdrs_and_ehdr, - write_relocs, + elf_write_relocs, elf_swap_symbol_out, elf_slurp_reloc_table, elf_slurp_symbol_table, diff --git a/bfd/elflink.c b/bfd/elflink.c index 6534d84b18a..8039b4fe35b 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -226,20 +226,13 @@ _bfd_elf_link_record_dynamic_symbol (info, h) { case STV_INTERNAL: case STV_HIDDEN: - /* This symbol must be defined in the shared object or - executable. */ - if (h->root.type == bfd_link_hash_undefined) + if (h->root.type != bfd_link_hash_undefined + && h->root.type != bfd_link_hash_undefweak) { - bfd * abfd = h->root.u.undef.abfd; - const char * name = h->root.root.string; - - (*info->callbacks->undefined_symbol) - (info, name, abfd, bfd_und_section_ptr, 0, true); + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + return true; } - - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - break; - + default: break; } diff --git a/bfd/elflink.h b/bfd/elflink.h index bddf2907119..898d6b3a9cb 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -357,7 +357,6 @@ elf_link_add_archive_symbols (abfd, info) } /* We need to include this archive member. */ - element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (element == (bfd *) NULL) goto error_return; @@ -1852,6 +1851,18 @@ elf_link_add_object_symbols (abfd, info) goto error_return; } } + else if (dynsym && h->dynindx != -1) + /* If the symbol already has a dynamic index, but + visibility says it should not be visible, turn it into + a local symbol. */ + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + (*bed->elf_backend_hide_symbol) (h); + break; + } } } @@ -3278,6 +3289,9 @@ elf_fix_symbol_flags (h, eif) 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 @@ -3339,10 +3353,12 @@ elf_fix_symbol_flags (h, eif) /* 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. */ + need a PLT entry. Likewise, if the symbol has any kind of + visibility (internal, hidden, or protected), it doesn't need a + PLT. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared - && eif->info->symbolic + && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT; @@ -4086,7 +4102,7 @@ elf_bfd_final_link (abfd, info) the linker has decided to not include. */ sec->linker_mark = true; - if (info->relocateable) + if (info->relocateable || info->emitrelocations) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -4154,7 +4170,7 @@ elf_bfd_final_link (abfd, info) /* Figure out how many relocations we will have in each section. Just using RELOC_COUNT isn't good enough since that doesn't maintain a separate value for REL vs. RELA relocations. */ - if (info->relocateable) + if (info->relocateable || info->emitrelocations) for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) for (o = sub->sections; o != NULL; o = o->next) { @@ -4262,7 +4278,7 @@ elf_bfd_final_link (abfd, info) /* Start writing out the symbol table. The first symbol is always a dummy symbol. */ - if (info->strip != strip_all || info->relocateable) + if (info->strip != strip_all || info->relocateable || info->emitrelocations) { elfsym.st_value = 0; elfsym.st_size = 0; @@ -4295,7 +4311,7 @@ elf_bfd_final_link (abfd, info) symbols have no names. We store the index of each one in the index field of the section, so that we can find it again when outputting relocs. */ - if (info->strip != strip_all || info->relocateable) + if (info->strip != strip_all || info->relocateable || info->emitrelocations) { elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); @@ -5017,12 +5033,9 @@ elf_link_output_extsym (h, data) symbol foo@@GNU_1.2 is the default, which should be used when foo is used with no version, then we add an indirect symbol foo which points to foo@@GNU_1.2. We ignore these symbols, - since the indirected symbol is already in the hash table. If - the indirect symbol is non-ELF, fall through and output it. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) == 0) - return true; + since the indirected symbol is already in the hash table. */ + return true; - /* Fall through. */ case bfd_link_hash_warning: /* We can't represent these symbols in ELF, although a warning symbol may have come from a .gnu.warning.SYMBOL section. We @@ -5072,6 +5085,11 @@ 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 ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); + /* If this symbol should be put in the .dynsym section, then put it there now. We have already know the symbol index. We also fill in the entry in the .hash section. */ @@ -5474,7 +5492,7 @@ elf_link_input_bfd (finfo, input_bfd) finfo->sections)) return false; - if (finfo->info->relocateable) + if (finfo->info->relocateable || finfo->info->emitrelocations) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; @@ -5497,6 +5515,10 @@ elf_link_input_bfd (finfo, input_bfd) irela->r_offset += o->output_offset; + /* Relocs in an executable have to be virtual addresses. */ + if (finfo->info->emitrelocations) + irela->r_offset += o->output_section->vma; + r_symndx = ELF_R_SYM (irela->r_info); if (r_symndx == 0) @@ -6403,7 +6425,7 @@ elf_gc_sections (abfd, info) struct elf_link_hash_entry *h, Elf_Internal_Sym *)); if (!get_elf_backend_data (abfd)->can_gc_sections - || info->relocateable + || info->relocateable || info->emitrelocations || elf_hash_table (info)->dynamic_sections_created) return true; @@ -6615,7 +6637,8 @@ elf_gc_common_finalize_got_offsets (abfd, info) } } - /* Then the global .got and .plt entries. */ + /* Then the global .got entries. .plt refcounts are handled by + adjust_dynamic_symbol */ elf_link_hash_traverse (elf_hash_table (info), elf_gc_allocate_got_offsets, (PTR) &gotoff); diff --git a/bfd/ieee.c b/bfd/ieee.c index 82b3bac8367..71b967ac418 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -1009,8 +1009,17 @@ ieee_get_symtab (abfd, location) ieee_symbol_type *symp; static bfd dummy_bfd; static asymbol empty_symbol = - /* the_bfd, name, value, attr, section */ - {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr, { 0 }}; + { + &dummy_bfd, + " ieee empty", + (symvalue) 0, + BSF_DEBUGGING, + bfd_abs_section_ptr +#ifdef __STDC__ + /* K&R compilers can't initialise unions. */ + , { 0 } +#endif + }; if (abfd->symcount) { diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 79a176d063c..aece1e15a51 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -1,6 +1,6 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -506,8 +506,8 @@ void bfd_assert PARAMS ((const char*,int)); extern void _bfd_abort PARAMS ((const char *, int, const char *)) ATTRIBUTE_NORETURN; -/* if gcc, we can give a function name, too */ -#if !defined (__GNUC__) || __GNUC_MINOR__ <= 5 +/* if gcc >= 2.6, we can give a function name, too */ +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) #define __PRETTY_FUNCTION__ ((char *) NULL) #endif diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 881af73239f..1bc0f33ee12 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1306,13 +1306,17 @@ _bfd_generic_verify_endian_match (ibfd, obfd) bfd *obfd; { if (ibfd->xvec->byteorder != obfd->xvec->byteorder + && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) { - (*_bfd_error_handler) - ("%s: compiled for a %s endian system and target is %s endian", - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); + const char *msg; + + if (bfd_big_endian (ibfd)) + msg = _("%s: compiled for a big endian system and target is little endian"); + else + msg = _("%s: compiled for a little endian system and target is big endian"); + + (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); bfd_set_error (bfd_error_wrong_format); return false; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 20ffcdc73b4..effb0e819b0 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1,6 +1,6 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -506,8 +506,8 @@ void bfd_assert PARAMS ((const char*,int)); extern void _bfd_abort PARAMS ((const char *, int, const char *)) ATTRIBUTE_NORETURN; -/* if gcc, we can give a function name, too */ -#if !defined (__GNUC__) || __GNUC_MINOR__ <= 5 +/* if gcc >= 2.6, we can give a function name, too */ +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) #define __PRETTY_FUNCTION__ ((char *) NULL) #endif @@ -898,6 +898,73 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AVR_CALL", "BFD_RELOC_VTABLE_INHERIT", "BFD_RELOC_VTABLE_ENTRY", + "BFD_RELOC_IA64_IMM14", + "BFD_RELOC_IA64_IMM22", + "BFD_RELOC_IA64_IMM64", + "BFD_RELOC_IA64_DIR32MSB", + "BFD_RELOC_IA64_DIR32LSB", + "BFD_RELOC_IA64_DIR64MSB", + "BFD_RELOC_IA64_DIR64LSB", + "BFD_RELOC_IA64_GPREL22", + "BFD_RELOC_IA64_GPREL64I", + "BFD_RELOC_IA64_GPREL32MSB", + "BFD_RELOC_IA64_GPREL32LSB", + "BFD_RELOC_IA64_GPREL64MSB", + "BFD_RELOC_IA64_GPREL64LSB", + "BFD_RELOC_IA64_LTOFF22", + "BFD_RELOC_IA64_LTOFF64I", + "BFD_RELOC_IA64_PLTOFF22", + "BFD_RELOC_IA64_PLTOFF64I", + "BFD_RELOC_IA64_PLTOFF64MSB", + "BFD_RELOC_IA64_PLTOFF64LSB", + "BFD_RELOC_IA64_FPTR64I", + "BFD_RELOC_IA64_FPTR32MSB", + "BFD_RELOC_IA64_FPTR32LSB", + "BFD_RELOC_IA64_FPTR64MSB", + "BFD_RELOC_IA64_FPTR64LSB", + "BFD_RELOC_IA64_PCREL21B", + "BFD_RELOC_IA64_PCREL21BI", + "BFD_RELOC_IA64_PCREL21M", + "BFD_RELOC_IA64_PCREL21F", + "BFD_RELOC_IA64_PCREL22", + "BFD_RELOC_IA64_PCREL60B", + "BFD_RELOC_IA64_PCREL64I", + "BFD_RELOC_IA64_PCREL32MSB", + "BFD_RELOC_IA64_PCREL32LSB", + "BFD_RELOC_IA64_PCREL64MSB", + "BFD_RELOC_IA64_PCREL64LSB", + "BFD_RELOC_IA64_LTOFF_FPTR22", + "BFD_RELOC_IA64_LTOFF_FPTR64I", + "BFD_RELOC_IA64_LTOFF_FPTR64MSB", + "BFD_RELOC_IA64_LTOFF_FPTR64LSB", + "BFD_RELOC_IA64_SEGBASE", + "BFD_RELOC_IA64_SEGREL32MSB", + "BFD_RELOC_IA64_SEGREL32LSB", + "BFD_RELOC_IA64_SEGREL64MSB", + "BFD_RELOC_IA64_SEGREL64LSB", + "BFD_RELOC_IA64_SECREL32MSB", + "BFD_RELOC_IA64_SECREL32LSB", + "BFD_RELOC_IA64_SECREL64MSB", + "BFD_RELOC_IA64_SECREL64LSB", + "BFD_RELOC_IA64_REL32MSB", + "BFD_RELOC_IA64_REL32LSB", + "BFD_RELOC_IA64_REL64MSB", + "BFD_RELOC_IA64_REL64LSB", + "BFD_RELOC_IA64_LTV32MSB", + "BFD_RELOC_IA64_LTV32LSB", + "BFD_RELOC_IA64_LTV64MSB", + "BFD_RELOC_IA64_LTV64LSB", + "BFD_RELOC_IA64_IPLTMSB", + "BFD_RELOC_IA64_IPLTLSB", + "BFD_RELOC_IA64_EPLTMSB", + "BFD_RELOC_IA64_EPLTLSB", + "BFD_RELOC_IA64_COPY", + "BFD_RELOC_IA64_TPREL22", + "BFD_RELOC_IA64_TPREL64MSB", + "BFD_RELOC_IA64_TPREL64LSB", + "BFD_RELOC_IA64_LTOFF_TP22", + "BFD_RELOC_IA64_LTOFF22X", + "BFD_RELOC_IA64_LDXMOV", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif diff --git a/bfd/libcoff.h b/bfd/libcoff.h index bee4ce9e858..c72ffdbe103 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -713,6 +713,8 @@ typedef struct boolean _bfd_coff_long_filenames; boolean _bfd_coff_long_section_names; unsigned int _bfd_coff_default_section_alignment_power; + boolean _bfd_coff_force_symnames_in_strings; + unsigned int _bfd_coff_debug_string_prefix_length; void (*_bfd_coff_swap_filehdr_in) PARAMS (( bfd *abfd, PTR ext, @@ -910,6 +912,12 @@ typedef struct #define bfd_coff_symname_in_debug(abfd, sym)\ ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) +#define bfd_coff_force_symnames_in_strings(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) + +#define bfd_coff_debug_string_prefix_length(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) + #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ (abfd, file, base, symbol, aux, indaux)) diff --git a/bfd/libhppa.h b/bfd/libhppa.h index c32eabe4457..7a8af9a385d 100644 --- a/bfd/libhppa.h +++ b/bfd/libhppa.h @@ -1,5 +1,5 @@ /* HP PA-RISC SOM object file format: definitions internal to BFD. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000 Free Software Foundation, Inc. Contributed by the Center for Software Science at the @@ -35,53 +35,8 @@ #endif /* GNU C? */ #endif /* INLINE */ -#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 -/* Declare the functions with the unused attribute to avoid warnings. */ -static INLINE unsigned int assemble_3 (unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_3 (unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned int assemble_12 (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_12 (unsigned int, unsigned int *, - unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long assemble_17 (unsigned int, unsigned int, - unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_17 (unsigned int, unsigned int *, - unsigned int *, unsigned int *) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_22 (unsigned int, unsigned int *, - unsigned int *, unsigned int *, - unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long assemble_21 (unsigned int) - __attribute ((__unused__)); -static INLINE void dis_assemble_21 (unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long sign_extend (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE unsigned int ones (int) __attribute ((__unused__)); -static INLINE void sign_unext (unsigned int, unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long low_sign_extend (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE void low_sign_unext (unsigned int, unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long hppa_field_adjust (unsigned long, unsigned long, - unsigned short) - __attribute__ ((__unused__)); -static INLINE int bfd_hppa_insn2fmt (unsigned long) - __attribute__ ((__unused__)); -static INLINE unsigned long hppa_rebuild_insn (bfd *, unsigned long, - unsigned long, unsigned long) - __attribute__ ((__unused__)); -#endif /* gcc 2.7 or higher */ - - /* The PA instruction set variants. */ -enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20}; +enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25}; /* HP PA-RISC relocation types */ @@ -197,10 +152,13 @@ enum hppa_reloc_expr_type_alt The high order 10 bits contain parameter relocation information, the low order 22 bits contain the constant offset. */ - -#define HPPA_R_ARG_RELOC(a) (((a) >> 22) & 0x3FF) -#define HPPA_R_CONSTANT(a) ((((int)(a)) << 10) >> 10) -#define HPPA_R_ADDEND(r,c) (((r) << 22) + ((c) & 0x3FFFFF)) + +#define HPPA_R_ARG_RELOC(a) \ + (((a) >> 22) & 0x3ff) +#define HPPA_R_CONSTANT(a) \ + ((((bfd_signed_vma)(a)) << (BFD_ARCH_SIZE-22)) >> (BFD_ARCH_SIZE-22)) +#define HPPA_R_ADDEND(r, c) \ + (((r) << 22) + ((c) & 0x3fffff)) #define HPPA_WIDE (0) /* PSW W-bit, need to check! FIXME */ /* These macros get bit fields using HP's numbering (MSB = 0), @@ -210,54 +168,110 @@ enum hppa_reloc_expr_type_alt #ifndef GET_FIELD #define GET_FIELD(X, FROM, TO) \ ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1)) -#endif +#endif #define GET_BIT(X, WHICH) \ GET_FIELD (X, WHICH, WHICH) #define MASK(SIZE) \ (~((-1) << SIZE)) - + #define CATENATE(X, XSIZE, Y, YSIZE) \ (((X & MASK (XSIZE)) << YSIZE) | (Y & MASK (YSIZE))) #define ELEVEN(X) \ CATENATE (GET_BIT (X, 10), 1, GET_FIELD (X, 0, 9), 10) - + /* Some functions to manipulate PA instructions. */ -/* NOTE: these use the HP convention that f{1} is the _left_ most +/* NOTE: these use the HP convention that f{0} is the _left_ most * bit (MSB) of f; they sometimes have to impose an assumption * about the size of a field; and as far as I can tell, most * aren't used. */ -static INLINE unsigned long +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +/* Declare the functions with the unused attribute to avoid warnings. */ +static INLINE unsigned int sign_extend (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int low_sign_extend (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_3 (unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_6 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_12 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_16 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_16a (unsigned int, unsigned int, + unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_17 (unsigned int, unsigned int, + unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int assemble_21 (unsigned int) + __attribute ((__unused__)); + +static INLINE unsigned int sign_unext (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int low_sign_unext (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_3 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_12 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_16 (unsigned int, unsigned int, int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_17 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_22 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int re_assemble_21 (unsigned int, unsigned int) + __attribute__ ((__unused__)); +static INLINE bfd_signed_vma hppa_field_adjust (bfd_signed_vma, bfd_signed_vma, + enum hppa_reloc_field_selector_type_alt) + __attribute__ ((__unused__)); +static INLINE int bfd_hppa_insn2fmt (unsigned int) + __attribute__ ((__unused__)); +static INLINE unsigned int hppa_rebuild_insn (bfd *, unsigned int, + unsigned int, unsigned int) + __attribute__ ((__unused__)); +#endif /* gcc 2.7 or higher */ + + +/* The *sign_extend and assemble_* functions are used to assemble + various bitfields taken from an instruction and return the + resulting immediate value. They correspond to functions by the + same name in HP's PA-RISC 2.0 Architecture Reference Manual. */ + +static INLINE unsigned int sign_extend (x, len) unsigned int x, len; { - return (int)(x >> (len - 1) ? (-1 << len) | x : x); + unsigned int signbit = (1 << (len - 1)); + unsigned int mask = (signbit << 1) - 1; + return ((x & mask) ^ signbit) - signbit; } static INLINE unsigned int -assemble_3 (x) - unsigned int x; +low_sign_extend (x, len) + unsigned int x, len; { - return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2); + return (x >> 1) - ((x & 1) << (len - 1)); } -static INLINE void -dis_assemble_3 (x, r) +static INLINE unsigned int +assemble_3 (x) unsigned int x; - unsigned int *r; { - *r = (((x & 4) >> 2) | ((x & 3) << 1)) & 7; + return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2); } static INLINE unsigned int assemble_6 (x, y) unsigned int x, y; { - return (((x & 0x1) << 5) + (32 - (y & 0x1f))); + return (((x & 1) << 5) + (32 - (y & 0x1f))); } static INLINE unsigned int @@ -268,16 +282,7 @@ assemble_12 (x, y) GET_FIELD (x, 0, 9), 9); } -static INLINE void -dis_assemble_12 (as12, x, y) - unsigned int as12; - unsigned int *x, *y; -{ - *y = (as12 & 0x800) >> 11; - *x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10); -} - -static INLINE unsigned long +static INLINE unsigned int assemble_16 (x, y) unsigned int x, y; { @@ -296,8 +301,7 @@ assemble_16 (x, y) return sign_extend (temp, 16); } - -static INLINE unsigned long +static INLINE unsigned int assemble_16a (x, y, z) unsigned int x, y, z; { @@ -307,223 +311,252 @@ assemble_16a (x, y, z) if (HPPA_WIDE) temp = CATENATE (CATENATE (z, 1, (z ^ GET_BIT (x, 0)), 1), 2, CATENATE ((z ^ GET_BIT (x, 1)), 1, y, 11), 12); - else - temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12); + else + temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12); return sign_extend ((temp << 2), 16); } -static INLINE unsigned long +static INLINE unsigned int assemble_17 (x, y, z) unsigned int x, y, z; { - unsigned long temp; + unsigned int temp; temp = CATENATE (CATENATE (z, 1, x, 5), 6, CATENATE (GET_BIT (y, 10), 1, GET_FIELD (y, 0, 9), 10), 11); - - return temp; -} - -static INLINE void -dis_assemble_17 (as17, x, y, z) - unsigned int as17; - unsigned int *x, *y, *z; -{ - *z = (as17 & 0x10000) >> 16; - *x = (as17 & 0x0f800) >> 11; - *y = (((as17 & 0x00400) >> 10) | ((as17 & 0x3ff) << 1)) & 0x7ff; -} - -static INLINE void -dis_assemble_22 (as22, a, b, c, d) - unsigned int as22; - unsigned int *a, *b, *c, *d; -{ - - *d = (as22 & 0x200000) >> 21; - *a = (as22 & 0x1f0000) >> 16; - *b = (as22 & 0x0f800) >> 11; - *c = (((as22 & 0x00400) >> 10) | ((as22 & 0x3ff) << 1)) & 0x7ff; + return temp; } -static INLINE unsigned long +static INLINE unsigned int assemble_21 (x) unsigned int x; { - unsigned long temp; - - temp = ((x & 1) << 20) | - ((x & 0xffe) << 8) | - ((x & 0xc000) >> 7) | - ((x & 0x1f0000) >> 14) | - ((x & 0x003000) >> 12); - return temp & 0x1fffff; + unsigned int temp; + + temp = (( (x & 0x000001) << 20) + | ((x & 0x000ffe) << 8) + | ((x & 0x003000) >> 12) + | ((x & 0x00c000) >> 7) + | ((x & 0x1f0000) >> 14)); + return temp; } -static INLINE unsigned long +static INLINE unsigned int assemble_22 (a,b,c,d) unsigned int a,b,c,d; { - unsigned long temp; - + unsigned int temp; + temp = CATENATE (CATENATE (d, 1, a, 5), 6, CATENATE (b, 5, ELEVEN (c), 11), 16); return sign_extend (temp, 22); } -static INLINE void -dis_assemble_21 (as21, x) - unsigned int as21, *x; -{ - unsigned long temp; - - temp = (as21 & 0x100000) >> 20; - temp |= (as21 & 0x0ffe00) >> 8; - temp |= (as21 & 0x000180) << 7; - temp |= (as21 & 0x00007c) << 14; - temp |= (as21 & 0x000003) << 12; - *x = temp; -} +/* The re_assemble_* functions splice together an opcode and an + immediate value. pa-risc uses all sorts of weird bitfields in the + instruction to hold the value. */ static INLINE unsigned int -ones (n) - int n; +sign_unext (x, len) + unsigned int x, len; { unsigned int len_ones; - int i; - i = 0; - len_ones = 0; - while (i < n) - { - len_ones = (len_ones << 1) | 1; - i++; - } + len_ones = ((unsigned int) 1 << len) - 1; - return len_ones; + return x & len_ones; } -static INLINE void -sign_unext (x, len, result) +static INLINE unsigned int +low_sign_unext (x, len) unsigned int x, len; - unsigned int *result; { - unsigned int len_ones; + unsigned int temp; + unsigned int sign; - len_ones = ones (len); + sign = (x >> (len-1)) & 1; - *result = x & len_ones; + temp = sign_unext (x, len-1); + + return (temp << 1) | sign; } -static INLINE unsigned long -low_sign_extend (x, len) - unsigned int x, len; +static INLINE unsigned int +re_assemble_3 (insn, as3) + unsigned int insn; + unsigned int as3; { - return (int)((x & 0x1 ? (-1 << (len - 1)) : 0) | x >> 1); + return (insn + | ((as3 & 4) << (13-2)) + | ((as3 & 3) << (13+1))); } -static INLINE void -low_sign_unext (x, len, result) - unsigned int x, len; - unsigned int *result; +static INLINE unsigned int +re_assemble_12 (insn, as12) + unsigned int insn; + unsigned int as12; { - unsigned int temp; - unsigned int sign; - unsigned int rest; - unsigned int one_bit_at_len; - unsigned int len_ones; + return (insn + | ((as12 & 0x800) >> 11) + | ((as12 & 0x400) >> (10 - 2)) + | ((as12 & 0x3ff) << (1 + 2))); +} - len_ones = ones (len); - one_bit_at_len = 1 << (len - 1); +static INLINE unsigned int +re_assemble_16 (insn, as16, wide) + unsigned int insn; + unsigned int as16; + int wide; +{ + unsigned int s, t; - sign_unext (x, len, &temp); - sign = temp & one_bit_at_len; - sign >>= (len - 1); + if (wide) + { + /* Unusual 16-bit encoding. */ + t = (as16 << 1) & 0xffff; + s = (as16 & 0x8000); + return insn | (t ^ s ^ (s >> 1)) | (s >> 15); + } + else + { + /* Standard 14-bit encoding. */ + t = (as16 << 1) & 0x3fff; + s = (as16 & 0x2000); + return insn | t | (s >> 13); + } +} + +static INLINE unsigned int +re_assemble_17 (insn, as17) + unsigned int insn; + unsigned int as17; +{ + return (insn + | ((as17 & 0x10000) >> 16) + | ((as17 & 0x0f800) << (16 - 11)) + | ((as17 & 0x00400) >> (10 - 2)) + | ((as17 & 0x003ff) << (1 + 2))); +} - rest = temp & (len_ones ^ one_bit_at_len); - rest <<= 1; +static INLINE unsigned int +re_assemble_21 (insn, as21) + unsigned int insn; + unsigned int as21; +{ + return (insn + | ((as21 & 0x100000) >> 20) + | ((as21 & 0x0ffe00) >> 8) + | ((as21 & 0x000180) << 7) + | ((as21 & 0x00007c) << 14) + | ((as21 & 0x000003) << 12)); +} - *result = rest | sign; +static INLINE unsigned int +re_assemble_22 (insn, as22) + unsigned int insn; + unsigned int as22; +{ + return (insn + | ((as22 & 0x200000) >> 21) + | ((as22 & 0x1f0000) << (21 - 16)) + | ((as22 & 0x00f800) << (16 - 11)) + | ((as22 & 0x000400) >> (10 - 2)) + | ((as22 & 0x0003ff) << (1 + 2))); } -/* Handle field selectors for PA instructions. */ -static INLINE unsigned long -hppa_field_adjust (value, constant_value, r_field) - unsigned long value; - unsigned long constant_value; - unsigned short r_field; +/* Handle field selectors for PA instructions. + The L and R (and LS, RS etc.) selectors are used in pairs to form a + full 32 bit address. eg. + + LDIL L'start,%r1 ; put left part into r1 + LDW R'start(%r1),%r2 ; add r1 and right part to form address + + This function returns sign extended values in all cases. +*/ + +static INLINE bfd_signed_vma +hppa_field_adjust (sym_val, addend, r_field) + bfd_signed_vma sym_val; + bfd_signed_vma addend; + enum hppa_reloc_field_selector_type_alt r_field; { + bfd_signed_vma value; + + value = sym_val + addend; switch (r_field) { - case e_fsel: /* F : no change */ - case e_nsel: /* N : no change */ - value += constant_value; + case e_fsel: + case e_nsel: + /* F: No change. */ break; - case e_lssel: /* LS : if (bit 21) then add 0x800 - arithmetic shift right 11 bits */ - value += constant_value; - if (value & 0x00000400) - value += 0x800; - value = (value & 0xfffff800) >> 11; + case e_lsel: + case e_nlsel: + /* L: Select top 21 bits. */ + value = value >> 11; break; - case e_rssel: /* RS : Sign extend from bit 21 */ - value += constant_value; - if (value & 0x00000400) - value |= 0xfffff800; - else - value &= 0x7ff; + case e_rsel: + /* R: Select bottom 11 bits. */ + value = value & 0x7ff; break; - case e_lsel: /* L : Arithmetic shift right 11 bits */ - case e_nlsel: /* NL : Arithmetic shift right 11 bits */ - value += constant_value; - value = (value & 0xfffff800) >> 11; + case e_lssel: + /* LS: Round to nearest multiple of 2048 then select top 21 bits. */ + value = value + 0x400; + value = value >> 11; break; - case e_rsel: /* R : Set bits 0-20 to zero */ - value += constant_value; - value = value & 0x7ff; + case e_rssel: + /* RS: Select bottom 11 bits for LS. + We need to return a value such that 2048 * LS'x + RS'x == x. + ie. RS'x = x - ((x + 0x400) & -0x800) + this is just a sign extension from bit 21. */ + value = ((value & 0x7ff) ^ 0x400) - 0x400; break; - case e_ldsel: /* LD : Add 0x800, arithmetic shift - right 11 bits */ - value += constant_value; - value += 0x800; - value = (value & 0xfffff800) >> 11; + case e_ldsel: + /* LD: Round to next multiple of 2048 then select top 21 bits. + Yes, if we are already on a multiple of 2048, we go up to the + next one. RD in this case will be -2048. */ + value = value + 0x800; + value = value >> 11; break; - case e_rdsel: /* RD : Set bits 0-20 to one */ - value += constant_value; - value |= 0xfffff800; + case e_rdsel: + /* RD: Set bits 0-20 to one. */ + value = value | -0x800; break; - case e_lrsel: /* LR : L with "rounded" constant */ - case e_nlrsel: /* NLR : NL with "rounded" constant */ - value = value + ((constant_value + 0x1000) & 0xffffe000); - value = (value & 0xfffff800) >> 11; + case e_lrsel: + case e_nlrsel: + /* LR: L with rounding of the addend to nearest 8k. */ + value = sym_val + ((addend + 0x1000) & -0x2000); + value = value >> 11; break; - case e_rrsel: /* RR : R with "rounded" constant */ - value = value + ((constant_value + 0x1000) & 0xffffe000); - value = (value & 0x7ff) + constant_value - ((constant_value + 0x1000) & 0xffffe000); + case e_rrsel: + /* RR: R with rounding of the addend to nearest 8k. + We need to return a value such that 2048 * LR'x + RR'x == x + ie. RR'x = s+a - (s + (((a + 0x1000) & -0x2000) & -0x800)) + . = s+a - ((s & -0x800) + ((a + 0x1000) & -0x2000)) + . = (s & 0x7ff) + a - ((a + 0x1000) & -0x2000) */ + value = (sym_val & 0x7ff) + (((addend & 0x1fff) ^ 0x1000) - 0x1000); break; default: abort (); } return value; - } /* PA-RISC OPCODES */ -#define get_opcode(insn) ((insn) & 0xfc000000) >> 26 +#define get_opcode(insn) (((insn) >> 26) & 0x3f) /* FIXME: this list is incomplete. It should also be an enumerated type rather than #defines. */ @@ -571,9 +604,9 @@ hppa_field_adjust (value, constant_value, r_field) #define STD 0x1c #define LDWL 0x17 #define STWL 0x1f -#define FDLW 0x16 +#define FLDW 0x16 #define FSTW 0x1e - + /* Given a machine instruction, return its format. FIXME: opcodes which do not map to a known format @@ -581,18 +614,17 @@ hppa_field_adjust (value, constant_value, r_field) static INLINE int bfd_hppa_insn2fmt (insn) - unsigned long insn; + unsigned int insn; { - int fmt = -1; unsigned char op = get_opcode (insn); - + switch (op) { case ADDI: case ADDIT: case SUBI: - fmt = 11; - break; + return 11; + case MOVB: case MOVIB: case COMBT: @@ -608,8 +640,8 @@ bfd_hppa_insn2fmt (insn) case CMPBDT: case CMPBDF: case CMPIBD: - fmt = 12; - break; + return 12; + case LDO: case LDB: case LDH: @@ -619,106 +651,57 @@ bfd_hppa_insn2fmt (insn) case STH: case STW: case STWM: - fmt = 14; - break; + return 14; + case LDWL: case STWL: - case FDLW: + case FLDW: case FSTW: /* This is a hack. Unfortunately, format 11 is already taken and we're using integers rather than an enum, so it's hard - to describe the 10a format. */ - fmt = -11; - break; + to describe the 11a format. */ + return -11; + case LDD: case STD: - fmt = 10; - break; + return 10; + case BL: case BE: case BLE: - if ((insn & 0x00008000) == 0x00008000) + if ((insn & 0x00008000) != 0) return 22; - fmt = 17; - break; + return 17; + case LDIL: case ADDIL: - fmt = 21; - break; + return 21; + default: - fmt = 32; break; } - return fmt; + return 32; } /* Insert VALUE into INSN using R_FORMAT to determine exactly what bits to change. */ - -static INLINE unsigned long + +static INLINE unsigned int hppa_rebuild_insn (abfd, insn, value, r_format) bfd *abfd ATTRIBUTE_UNUSED; - unsigned long insn; - unsigned long value; - unsigned long r_format; + unsigned int insn; + unsigned int value; + unsigned int r_format; { - unsigned long const_part; - unsigned long rebuilt_part; - switch (r_format) { - case 11: - { - unsigned w1, w; - - const_part = insn & 0xffffe002; - dis_assemble_12 (value, &w1, &w); - rebuilt_part = (w1 << 2) | w; - return const_part | rebuilt_part; - } - - case 12: - { - unsigned w1, w; - - const_part = insn & 0xffffe002; - dis_assemble_12 (value, &w1, &w); - rebuilt_part = (w1 << 2) | w; - return const_part | rebuilt_part; - } - - case 14: - { - unsigned int ext; - - const_part = insn & 0xffffc000; - low_sign_unext (value, 14, &ext); - return const_part | ext; - } - - case 17: - { - unsigned w1, w2, w; - - const_part = insn & 0xffe0e002; - dis_assemble_17 (value, &w1, &w2, &w); - rebuilt_part = (w2 << 2) | (w1 << 16) | w; - return const_part | rebuilt_part; - } - - case 21: - { - unsigned int w; - - const_part = insn & 0xffe00000; - dis_assemble_21 (value, &w); - return const_part | w; - } - - case 32: - const_part = 0; - return value; + case 11: return (insn & ~ 0x7ff) | low_sign_unext (value, 11); + case 12: return re_assemble_12 (insn & ~ 0x1ffd, value); + case 14: return (insn & ~ 0x3fff) | low_sign_unext (value, 14); + case 17: return re_assemble_17 (insn & ~ 0x1f1ffd, value); + case 21: return re_assemble_21 (insn & ~ 0x1fffff, value); + case 32: return value; default: abort (); diff --git a/bfd/libpei.h b/bfd/libpei.h index 88f9f738229..db47e374818 100644 --- a/bfd/libpei.h +++ b/bfd/libpei.h @@ -192,6 +192,36 @@ PE/PEI rearrangement (and code added): Donn Terry #define PUT_SCNHDR_LNNOPTR bfd_h_put_32 #endif +#ifdef COFF_WITH_PEP64 + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_64 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64 +#define GET_PDATA_ENTRY bfd_get_64 + +#else /* !COFF_WITH_PEP64 */ + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_32 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32 +#define GET_PDATA_ENTRY bfd_get_32 + +#endif /* !COFF_WITH_PEP64 */ + /* These functions are architecture dependent, and are in peicode.h: coff_swap_reloc_in int coff_swap_reloc_out diff --git a/bfd/opncls.c b/bfd/opncls.c index 8f10135d267..57ca0d0a259 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -486,7 +486,7 @@ bfd_close_all_done (abfd) int mask = umask (0); umask (mask); chmod (abfd->filename, - (0x777 + (0777 & (buf.st_mode | ((S_IXUSR | S_IXGRP | S_IXOTH) &~ mask)))); } } diff --git a/bfd/peicode.h b/bfd/peicode.h index 7238c7802e8..1c58ad0800c 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -905,8 +905,8 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX - treat as IMPORT_NAME ??? */ abort (); - * (unsigned int *) id4->contents = ordinal | 0x80000000UL; - * (unsigned int *) id5->contents = ordinal | 0x80000000UL; + * (unsigned int *) id4->contents = ordinal | 0x80000000; + * (unsigned int *) id5->contents = ordinal | 0x80000000; } else { diff --git a/bfd/peigen.c b/bfd/peigen.c index 639ea892565..6c983caad7b 100644 --- a/bfd/peigen.c +++ b/bfd/peigen.c @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI; the common executable parts. - Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -434,11 +434,14 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry); aouthdr_int->text_start = GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start); +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ aouthdr_int->data_start = GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start); +#endif a = &aouthdr_int->pe; - a->ImageBase = bfd_h_get_32 (abfd, (bfd_byte *)src->ImageBase); + a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, (bfd_byte *)src->ImageBase); a->SectionAlignment = bfd_h_get_32 (abfd, (bfd_byte *)src->SectionAlignment); a->FileAlignment = bfd_h_get_32 (abfd, (bfd_byte *)src->FileAlignment); a->MajorOperatingSystemVersion = @@ -455,10 +458,10 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) a->CheckSum = bfd_h_get_32 (abfd, (bfd_byte *)src->CheckSum); a->Subsystem = bfd_h_get_16 (abfd, (bfd_byte *)src->Subsystem); a->DllCharacteristics = bfd_h_get_16 (abfd, (bfd_byte *)src->DllCharacteristics); - a->SizeOfStackReserve = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfStackReserve); - a->SizeOfStackCommit = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfStackCommit); - a->SizeOfHeapReserve = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfHeapReserve); - a->SizeOfHeapCommit = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfHeapCommit); + a->SizeOfStackReserve = GET_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, (bfd_byte *)src->SizeOfStackReserve); + a->SizeOfStackCommit = GET_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, (bfd_byte *)src->SizeOfStackCommit); + a->SizeOfHeapReserve = GET_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, (bfd_byte *)src->SizeOfHeapReserve); + a->SizeOfHeapCommit = GET_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, (bfd_byte *)src->SizeOfHeapCommit); a->LoaderFlags = bfd_h_get_32 (abfd, (bfd_byte *)src->LoaderFlags); a->NumberOfRvaAndSizes = bfd_h_get_32 (abfd, (bfd_byte *)src->NumberOfRvaAndSizes); @@ -476,18 +479,25 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) if (aouthdr_int->entry) { aouthdr_int->entry += a->ImageBase; +#ifndef COFF_WITH_PEP64 aouthdr_int->entry &= 0xffffffff; +#endif } if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; +#ifndef COFF_WITH_PEP64 aouthdr_int->text_start &= 0xffffffff; +#endif } +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ if (aouthdr_int->dsize) { aouthdr_int->data_start += a->ImageBase; aouthdr_int->data_start &= 0xffffffff; } +#endif #ifdef POWERPC_LE_PE /* These three fields are normally set up by ppc_relocate_section. @@ -532,10 +542,28 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *)in; struct internal_extra_pe_aouthdr *extra = &pe_data (abfd)->pe_opthdr; PEAOUTHDR *aouthdr_out = (PEAOUTHDR *)out; + bfd_vma sa, fa, ib; + + /* The following definitely is required for EFI applications. + Perhaps it's needed for other PEI targets as well, but I don't + know that for a fact, so we play it safe here and tweak the + alignments only if PEI_FORCE_MINIMUM_ALIGNMENT is + defined. --davidm */ +#ifdef PEI_FORCE_MINIMUM_ALIGNMENT + if (!extra->FileAlignment) + extra->FileAlignment = PE_DEF_FILE_ALIGNMENT; + if (!extra->SectionAlignment) + extra->SectionAlignment = PE_DEF_SECTION_ALIGNMENT; +#endif + +#ifdef PEI_DEFAULT_TARGET_SUBSYSTEM + if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) + extra->Subsystem = PEI_DEFAULT_TARGET_SUBSYSTEM; +#endif - bfd_vma sa = extra->SectionAlignment; - bfd_vma fa = extra->FileAlignment; - bfd_vma ib = extra->ImageBase ; + sa = extra->SectionAlignment; + fa = extra->FileAlignment; + ib = extra->ImageBase; if (aouthdr_in->tsize) { @@ -566,7 +594,7 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) /* first null out all data directory entries .. */ memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0); - add_data_entry (abfd, extra, 0, ".edata", 0); + add_data_entry (abfd, extra, 0, ".edata", ib); /* Don't call add_data_entry for .idata$2 or .idata$5. It's done in bfd_coff_final_link where all the required information is @@ -574,11 +602,11 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) /* However, until other .idata fixes are made (pending patch), the entry for .idata is needed for backwards compatability. FIXME. */ - add_data_entry (abfd, extra, 1, ".idata" ,0); + add_data_entry (abfd, extra, 1, ".idata" , ib); - add_data_entry (abfd, extra, 2, ".rsrc" ,0); + add_data_entry (abfd, extra, 2, ".rsrc" , ib); - add_data_entry (abfd, extra, 3, ".pdata", 0); + add_data_entry (abfd, extra, 3, ".pdata", ib); /* For some reason, the virtual size (which is what's set by add_data_entry) for .reloc is not the same as the size recorded @@ -586,7 +614,7 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) but since it's the best we've got, use it. It does do the right thing for .pdata. */ if (pe_data (abfd)->has_reloc_section) - add_data_entry (abfd, extra, 5, ".reloc", 0); + add_data_entry (abfd, extra, 5, ".reloc", ib); { asection *sec; @@ -633,12 +661,14 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, (bfd_byte *) aouthdr_out->standard.text_start); +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, (bfd_byte *) aouthdr_out->standard.data_start); +#endif - - bfd_h_put_32 (abfd, extra->ImageBase, - (bfd_byte *) aouthdr_out->ImageBase); + PUT_OPTHDR_IMAGE_BASE (abfd, extra->ImageBase, + (bfd_byte *) aouthdr_out->ImageBase); bfd_h_put_32 (abfd, extra->SectionAlignment, (bfd_byte *) aouthdr_out->SectionAlignment); bfd_h_put_32 (abfd, extra->FileAlignment, @@ -667,14 +697,14 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) (bfd_byte *) aouthdr_out->Subsystem); bfd_h_put_16 (abfd, extra->DllCharacteristics, (bfd_byte *) aouthdr_out->DllCharacteristics); - bfd_h_put_32 (abfd, extra->SizeOfStackReserve, - (bfd_byte *) aouthdr_out->SizeOfStackReserve); - bfd_h_put_32 (abfd, extra->SizeOfStackCommit, - (bfd_byte *) aouthdr_out->SizeOfStackCommit); - bfd_h_put_32 (abfd, extra->SizeOfHeapReserve, - (bfd_byte *) aouthdr_out->SizeOfHeapReserve); - bfd_h_put_32 (abfd, extra->SizeOfHeapCommit, - (bfd_byte *) aouthdr_out->SizeOfHeapCommit); + PUT_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, extra->SizeOfStackReserve, + (bfd_byte *) aouthdr_out->SizeOfStackReserve); + PUT_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, extra->SizeOfStackCommit, + (bfd_byte *) aouthdr_out->SizeOfStackCommit); + PUT_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, extra->SizeOfHeapReserve, + (bfd_byte *) aouthdr_out->SizeOfHeapReserve); + PUT_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, extra->SizeOfHeapCommit, + (bfd_byte *) aouthdr_out->SizeOfHeapCommit); bfd_h_put_32 (abfd, extra->LoaderFlags, (bfd_byte *) aouthdr_out->LoaderFlags); bfd_h_put_32 (abfd, extra->NumberOfRvaAndSizes, @@ -973,7 +1003,7 @@ static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = N_ ("Load Configuration Directory"), N_ ("Bound Import Directory"), N_ ("Import Address Table Directory"), - N_ ("Reserved"), + N_ ("Delay Import Directory"), N_ ("Reserved"), N_ ("Reserved") }; @@ -994,63 +1024,61 @@ pe_print_idata (abfd, vfile) PTR vfile; { FILE *file = (FILE *) vfile; - bfd_byte *data = 0; - asection *section = bfd_get_section_by_name (abfd, ".idata"); - unsigned long adj; + bfd_byte *data; + asection *section; + bfd_signed_vma adj; #ifdef POWERPC_LE_PE asection *rel_section = bfd_get_section_by_name (abfd, ".reldata"); #endif - bfd_size_type datasize; + bfd_size_type datasize = 0; bfd_size_type dataoff; - bfd_size_type secsize; bfd_size_type i; int onaline = 20; pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; - if (section != NULL) + bfd_vma addr; + + addr = extra->DataDirectory[1].VirtualAddress; + + if (addr == 0 && extra->DataDirectory[1].Size == 0) { - datasize = bfd_section_size (abfd, section); - dataoff = 0; + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".idata"); + if (section == NULL) + return true; + addr = section->vma; + datasize = bfd_section_size (abfd, section); if (datasize == 0) return true; - - fprintf (file, _("\nThe import table is the .idata section\n")); } else { - /* idata buried in some other section: e.g. KERNEL32.DLL. */ - bfd_vma addr, size; - - addr = extra->DataDirectory[1].VirtualAddress; - size = extra->DataDirectory[1].Size; - - if (addr == 0 || size == 0) - return true; - + addr += extra->ImageBase; for (section = abfd->sections; section != NULL; section = section->next) { - if (addr >= section->vma - && addr < section->vma + bfd_section_size(abfd,section)) - break; + datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) + break; } + if (section == NULL) { - fprintf (file, - _("\nThere is an import table, but the section containing it could not be found\n")); - return true; + fprintf (file, + _("\nThere is an import table, but the section containing it could not be found\n")); + return true; } + } - fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"), - section->name, (unsigned long)addr); + fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"), + section->name, (unsigned long) addr); - dataoff = addr - section->vma; - datasize = size; - } + dataoff = addr - section->vma; + datasize -= dataoff; #ifdef POWERPC_LE_PE if (rel_section != 0 && bfd_section_size (abfd, rel_section) != 0) @@ -1067,13 +1095,12 @@ pe_print_idata (abfd, vfile) bfd_vma start_address; bfd_byte *data = 0; int offset; + data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, rel_section)); if (data == NULL && bfd_section_size (abfd, rel_section) != 0) return false; - datasize = bfd_section_size (abfd, rel_section); - bfd_get_section_contents (abfd, rel_section, (PTR) data, 0, @@ -1081,8 +1108,8 @@ pe_print_idata (abfd, vfile) offset = abfd->start_address - rel_section->vma; - start_address = bfd_get_32(abfd, data+offset); - loadable_toc_address = bfd_get_32(abfd, data+offset+4); + start_address = bfd_get_32 (abfd, data + offset); + loadable_toc_address = bfd_get_32 (abfd, data + offset + 4); toc_address = loadable_toc_address - 32768; fprintf(file, @@ -1100,21 +1127,23 @@ pe_print_idata (abfd, vfile) #endif fprintf(file, - _("\nThe Import Tables (interpreted .idata section contents)\n")); + _("\nThe Import Tables (interpreted %s section contents)\n"), + section->name); fprintf(file, _(" vma: Hint Time Forward DLL First\n")); fprintf(file, _(" Table Stamp Chain Name Thunk\n")); - secsize = bfd_section_size (abfd, section); - data = (bfd_byte *) bfd_malloc (secsize); - if (data == NULL && secsize != 0) + data = (bfd_byte *) bfd_malloc (dataoff + datasize); + if (data == NULL) return false; - if (! bfd_get_section_contents (abfd, section, (PTR) data, 0, secsize)) + /* Read the whole section. Some of the fields might be before dataoff. */ + if (! bfd_get_section_contents (abfd, section, (PTR) data, + 0, dataoff + datasize)) return false; - adj = - section->vma; + adj = section->vma - extra->ImageBase; for (i = 0; i < datasize; i += onaline) { @@ -1127,10 +1156,9 @@ pe_print_idata (abfd, vfile) bfd_size_type j; char *dll; - fprintf (file, - " %08lx\t", - (unsigned long int) (i + section->vma + dataoff)); - + /* print (i + extra->DataDirectory[1].VirtualAddress) */ + fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); + if (i + 20 > datasize) { /* check stuff */ @@ -1144,23 +1172,23 @@ pe_print_idata (abfd, vfile) first_thunk = bfd_get_32 (abfd, data + i + 16 + dataoff); fprintf (file, "%08lx %08lx %08lx %08lx %08lx\n", - hint_addr, - time_stamp, - forward_chain, - dll_name, - first_thunk); + (unsigned long) hint_addr, + (unsigned long) time_stamp, + (unsigned long) forward_chain, + (unsigned long) dll_name, + (unsigned long) first_thunk); if (hint_addr == 0 && first_thunk == 0) break; - dll = (char *) data + dll_name - section->vma + dataoff; + dll = (char *) data + dll_name - adj; fprintf(file, _("\n\tDLL Name: %s\n"), dll); if (hint_addr != 0) { fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); - idx = hint_addr + adj; + idx = hint_addr - adj; for (j = 0; j < datasize; j += 4) { @@ -1176,8 +1204,8 @@ pe_print_idata (abfd, vfile) int ordinal; char *member_name; - ordinal = bfd_get_16 (abfd, data + member + adj); - member_name = (char *) data + member + adj + 2; + ordinal = bfd_get_16 (abfd, data + member - adj); + member_name = (char *) data + member - adj + 2; fprintf (file, "\t%04lx\t %4d %s", member, ordinal, member_name); } @@ -1188,7 +1216,7 @@ pe_print_idata (abfd, vfile) && first_thunk != 0 && first_thunk != hint_addr) fprintf (file, "\t%04lx", - bfd_get_32 (abfd, data + first_thunk + adj + j)); + (long) bfd_get_32 (abfd, data + first_thunk - adj + j)); fprintf (file, "\n"); } @@ -1199,7 +1227,7 @@ pe_print_idata (abfd, vfile) int differ = 0; int idx2; - idx2 = first_thunk + adj; + idx2 = first_thunk - adj; for (j = 0; j < datasize; j += 4) { @@ -1231,11 +1259,12 @@ pe_print_idata (abfd, vfile) } else { - ordinal = bfd_get_16(abfd, - data + iat_member + adj); - member_name = (char *) data + iat_member + adj + 2; + ordinal = bfd_get_16 (abfd, data + iat_member - adj); + member_name = (char *) data + iat_member - adj + 2; fprintf(file, "\t%04lx\t %4d %s\n", - iat_member, ordinal, member_name); + (unsigned long) iat_member, + ordinal, + member_name); } } @@ -1264,14 +1293,14 @@ pe_print_edata (abfd, vfile) PTR vfile; { FILE *file = (FILE *) vfile; - bfd_byte *data = 0; - asection *section = bfd_get_section_by_name (abfd, ".edata"); + bfd_byte *data; + asection *section; - bfd_size_type datasize; + bfd_size_type datasize = 0; bfd_size_type dataoff; bfd_size_type i; - int adj; + bfd_signed_vma adj; struct EDT_type { long export_flags; /* reserved - should be zero */ @@ -1290,45 +1319,48 @@ pe_print_edata (abfd, vfile) pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; - if (section != NULL) + bfd_vma addr; + + addr = extra->DataDirectory[0].VirtualAddress; + + if (addr == 0 && extra->DataDirectory[0].Size == 0) { + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".edata"); + if (section == NULL) + return true; + + addr = section->vma; datasize = bfd_section_size (abfd, section); - dataoff = 0; - fprintf (file, _("\nThe export table is the .edata section\n")); + if (datasize == 0) + return true; } else { - /* edata is buried in some other section: e.g. NTDLL.DLL. */ - bfd_vma addr, size; - - addr = extra->DataDirectory[0].VirtualAddress; - size = extra->DataDirectory[0].Size; - - if (addr == 0 || size == 0) - return true; - + addr += extra->ImageBase; for (section = abfd->sections; section != NULL; section = section->next) { - if (addr >= section->vma - && addr < section->vma + bfd_section_size (abfd, section)) - break; + datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) + break; } + if (section == NULL) { - fprintf (file, - _("\nThere is an export table, but the section containing it could not be found\n")); - return true; + fprintf (file, + _("\nThere is an export table, but the section containing it could not be found\n")); + return true; } + } - fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), - section->name, (unsigned long) addr); + fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), + section->name, (unsigned long) addr); - datasize = size; - dataoff = addr - section->vma; - } + dataoff = addr - section->vma; + datasize -= dataoff; data = (bfd_byte *) bfd_malloc (datasize); - if (data == NULL && datasize != 0) + if (data == NULL) return false; if (! bfd_get_section_contents (abfd, section, (PTR) data, dataoff, @@ -1348,11 +1380,12 @@ pe_print_edata (abfd, vfile) edt.npt_addr = bfd_get_32(abfd, data+32); edt.ot_addr = bfd_get_32(abfd, data+36); - adj = - (section->vma + dataoff); + adj = section->vma - extra->ImageBase + dataoff; /* Dump the EDT first first */ fprintf(file, - _("\nThe Export Tables (interpreted .edata section contents)\n\n")); + _("\nThe Export Tables (interpreted %s section contents)\n\n"), + section->name); fprintf(file, _("Export Flags \t\t\t%lx\n"), (unsigned long) edt.export_flags); @@ -1367,7 +1400,7 @@ pe_print_edata (abfd, vfile) _("Name \t\t\t\t")); fprintf_vma (file, edt.name); fprintf (file, - " %s\n", data + edt.name + adj); + " %s\n", data + edt.name - adj); fprintf(file, _("Ordinal Base \t\t\t%ld\n"), edt.base); @@ -1376,11 +1409,11 @@ pe_print_edata (abfd, vfile) _("Number in:\n")); fprintf(file, - _("\tExport Address Table \t\t%lx\n"), + _("\tExport Address Table \t\t%08lx\n"), edt.num_functions); fprintf(file, - _("\t[Name Pointer/Ordinal] Table\t%lu\n"), edt.num_names); + _("\t[Name Pointer/Ordinal] Table\t%08lx\n"), edt.num_names); fprintf(file, _("Table Addresses\n")); @@ -1418,29 +1451,30 @@ pe_print_edata (abfd, vfile) for (i = 0; i < edt.num_functions; ++i) { bfd_vma eat_member = bfd_get_32 (abfd, - data + edt.eat_addr + (i * 4) + adj); - bfd_vma eat_actual = eat_member; - bfd_vma edata_start = bfd_get_section_vma (abfd, section); - bfd_vma edata_end = edata_start + datasize; - + data + edt.eat_addr + (i * 4) - adj); if (eat_member == 0) continue; - if (edata_start < eat_actual && eat_actual < edata_end) + if (eat_member - adj <= datasize) { - /* this rva is to a name (forwarding function) in our section */ + /* This rva is to a name (forwarding function) in our section. */ /* Should locate a function descriptor */ fprintf (file, "\t[%4ld] +base[%4ld] %04lx %s -- %s\n", - (long) i, (long) (i + edt.base), eat_member, - _("Forwarder RVA"), data + eat_member + adj); + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, + _("Forwarder RVA"), + data + eat_member - adj); } else { /* Should locate a function descriptor in the reldata section */ fprintf (file, "\t[%4ld] +base[%4ld] %04lx %s\n", - (long) i, (long) (i + edt.base), eat_member, + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, _("Export RVA")); } } @@ -1455,14 +1489,14 @@ pe_print_edata (abfd, vfile) bfd_vma name_ptr = bfd_get_32(abfd, data + edt.npt_addr - + (i*4) + adj); + + (i*4) - adj); - char *name = (char *) data + name_ptr + adj; + char *name = (char *) data + name_ptr - adj; bfd_vma ord = bfd_get_16(abfd, data + edt.ot_addr - + (i*2) + adj); + + (i*2) - adj); fprintf(file, "\t[%4ld] %s\n", (long) ord, name); @@ -1473,18 +1507,27 @@ pe_print_edata (abfd, vfile) return true; } +/* This really is architecture dependent. On IA-64, a .pdata entry + consists of three dwords containing relative virtual addresses that + specify the start and end address of the code range the entry + covers and the address of the corresponding unwind info data. */ static boolean pe_print_pdata (abfd, vfile) bfd *abfd; PTR vfile; { +#ifdef COFF_WITH_PEP64 +# define PDATA_ROW_SIZE (3*8) +#else +# define PDATA_ROW_SIZE (5*4) +#endif FILE *file = (FILE *) vfile; bfd_byte *data = 0; asection *section = bfd_get_section_by_name (abfd, ".pdata"); bfd_size_type datasize = 0; bfd_size_type i; bfd_size_type start, stop; - int onaline = 20; + int onaline = PDATA_ROW_SIZE; if (section == NULL || coff_section_data (abfd, section) == NULL @@ -1498,10 +1541,15 @@ pe_print_pdata (abfd, vfile) fprintf (file, _("\nThe Function Table (interpreted .pdata section contents)\n")); +#ifdef COFF_WITH_PEP64 + fprintf(file, + _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); +#else fprintf (file, _(" vma:\t\tBegin End EH EH PrologEnd Exception\n")); fprintf (file, _(" \t\tAddress Address Handler Data Address Mask\n")); +#endif if (bfd_section_size (abfd, section) == 0) return true; @@ -1527,14 +1575,14 @@ pe_print_pdata (abfd, vfile) bfd_vma prolog_end_addr; int em_data; - if (i + 20 > stop) + if (i + PDATA_ROW_SIZE > stop) break; - begin_addr = bfd_get_32(abfd, data+i); - end_addr = bfd_get_32(abfd, data+i+4); - eh_handler = bfd_get_32(abfd, data+i+8); - eh_data = bfd_get_32(abfd, data+i+12); - prolog_end_addr = bfd_get_32(abfd, data+i+16); + begin_addr = GET_PDATA_ENTRY(abfd, data+i); + end_addr = GET_PDATA_ENTRY(abfd, data+i+4); + eh_handler = GET_PDATA_ENTRY(abfd, data+i+8); + eh_data = GET_PDATA_ENTRY(abfd, data+i+12); + prolog_end_addr = GET_PDATA_ENTRY(abfd, data+i+16); if (begin_addr == 0 && end_addr == 0 && eh_handler == 0 && eh_data == 0 && prolog_end_addr == 0) @@ -1543,21 +1591,21 @@ pe_print_pdata (abfd, vfile) break; } - fprintf (file, - " %08lx\t", - (unsigned long int) (i + section->vma)); - em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3); - eh_handler &= 0xfffffffc; - prolog_end_addr &= 0xfffffffc; - - fprintf (file, "%08lx %08lx %08lx %08lx %08lx %x", - begin_addr, - end_addr, - eh_handler, - eh_data, - prolog_end_addr, - em_data); + eh_handler &= ~ (bfd_vma) 0x3; + prolog_end_addr &= ~ (bfd_vma) 0x3; + + fputc (' ', file); + fprintf_vma (file, i + section->vma); fputc ('\t', file); + fprintf_vma (file, begin_addr); fputc (' ', file); + fprintf_vma (file, end_addr); fputc (' ', file); + fprintf_vma (file, eh_handler); +#ifndef COFF_WITH_PEP64 + fputc (' ', file); + fprintf_vma (file, eh_data); fputc (' ', file); + fprintf_vma (file, prolog_end_addr); + fprintf (file, " %x", em_data); +#endif #ifdef POWERPC_LE_PE if (eh_handler == 0 && eh_data != 0) @@ -1603,6 +1651,12 @@ static const char * const tbl[] = "HIGHLOW", "HIGHADJ", "MIPS_JMPADDR", +"SECTION", +"REL32", +"RESERVED1", +"MIPS_JMPADDR16", +"DIR64", +"HIGH3ADJ" "UNKNOWN", /* MUST be last */ }; @@ -1661,7 +1715,7 @@ pe_print_reloc (abfd, vfile) fprintf (file, _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), - virtual_address, size, size, number); + (unsigned long) virtual_address, size, size, number); for (j = 0; j < number; ++j) { @@ -1707,6 +1761,7 @@ _bfd_pe_print_private_bfd_data_common (abfd, vfile) int j; pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; + const char *subsystem_name = NULL; /* The MS dumpbin program reportedly ands with 0xff0f before printing the characteristics field. Not sure why. No reason to @@ -1740,12 +1795,44 @@ _bfd_pe_print_private_bfd_data_common (abfd, vfile) fprintf (file,"MinorImageVersion\t%d\n", i->MinorImageVersion); fprintf (file,"MajorSubsystemVersion\t%d\n", i->MajorSubsystemVersion); fprintf (file,"MinorSubsystemVersion\t%d\n", i->MinorSubsystemVersion); - fprintf (file,"Reserved1\t\t%08lx\n", i->Reserved1); + fprintf (file,"Win32Version\t\t%08lx\n", i->Reserved1); fprintf (file,"SizeOfImage\t\t%08lx\n", i->SizeOfImage); fprintf (file,"SizeOfHeaders\t\t%08lx\n", i->SizeOfHeaders); fprintf (file,"CheckSum\t\t%08lx\n", i->CheckSum); - fprintf (file,"Subsystem\t\t%08x\n", i->Subsystem); - fprintf (file,"DllCharacteristics\t%08x\n", i->DllCharacteristics); + switch (i->Subsystem) + { + case IMAGE_SUBSYSTEM_UNKNOWN: + subsystem_name = "unspecified"; + break; + case IMAGE_SUBSYSTEM_NATIVE: + subsystem_name = "NT native"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_GUI: + subsystem_name = "Windows GUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CUI: + subsystem_name = "Windows CUI"; + break; + case IMAGE_SUBSYSTEM_POSIX_CUI: + subsystem_name = "POSIX CUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: + subsystem_name = "Wince CUI"; + break; + case IMAGE_SUBSYSTEM_EFI_APPLICATION: + subsystem_name = "EFI application"; + break; + case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: + subsystem_name = "EFI boot service driver"; + break; + case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: + subsystem_name = "EFI runtime driver"; + break; + } + fprintf (file,"Subsystem\t\t%08x", i->Subsystem); + if (subsystem_name) + fprintf (file, "\t(%s)", subsystem_name); + fprintf (file,"\nDllCharacteristics\t%08x\n", i->DllCharacteristics); fprintf (file,"SizeOfStackReserve\t"); fprintf_vma (file, i->SizeOfStackReserve); fprintf (file,"\nSizeOfStackCommit\t"); diff --git a/bfd/po/POTFILES.in b/bfd/po/POTFILES.in index 51a980bf710..94b82823eed 100644 --- a/bfd/po/POTFILES.in +++ b/bfd/po/POTFILES.in @@ -119,6 +119,8 @@ elf32-v850.c elf32.c elf64-alpha.c elf64-gen.c +elf64-hppa.c +elf64-hppa.h elf64-mips.c elf64-sparc.c elf64.c diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index d9db8268d47..9441848b3d3 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -64,7 +64,11 @@ typedef struct ppcboot_hdr { bfd_byte os_id; /* OS_ID */ char partition_name[32]; /* partition name */ bfd_byte reserved1[470]; /* reserved */ -} ppcboot_hdr_t; +} +#ifdef __GNUC__ + __attribute__ ((packed)) +#endif +ppcboot_hdr_t; /* Signature bytes for last 2 bytes of the 512 byte record */ #define SIGNATURE0 0x55 diff --git a/bfd/reloc.c b/bfd/reloc.c index 8823c6ce53e..7b86e37be30 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -25,7 +25,7 @@ SECTION BFD maintains relocations in much the same way it maintains symbols: they are left alone until required, then read in - en-mass and translated into an internal form. A common + en-masse and translated into an internal form. A common routine <> acts upon the canonical form to do the fixup. @@ -729,6 +729,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 + && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0 && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) @@ -1125,6 +1126,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 + && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0 && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) @@ -1498,11 +1500,9 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location) trouble; we would need to verify that B is in range, as we do for A above. */ signmask = ((~ howto->src_mask) >> 1) & howto->src_mask; - if ((b & signmask) != 0) - { - /* Set all the bits above the sign bit. */ - b -= signmask << 1; - } + + /* Set all the bits above the sign bit. */ + b = (b ^ signmask) - signmask; b = (b & addrmask) >> bitpos; @@ -1545,7 +1545,7 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location) case complain_overflow_bitfield: /* Much like the signed check, but for a field one bit - wider, and no trimming with addrmask. We allow a + wider, and no trimming inputs with addrmask. We allow a bitfield to represent numbers in the range -2**n to 2**n-1, where n is the number of bits in the field. Note that when bfd_vma is 32 bits, a 32-bit reloc can't @@ -1558,15 +1558,19 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location) flag = bfd_reloc_overflow; signmask = ((~ howto->src_mask) >> 1) & howto->src_mask; - if ((b & signmask) != 0) - b -= signmask << 1; + b = (b ^ signmask) - signmask; b >>= bitpos; sum = a + b; + /* We mask with addrmask here to explicitly allow an address + wrap-around. The Linux kernel relies on it, and it is + the only way to write assembler code which can run when + loaded at a location 0x80000000 away from the location at + which it is linked. */ signmask = fieldmask + 1; - if (((~ (a ^ b)) & (a ^ sum)) & signmask) + if (((~ (a ^ b)) & (a ^ sum)) & signmask & addrmask) flag = bfd_reloc_overflow; break; @@ -2747,6 +2751,142 @@ ENUMDOC is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. +ENUM + BFD_RELOC_IA64_IMM14 +ENUMX + BFD_RELOC_IA64_IMM22 +ENUMX + BFD_RELOC_IA64_IMM64 +ENUMX + BFD_RELOC_IA64_DIR32MSB +ENUMX + BFD_RELOC_IA64_DIR32LSB +ENUMX + BFD_RELOC_IA64_DIR64MSB +ENUMX + BFD_RELOC_IA64_DIR64LSB +ENUMX + BFD_RELOC_IA64_GPREL22 +ENUMX + BFD_RELOC_IA64_GPREL64I +ENUMX + BFD_RELOC_IA64_GPREL32MSB +ENUMX + BFD_RELOC_IA64_GPREL32LSB +ENUMX + BFD_RELOC_IA64_GPREL64MSB +ENUMX + BFD_RELOC_IA64_GPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF22 +ENUMX + BFD_RELOC_IA64_LTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF22 +ENUMX + BFD_RELOC_IA64_PLTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF64MSB +ENUMX + BFD_RELOC_IA64_PLTOFF64LSB +ENUMX + BFD_RELOC_IA64_FPTR64I +ENUMX + BFD_RELOC_IA64_FPTR32MSB +ENUMX + BFD_RELOC_IA64_FPTR32LSB +ENUMX + BFD_RELOC_IA64_FPTR64MSB +ENUMX + BFD_RELOC_IA64_FPTR64LSB +ENUMX + BFD_RELOC_IA64_PCREL21B +ENUMX + BFD_RELOC_IA64_PCREL21BI +ENUMX + BFD_RELOC_IA64_PCREL21M +ENUMX + BFD_RELOC_IA64_PCREL21F +ENUMX + BFD_RELOC_IA64_PCREL22 +ENUMX + BFD_RELOC_IA64_PCREL60B +ENUMX + BFD_RELOC_IA64_PCREL64I +ENUMX + BFD_RELOC_IA64_PCREL32MSB +ENUMX + BFD_RELOC_IA64_PCREL32LSB +ENUMX + BFD_RELOC_IA64_PCREL64MSB +ENUMX + BFD_RELOC_IA64_PCREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR22 +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64I +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64MSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64LSB +ENUMX + BFD_RELOC_IA64_SEGBASE +ENUMX + BFD_RELOC_IA64_SEGREL32MSB +ENUMX + BFD_RELOC_IA64_SEGREL32LSB +ENUMX + BFD_RELOC_IA64_SEGREL64MSB +ENUMX + BFD_RELOC_IA64_SEGREL64LSB +ENUMX + BFD_RELOC_IA64_SECREL32MSB +ENUMX + BFD_RELOC_IA64_SECREL32LSB +ENUMX + BFD_RELOC_IA64_SECREL64MSB +ENUMX + BFD_RELOC_IA64_SECREL64LSB +ENUMX + BFD_RELOC_IA64_REL32MSB +ENUMX + BFD_RELOC_IA64_REL32LSB +ENUMX + BFD_RELOC_IA64_REL64MSB +ENUMX + BFD_RELOC_IA64_REL64LSB +ENUMX + BFD_RELOC_IA64_LTV32MSB +ENUMX + BFD_RELOC_IA64_LTV32LSB +ENUMX + BFD_RELOC_IA64_LTV64MSB +ENUMX + BFD_RELOC_IA64_LTV64LSB +ENUMX + BFD_RELOC_IA64_IPLTMSB +ENUMX + BFD_RELOC_IA64_IPLTLSB +ENUMX + BFD_RELOC_IA64_EPLTMSB +ENUMX + BFD_RELOC_IA64_EPLTLSB +ENUMX + BFD_RELOC_IA64_COPY +ENUMX + BFD_RELOC_IA64_TPREL22 +ENUMX + BFD_RELOC_IA64_TPREL64MSB +ENUMX + BFD_RELOC_IA64_TPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_TP22 +ENUMX + BFD_RELOC_IA64_LTOFF22X +ENUMX + BFD_RELOC_IA64_LDXMOV +ENUMDOC + Intel IA64 Relocations. ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT diff --git a/bfd/som.c b/bfd/som.c index cd61cc6c4bb..542b69f7380 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -5365,6 +5365,8 @@ som_decode_symclass (symbol) return 'U'; if (bfd_is_ind_section (symbol->section)) return 'I'; + if (symbol->flags & BSF_WEAK) + return 'W'; if (!(symbol->flags & (BSF_GLOBAL|BSF_LOCAL))) return '?'; diff --git a/bfd/sysdep.h b/bfd/sysdep.h index 0a58983fa2d..bf3eac03ccb 100644 --- a/bfd/sysdep.h +++ b/bfd/sysdep.h @@ -1,5 +1,5 @@ /* sysdep.h -- handle host dependencies for the BFD library - Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -102,6 +102,8 @@ extern char *strrchr (); #define SEEK_CUR 1 #endif +#include "filenames.h" + #ifdef NEED_DECLARATION_STRSTR extern char *strstr (); #endif @@ -124,6 +126,18 @@ extern char *getenv (); #ifdef ENABLE_NLS #include +/* Note the use of dgetext() and PACKAGE here, rather than gettext(). + + This is because the code in this directory is used to build a library which + will be linked with code in other directories to form programs. We want to + maintain a seperate translation file for this directory however, rather + than being forced to merge it with that of any program linked to libbfd. + This is a library, so it cannot depend on the catalog currently loaded. + + In order to do this, we have to make sure that when we extract messages we + use the OPCODES domain rather than the domain of the program that included + the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String) + and define PACKAGE to be 'bfd'. (See the code in configure). */ #define _(String) dgettext (PACKAGE, String) #ifdef gettext_noop #define N_(String) gettext_noop (String) @@ -131,14 +145,13 @@ extern char *getenv (); #define N_(String) (String) #endif #else -/* Stubs that do something close enough. */ -#define textdomain(String) (String) -#define gettext(String) (String) -#define dgettext(Domain,Message) (Message) -#define dcgettext(Domain,Message,Type) (Message) -#define bindtextdomain(Domain,Directory) (Domain) -#define _(String) (String) -#define N_(String) (String) +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +# define _(String) (String) +# define N_(String) (String) #endif #endif /* ! defined (BFD_SYSDEP_H) */ diff --git a/bfd/targets.c b/bfd/targets.c index e54eb29a717..14215529403 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -505,7 +505,12 @@ extern const bfd_target arm_epoc_pei_little_vec; extern const bfd_target arm_epoc_pei_big_vec; extern const bfd_target b_out_vec_big_host; extern const bfd_target b_out_vec_little_host; +extern const bfd_target bfd_efi_app_ia32_vec; +extern const bfd_target bfd_efi_app_ia64_vec; extern const bfd_target bfd_elf64_alpha_vec; +extern const bfd_target bfd_elf64_hppa_vec; +extern const bfd_target bfd_elf64_ia64_little_vec; +extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf32_avr_vec; extern const bfd_target bfd_elf32_bigarc_vec; extern const bfd_target bfd_elf32_bigarm_vec; @@ -609,6 +614,7 @@ extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; extern const bfd_target pmac_xcoff_vec; extern const bfd_target rs6000coff_vec; +extern const bfd_target rs6000coff64_vec; extern const bfd_target shcoff_vec; extern const bfd_target shlcoff_vec; extern const bfd_target shcoff_small_vec; @@ -689,6 +695,11 @@ const bfd_target * const bfd_target_vector[] = { &b_out_vec_big_host, &b_out_vec_little_host, + &bfd_efi_app_ia32_vec, +#ifdef BFD64 + &bfd_efi_app_ia64_vec, +#endif + /* This, and other vectors, may not be used in any *.mt configuration. But that does not mean they are unnecessary. If configured with --enable-targets=all, objdump or gdb should be able to examine @@ -696,6 +707,9 @@ const bfd_target * const bfd_target_vector[] = { &bfd_elf32_big_generic_vec, #ifdef BFD64 &bfd_elf64_alpha_vec, + &bfd_elf64_hppa_vec, + &bfd_elf64_ia64_little_vec, + &bfd_elf64_ia64_big_vec, #endif &bfd_elf32_avr_vec, &bfd_elf32_bigarc_vec, @@ -707,9 +721,7 @@ const bfd_target * const bfd_target_vector[] = { #endif &bfd_elf32_d10v_vec, &bfd_elf32_d30v_vec, -#if 0 &bfd_elf32_hppa_vec, -#endif &bfd_elf32_i370_vec, &bfd_elf32_i386_vec, &bfd_elf32_i860_vec, @@ -854,6 +866,9 @@ const bfd_target * const bfd_target_vector[] = { &pmac_xcoff_vec, #endif &rs6000coff_vec, +#ifdef BFD64 + &rs6000coff64_vec, +#endif &ppcboot_vec, &shcoff_vec, &shlcoff_vec, diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 633c53d9838..9cd12c04aee 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -25,7 +25,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" /* BFD a.out internal data structures */ #include -#include +#ifdef HAVE_DIRENT_H +# include +#else +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +#endif #include #include /* After a.out.h */ @@ -112,7 +124,7 @@ trad_unix_core_file_p (abfd) + u.u_ssize)) > (unsigned long) statbuf.st_size) { - bfd_set_error (bfd_error_file_truncated); + bfd_set_error (bfd_error_wrong_format); return 0; } #ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE diff --git a/bfd/versados.c b/bfd/versados.c index 27f4f882088..d3ebda4c595 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -1,5 +1,5 @@ /* BFD back-end for VERSAdos-E objects. - Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . Versados is a Motorola trademark. @@ -483,10 +483,12 @@ versados_scan (abfd) int j; int nsecs = 0; + VDATA (abfd)->stringlen = 0; VDATA (abfd)->nrefs = 0; VDATA (abfd)->ndefs = 0; VDATA (abfd)->ref_idx = 0; VDATA (abfd)->def_idx = 0; + VDATA (abfd)->pass_2_done = 0; while (loop) { diff --git a/bfd/vms.c b/bfd/vms.c index f0ea63ff92d..5f91ba42037 100644 --- a/bfd/vms.c +++ b/bfd/vms.c @@ -1,6 +1,6 @@ /* vms.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1996, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -1045,7 +1045,7 @@ vms_openr_next_archived_file (arch, prev) #if VMS_DEBUG vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev); #endif - return false; + return NULL; } diff --git a/bfd/xcoff-target.h b/bfd/xcoff-target.h new file mode 100644 index 00000000000..a103ac9c8a6 --- /dev/null +++ b/bfd/xcoff-target.h @@ -0,0 +1,198 @@ +/* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. + Copyright 2000 + Free Software Foundation, Inc. + Contributed by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Internalcoff.h and coffcode.h modify themselves based on this flag. */ +#define RS6000COFF_C 1 + +#define SELECT_RELOC(internal, howto) \ + { \ + internal.r_type = howto->type; \ + internal.r_size = \ + ((howto->complain_on_overflow == complain_overflow_signed \ + ? 0x80 \ + : 0) \ + | (howto->bitsize - 1)); \ + } + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) + +#define COFF_LONG_FILENAMES + +#define NO_COFF_SYMBOLS + +#define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst) + +#define coff_mkobject _bfd_xcoff_mkobject +#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data +#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name +#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup +#define coff_relocate_section _bfd_ppc_xcoff_relocate_section + +#define CORE_FILE_P _bfd_dummy_target + +#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command +#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal +#define coff_core_file_matches_executable_p \ + _bfd_nocore_core_file_matches_executable_p + +#ifdef AIX_CORE +#undef CORE_FILE_P +#define CORE_FILE_P rs6000coff_core_p +extern const bfd_target * rs6000coff_core_p (); +extern boolean rs6000coff_get_section_contents (); +extern boolean rs6000coff_core_file_matches_executable_p (); + +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p \ + rs6000coff_core_file_matches_executable_p + +extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command rs6000coff_core_file_failing_command + +extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal + +#undef coff_get_section_contents +#define coff_get_section_contents rs6000coff_get_section_contents +#endif /* AIX_CORE */ + +#ifdef LYNX_CORE + +#undef CORE_FILE_P +#define CORE_FILE_P lynx_core_file_p +extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd)); + +extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd, + bfd *exec_bfd)); +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p + +extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command lynx_core_file_failing_command + +extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal lynx_core_file_failing_signal + +#endif /* LYNX_CORE */ + +#define _bfd_xcoff_bfd_get_relocated_section_contents \ + coff_bfd_get_relocated_section_contents +#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section +#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections +#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section + +/* XCOFF archives do not have anything which corresponds to an + extended name table. */ + +#define _bfd_xcoff_slurp_extended_name_table bfd_false +#define _bfd_xcoff_construct_extended_name_table \ + ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + bfd_false) +#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname + +/* We can use the standard get_elt_at_index routine. */ + +#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index + +/* XCOFF archives do not have a timestamp. */ + +#define _bfd_xcoff_update_armap_timestamp bfd_true + +extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *)); +extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *)); +extern void _bfd_xcoff_rtype2howto + PARAMS ((arelent *, struct internal_reloc *)); +extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *)); +extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *)); +extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *)); +extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); +extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +extern boolean _bfd_xcoff_write_armap + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean)); +extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); +extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + +#ifndef coff_SWAP_sym_in +#define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in +#define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out +#define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in +#define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out +#endif + +#include "coffcode.h" + +/* The transfer vector that leads the outside world to all of the above. */ + +const bfd_target TARGET_SYM = +{ + TARGET_NAME, + bfd_target_coff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | DYNAMIC | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen??? FIXMEmgo */ + + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + _bfd_xcoff_archive_p, CORE_FILE_P}, + {bfd_false, coff_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_xcoff_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (coff), + BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (_bfd_xcoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 3f488d7f382..17517b08b2f 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ whole approach. */ #define XCOFF_XVECP(xv) \ (strcmp ((xv)->name, "aixcoff-rs6000") == 0 \ + || strcmp ((xv)->name, "aixcoff64-rs6000") == 0 \ || strcmp ((xv)->name, "xcoff-powermac") == 0) /* Get the XCOFF hash table entries for a BFD. */ diff --git a/config.guess b/config.guess index 20c971aae9a..b4faaedca09 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-05-30' + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -36,6 +38,46 @@ # (but try to keep the structure clean). # +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of this system. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then @@ -266,7 +308,7 @@ EOF exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor + # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not @@ -360,7 +402,7 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] @@ -458,6 +500,8 @@ EOF 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE #include #include @@ -588,7 +632,7 @@ EOF echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos @@ -604,7 +648,7 @@ EOF hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -614,12 +658,6 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) @@ -670,6 +708,10 @@ EOF echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; + elf_i?86) + echo "${UNAME_MACHINE}-pc-linux" + exit 0 + ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 @@ -721,11 +763,15 @@ EOF if test "$?" = 0 ; then LIBC="libc1" fi - fi + fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then @@ -1018,14 +1064,26 @@ EOF *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; - Power*:Mac*OS:*:*) - echo powerpc-apple-macos${UNAME_RELEASE} + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; - *:Mac*OS:*:*) - echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE} + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) - echo i386-qnx-qnx${UNAME_VERSION} + echo i386-pc-qnx + exit 0 ;; + NSR-W:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; esac @@ -1166,6 +1224,47 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess version = $version + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub index 5d756240452..f414a431e81 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,9 @@ # Configuration validation subroutine script, version 1.1. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-05-30' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -50,30 +52,61 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -174,7 +207,9 @@ case $basic_machine in tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ @@ -207,7 +242,9 @@ case $basic_machine in | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ @@ -219,7 +256,8 @@ case $basic_machine in | mipstx39-* | mipstx39el-* | mcore-* \ | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -471,9 +509,6 @@ case $basic_machine in basic_machine=i386-unknown os=-mingw32 ;; - i386-qnx | qnx) - basic_machine=i386-qnx - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -596,6 +631,9 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -933,9 +971,22 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) @@ -982,6 +1033,9 @@ case $os in -ns2 ) os=-nextstep2 ;; + -nsk) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -995,9 +1049,6 @@ case $os in -oss*) os=-sysv3 ;; - -qnx) - os=-qnx4 - ;; -svr4) os=-sysv4 ;; @@ -1248,3 +1299,11 @@ case $basic_machine in esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure.in b/configure.in index ca1b04f9dc8..c14f135056e 100644 --- a/configure.in +++ b/configure.in @@ -656,7 +656,8 @@ case "${target}" in ;; hppa*-*-*elf* | \ hppa*-*-linux-gnu* | \ - hppa*-*-lites*) + hppa*-*-lites* | \ + hppa*64*-*-*) # Do configure ld/binutils/gas for the above cases. ;; hppa*-*-*) @@ -669,6 +670,10 @@ case "${target}" in esac noconfigdirs="$noconfigdirs ld shellutils" ;; + ia64*-*-elf*) + # No gdb support yet. + noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" + ;; i[3456]86-*-coff | i[3456]86-*-elf) if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-libstub target-cygmon" @@ -1047,6 +1052,9 @@ if [ x${shared} = xyes ]; then i[3456]86-*) target_makefile_frag="${target_makefile_frag} config/mt-x86pic" ;; + powerpc*-*-aix*) + # We don't want -fPIC on AIX. + ;; powerpc*-*) target_makefile_frag="${target_makefile_frag} config/mt-ppcpic" ;; diff --git a/djunpack.bat b/djunpack.bat new file mode 100755 index 00000000000..f09f5ed3251 --- /dev/null +++ b/djunpack.bat @@ -0,0 +1,52 @@ +@echo off +Rem +Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line +Rem format, or else stock DOS/Windows shells will refuse to run it. +Rem +Rem This batch file unpacks the GDB distribution while simultaneously +Rem renaming some of the files whose names are invalid on DOS or conflict +Rem with other file names after truncation to DOS 8+3 namespace. +Rem +Rem Invoke like this: +Rem +Rem djunpack gdb-XYZ.tar +Rem +Rem where XYZ is the version number. If the argument includes leading +Rem directories, it MUST use backslashes, not forward slashes. +Rem +Rem The following 2 lines need to be changed with each new GDB release, to +Rem be identical to the name of the top-level directory where the GDB +Rem distribution unpacks itself. +set GDBVER=gdb-5.0 +if "%GDBVER%"=="gdb-5.0" GoTo EnvOk +Rem If their environment space is too small, re-exec with a larger one +command.com /e:4096 /c %0 %1 +GoTo End +:EnvOk +if not exist %1 GoTo NoArchive +djtar -x -p -o %GDBVER%/gdb/config/djgpp/fnchange.lst %1 > fnchange.tmp +Rem The following uses a feature of COPY whereby it does not copy +Rem empty files. We need that because the previous line will create +Rem an empty fnchange.tmp even if the command failed for some reason. +copy fnchange.tmp junk.tmp > nul +if not exist junk.tmp GoTo NoDjTar +del junk.tmp +sed -e 's,@V@,%GDBVER%,g' < fnchange.tmp > fnchange.lst +Rem See the comment above about the reason for using COPY. +copy fnchange.lst junk.tmp > nul +if not exist junk.tmp GoTo NoSed +del junk.tmp +djtar -x -n fnchange.lst %1 +GoTo End +:NoSed +echo FAIL: Sed is not available. +GoTo End +:NoDjTar +echo FAIL: DJTAR is not available or no fnchange.lst file in %1. +GoTo End +:NoArchive +echo FAIL: the file %1 does not seem to exist. +echo Remember that %1 cannot use forward slashes, only backslashes. +GoTo End +:End +set GDBVER= diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6be0e9b7cb2..6b51c40aa62 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,1814 @@ +2000-06-05 Daniel Berlin + + * c-exp.y (yylex): template handling fixes. + +2000-06-03 Daniel Berlin + + * symtab.h (VTBL_PREFIX_P): Add newer g++ vtbl prefix to prefix list. + + * symtab.c (lookup_partial_symbol): Change to stop forcing linear searches + on C++ when we fail the binary search, by doing the binary search right. + +2000-05-30 Daniel Berlin + + * buildsym.c (hashname): Change to use hash function from bcache.c/.h + + * bcache.c (hash): Change to newer hash function. + + * bcache.h (hash): Prototype for hash function + + * dwarf2read.c (TYPE_HASH_SIZE): New define for controlling size + of type hash. + (dwarf2_cached_types): New variable that is the cached types. + (tag_type_to_type): Do the actual caching of types here. + +2000-06-05 Mark Kettenis + + * acconfig.h, configure.in, i386bsd.c (HAVE_STRUCT_REG_R_FS): + Renamed from HAVE_R_FS. + (HAVE_STRUCT_REG_GS): Renamed from HAVE_R_GS. + * configure, config.in: Regenerated. + +Sun Jun 4 14:00:01 2000 Andrew Cagney + + * TODO: Update. Mention GNU/Linux/SPARC problems. + +Wed May 31 21:41:37 2000 Andrew Cagney + + * gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Change buf + to a void pointer. Update initial values. + * gdbarch.h, gdbarch.c: Re-generate. + + * findvar.c (address_to_signed_pointer, + signed_pointer_to_address): New functions. + * inferior.h (signed_pointer_to_address, + signed_address_to_pointer): Declare. + + * inferior.h, findvar.c (unsigned_pointer_to_address, + address_to_unsigned_pointer): Rename generic_address_to_pointer + and generic_pointer_to_address. Update signatures to match + gdbarch changes. + + * config/mips/tm-mips.h (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): + Define. MIPS has signed pointers. + + * defs.h, utils.c (host_pointer_to_address, + address_to_host_pointer): New functions. + * irix5-nat.c (next_link_map_member, first_link_map_member), + procfs.c (proc_set_watchpoint, proc_iterate_over_mappings): Use. + + * irix5-nat.c (solib_map_sections, symbol_add_stub): Change + function signature to match catch_errors_ftype. + + * TODO: Update. GDB builds using the IRIX native compiler. + +Sat Jun 3 20:43:59 2000 Andrew Cagney + + * defs.h (strsignal, safe_strsignal): Delete declarations. + * utils.c (safe_strsignal): Delete. + * corelow.c (core_open): Replace save_strsignal with + target_signal_to_string + target_signal_from_host. + * TODO: Document problems with target_signal_from_host. + +2000-06-03 Kevin Buettner + + * annotate.c, annotate.h, breakpoint.c, command.c, command.h, + config/rs6000/tm-rs6000.h, corefile.c, d10v-tdep.c, + d30v-tdep.c, dbxread.c, dcache.c, dcache.h, dsrec.c, + dve3900-rom.c, exec.c, fork-child.c, gdbcore.h, hpux-thread.c, + language.h, linux-thread.c, mdebugread.c, monitor.h, ocd.c, + procfs.c, ptx4-nat.c, remote-sim.c, remote-utils.h, remote.c, + rs6000-tdep.c, ser-ocd.c, sol-thread.c, sparcl-tdep.c, + stabsread.h, stack.c, symfile.c, symfile.h, symtab.h, + target.c, target.h, top.c, tracepoint.c, tracepoint.h, + tui/tui.h, tui/tuiIO.c, utils.c, v850ice.c, varobj.c, + win32-nat.c, wince.c, xcoffsolib.c, xcoffsolib.h: Eliminate + PARAMS from function pointer declarations. + +2000-06-03 Christopher Faylor + + * win32-nat.c (safe_symbol_file_add_cleanup): Ensure that gdb_stderr is + flushed before deleting and restoring it. + (safe_symbol_file_add): Ensure that gdb_stderr is flushed before + reassigning it. + (handle_load_dll): Split into two functions so that WFI can handle + shared library events. + (child_solib_loaded_library_pathname): New function. + (child_clear_solibs): New function. Clears shared library list. + (child_solib_add): New function. Adds shared library symbols. + (dll_symbol_command): New function. Handles "dll-symbol" command. + (info_dll_command): New function. Handles info + "sharedlibrary" command. + (handle_exceptions): Eliminate 'ignore_trap' argument. + (get_child_debug_event): Eliminate two arguments. Return "pid" when + appropriate. Break out on most events to allow WFI to handle stuff. + (child_wait): Accomodate get_child_debug_event changes. + (child_attach): Clear thread list and list of loaded dlls. + (child_create_inferior): Clear list of loaded dlls. Use + wait_for_inferior in a loop to look for first "trap". + (child_resume): Avoid accessing a possibly-freed thread pointer. + (_initialize_inftarg): Add "dll-symbols", "sharedlibrary", and "info + sharedlibrary" commands. + * config/i386/tm-cygwin.h: Add some shared library (aka DLL) hooks. + +2000-06-02 Christopher Faylor + + * win32-nat.c: Fix up gcc warnings throughout. + (handle_load_dll): Change DLL name to lower case. + (handle_exception): Add a second argument indicating whether a + breakpoint should be ignored. Return a 0 if the breakpoint was + ignored. + (get_child_debug_event): Pass argument to handle_exception to control + whether a breakpoint should be ignored. + (child_create_inferior): Use modern cygwin API. Explicitly clear + last_sig. Pass FIRST_EXCEPTION to get_child_debug_event for detection + of first breakpoint. + +2000-06-02 Christopher Faylor + + * configure.in: Detect correct versions of dlltool and windres when + cross-compiling. + * configure: Regenerate. + +2000-06-02 J.T. Conklin + + * configure.tgt: Add pattern for i[3456]86-*-netbsdelf*. + * config/i386/nbsdelf.mt: New file. + * config/i386/tm-nbsdelf.h: New file. + + * config/i386/tm-nbsd.h: change include of tm-nbsd.h to + the more explicit config/tm-nbsd.h. + +2000-06-02 Mark Kettenis + + * alphabsd-nat.c (supply_fpregset): Substract FP0_REGNUM from + register number when used as index into fpr_regs array. + +Tue May 30 13:31:57 2000 Andrew Cagney + + * defs.h (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT, + TARGET_LONG_DOUBLE_FORMAT): Delete. + + * gdbarch.sh: Add support for parameterized expressions. + (TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT, + TARGET_LONG_DOUBLE_FORMAT): Add. Include "floatformat.h". + * gdbarch.h, gdbarch.c: Regenerate. + + * arch-utils.c (default_single_format, default_double_format, + default_long_double_format): New functions. Include + "floatformat.h" + * arch-utils.h: Declare. + + * d10v-tdep.c (d10v_gdbarch_init): Set floating point format. + Note that long double is 64 bit, the rest are 32 bit. Include + "floatformat.h". + +2000-06-02 Mark Kettenis + + * config/alpha/nm-fbsd.h (CANNOT_STEP_BREAKPOINT): Define. + +2000-06-01 Michael Snyder + + * sol-thread.c (rw_common): Circumstances (eg. a bug in Sun's + thread_db library) may cause this function to be called with an + illegal address, in which case procfs_to_xfer_memory will + return zero. Return an error code instead of looping forever. + +Thu Jun 1 20:05:26 2000 Andrew Cagney + + * TODO: More suggestions added. + +2000-05-31 J.T. Conklin + + * configure.host: Add patterns for i[3456]86-*-netbsdaout* + and i[3456]86-*-netbsdelf*. + * config/i386/nm-nbsdelf.h: New file. + * config/i386/nbsdelf.mh: New file. + + * config/i386/nm-nbsd.h: change include of nm-nbsd.h to + the more explicit config/nm-nbsd.h. + * config/i386/tm-nbsd.h: change include of tm-i386bsd.h to + tm-i386.h. + (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Define. + +2000-06-01 Mark Kettenis + + * NEWS: Mention FreeBSD/Alpha and FreeBSD/i386 3.x and up as new + native configurations. + + * i386bsd-nat.c: Include "gregset.h". + (CANNOT_STORE_REGISTER): Define to cannot_fetch_register instead + of CANNOT_FETCH_REGISTER, if not already defined. + (supply_gregset): Call supply_register with NULL as its second + argument instead of supplying our own zeroed out buffer. + (fill_gregset): Copy contents of correct registers instead of the + contents of register REGNO. + +2000-05-31 Kevin Buettner + + * gnu-regex.c (re_match_2_internal): Revert 2000-05-27 + patch which removed use of PARAMS from declaration. This + file should not have been touched as it is supposed to track + the version in glibc. + +2000-05-31 Mark Kettenis + + Add support for FreeBSD/Alpha. + * configure.host, configure.tgt (alpha*-*-freebsd*): New entry. + * alphabsd-nat.c, config/alpha/fbsd.mh, config/alpha/fbsd.mt, + config/alpha/nm-fbsd.h, config/alpha/tm-fbsd.h, + config/alpha/xm-fbsd.h: New files. + +2000-05-31 Pierre Muller + + * MAINTAINERS: Add myself to "Write After Approval" list. + +Tue May 30 18:48:33 2000 Andrew Cagney + + * TODO: Re-organize. + +Tue May 30 11:22:28 2000 Andrew Cagney + + * gdbarch.sh: Add field ``postdefault''. Rename fields + ``startup'' and ``default'' to ``staticdefault'' and + ``predefault''. Fix initialization of valid_p. Create/compare + gdbarch.log. + +Mon May 29 22:47:16 2000 Andrew Cagney + + * config/sparc/nm-sun4sol2.h (GDB_GREGSET_T, GDB_FPREGSET_T): + Define. + * config/sparc/xm-sun4sol2.h: (GDB_GREGSET_TYPE, + GDB_FPREGSET_TYPE): Delete. + +Mon May 29 15:41:10 2000 Andrew Cagney + + * symtab.h (make_cleanup_free_search_symbols): Add declaration. + * symtab.c (make_cleanup_free_search_symbols, + do_free_search_symbols_cleanup): New functions. + (search_symbols, symtab_symbol_info, rbreak_command): Update. + (search_symbols): Pass ``sr'', and not its address, to + make_cleanup_free_search_symbols. + +2000-05-28 Kevin Buettner + + * config/nm-linux.h (GDB_GREGSET_T, GDB_FPREGSET_T): Fix typos. + +2000-05-27 Kevin Buettner + + * abug-rom.c, alpha-nat.c, alpha-tdep.c, annotate.c, + annotate.h, arc-tdep.c, ax-gdb.c, ax-gdb.h, ax-general.c, + ax.h, breakpoint.c, breakpoint.h, c-exp.y, c-lang.c, c-lang.h, + call-cmds.h, ch-exp.c, ch-lang.c, ch-lang.h, cli-out.c, + coff-solib.h, coffread.c, command.c, command.h, complaints.c, + complaints.h, config/a29k/tm-a29k.h, config/a29k/tm-vx29k.h, + config/alpha/nm-linux.h, config/alpha/nm-osf.h, + config/alpha/nm-osf2.h, config/alpha/tm-alpha.h, + config/alpha/tm-alphalinux.h, config/arc/tm-arc.h, + config/arm/tm-embed.h, config/d30v/tm-d30v.h, + config/fr30/tm-fr30.h, config/h8300/tm-h8300.h, + config/h8500/tm-h8500.h, config/i386/nm-i386bsd.h, + config/i386/nm-i386sco.h, config/i386/nm-i386sol2.h, + config/i386/nm-i386v.h, config/i386/nm-linux.h, + config/i386/nm-nbsd.h, config/i386/nm-ptx4.h, + config/i386/nm-symmetry.h, config/i386/tm-cygwin.h, + config/i386/tm-i386.h, config/i386/tm-i386nw.h, + config/i386/tm-i386sol2.h, config/i386/tm-i386v.h, + config/i386/tm-i386v4.h, config/i386/tm-nbsd.h, + config/i386/tm-ptx.h, config/i386/tm-sun386.h, + config/i960/tm-mon960.h, config/i960/tm-nindy960.h, + config/m32r/tm-m32r.h, config/m68k/nm-dpx2.h, + config/m68k/nm-linux.h, config/m68k/tm-cisco.h, + config/m68k/tm-delta68.h, config/m68k/tm-es1800.h, + config/m68k/tm-isi.h, config/m68k/tm-linux.h, + config/m68k/tm-m68k.h, config/m68k/tm-m68kv4.h, + config/m68k/tm-news.h, config/m68k/tm-sun3.h, + config/m68k/tm-vx68.h, config/m68k/xm-hp300bsd.h, + config/m88k/tm-m88k.h, config/mcore/tm-mcore.h, + config/mips/nm-irix3.h, config/mips/nm-irix4.h, + config/mips/nm-irix5.h, config/mips/nm-mips.h, + config/mips/tm-embed.h, config/mips/tm-mips.h, + config/mn10200/tm-mn10200.h, config/mn10300/tm-mn10300.h, + config/nm-linux.h, config/nm-lynx.h, config/ns32k/nm-nbsd.h, + config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h, + config/pa/nm-hppah.h, config/pa/tm-hppa.h, + config/pa/tm-hppa64.h, config/pa/xm-hppah.h, + config/powerpc/nm-linux.h, config/powerpc/tm-linux.h, + config/powerpc/tm-ppc-eabi.h, config/powerpc/tm-solaris.h, + config/powerpc/xm-aix.h, config/rs6000/nm-rs6000.h, + config/rs6000/tm-rs6000.h, config/rs6000/xm-rs6000.h, + config/sh/tm-sh.h, config/sparc/nm-linux.h, + config/sparc/nm-sun4os4.h, config/sparc/nm-sun4sol2.h, + config/sparc/tm-sp64.h, config/sparc/tm-sp64sim.h, + config/sparc/tm-sparc.h, config/sparc/tm-sparclet.h, + config/sparc/tm-spc-em.h, config/sparc/tm-sun4os4.h, + config/sparc/tm-sun4sol2.h, config/tic80/tm-tic80.h, + config/tm-sysv4.h, config/v850/tm-v850.h, config/vax/tm-vax.h, + config/w65/tm-w65.h, config/xm-aix4.h, config/z8k/tm-z8k.h, + copying.c, core-aout.c, core-regset.c, core-sol2.c, + corefile.c, corelow.c, cp-valprint.c, cpu32bug-rom.c, + d10v-tdep.c, d30v-tdep.c, dbug-rom.c, dbxread.c, dcache.c, + dcache.h, demangle.c, dink32-rom.c, dsrec.c, dstread.c, + dve3900-rom.c, dwarf2read.c, dwarfread.c, elfread.c, + environ.h, eval.c, exec.c, expprint.c, expression.h, f-exp.y, + f-lang.c, f-lang.h, f-valprint.c, findvar.c, fr30-tdep.c, + frame.h, gdb_string.h, gdbcmd.h, gdbcore.h, + gdbserver/server.h, gdbtypes.c, gdbtypes.h, gnu-regex.c, + h8300-tdep.c, hp-psymtab-read.c, hp-symtab-read.c, + hp300ux-nat.c, hppa-tdep.c, hppah-nat.c, hpread.c, hpread.h, + hpux-thread.c, i386-tdep.c, i386aix-nat.c, i386mach-nat.c, + i386v-nat.c, i386v4-nat.c, i387-tdep.c, i960-tdep.c, infcmd.c, + inferior.h, inflow.c, infptrace.c, inftarg.c, irix4-nat.c, + irix5-nat.c, jv-exp.y, jv-lang.c, jv-lang.h, language.c, + language.h, lynx-nat.c, m2-exp.y, m2-lang.c, m2-lang.h, + m32r-rom.c, mac-nat.c, main.c, maint.c, mdebugread.c, + mi/mi-out.c, minsyms.c, mips-nat.c, mips-tdep.c, mipsread.c, + mn10300-tdep.c, mon960-rom.c, monitor.c, monitor.h, nlmread.c, + objfiles.c, objfiles.h, ocd.c, ocd.h, op50-rom.c, os9kread.c, + osfsolib.c, pa64solib.c, pa64solib.h, parse.c, parser-defs.h, + ppc-bdm.c, printcmd.c, procfs.c, remote-array.c, remote-bug.c, + remote-e7000.c, remote-es.c, remote-est.c, remote-hms.c, + remote-mips.c, remote-nindy.c, remote-nrom.c, remote-rdi.c, + remote-rdp.c, remote-sds.c, remote-sim.c, remote-udi.c, + remote-utils.c, remote-utils.h, remote-vx.c, remote.c, + rom68k-rom.c, rs6000-nat.c, rs6000-tdep.c, scm-exp.c, + scm-lang.c, scm-lang.h, ser-e7kpc.c, ser-mac.c, sh3-rom.c, + sol-thread.c, solib.c, solib.h, somread.c, somsolib.c, + somsolib.h, source.c, sparc-nat.c, sparcl-tdep.c, + sparclet-rom.c, srec.h, stabsread.c, stabsread.h, stack.c, + sun3-nat.c, symfile.c, symfile.h, symmisc.c, symtab.c, + symtab.h, target.c, target.h, terminal.h, thread.c, top.c, + top.h, tracepoint.c, tracepoint.h, tui/tui-file.c, tui/tui.c, + tui/tui.h, tui/tuiCommand.h, tui/tuiData.c, tui/tuiData.h, + tui/tuiDataWin.h, tui/tuiDisassem.c, tui/tuiDisassem.h, + tui/tuiGeneralWin.c, tui/tuiGeneralWin.h, tui/tuiIO.c, + tui/tuiIO.h, tui/tuiLayout.c, tui/tuiLayout.h, tui/tuiRegs.c, + tui/tuiRegs.h, tui/tuiSource.c, tui/tuiSource.h, + tui/tuiSourceWin.h, tui/tuiStack.c, tui/tuiStack.h, + tui/tuiWin.c, tui/tuiWin.h, typeprint.c, ui-file.c, ui-out.h, + ultra3-nat.c, utils.c, v850-tdep.c, v850ice.c, valarith.c, + valops.c, valprint.c, value.h, values.c, varobj.c, w89k-rom.c, + win32-nat.c, wince.c, wrapper.c, wrapper.h, xcoffread.c, + xcoffsolib.c, xmodem.h, z8k-tdep.c: Remove PARAMS from function + declarations. + +2000-05-26 Michael Snyder + + * gregset.h: New file. Typedefs for gdb_gregset_t and + gdb_fpregset_t, prototypes for supply_gregset and friends. + * procfs.c: Include gregset.h. Delete local prototypes for + supply_gregset etc., and local typedef gdb_gregset_t etc. + * sol-thread.c: Include gregset.h, delete local prototypes, + add appropriate casts to gdb_gregset_t. + * uw-thread.c, lin-thread.c, core-sol2.c, core-regset.c, + sparc-tdep.c, ptx4-nat.c, ppc-linux-nat.c, mipsv4-nat.c, + m88k-nat.c, m68klinux-nat.c, m68k-tdep.c, irix5-nat.c, + irix4-nat.c, ia64-linux-nat.c, i386v4-nat.c, cxux-nat.c, + arm-linux-nat.c, alpha-nat.c: Include gregset.h. + * config/nm-linux.h: Define GDB_GREGSET_T, GDB_FPREGET_T. + * config/sparc/nm-sun4sol2.h: Ditto. + * config/sparc/xm-sun4sol2.h: (GDB_GREGSET_TYPE, + GDB_FPREGSET_TYPE): Delete (replaced by GDB_GREGSET_T etc.) + +Thu May 25 16:56:05 2000 Andrew Cagney + + * configure.in (AC_CHECK_HEADERS): Check for ncurses.h. + * config.in, configure: Re-generate. + +2000-05-25 Scott Bambrough + + * arm-linux-tdep.c (find_minsym_and_objfile): New. + (skip_hurd_resolver): New. + (arm_linux_skip_solib_resolver): New. + (arm_skip_solib_resolver): Removed. + + * config/arm/tm-linux.h (SKIP_SOLIB_RESOLVER): Changed to use + arm_linux_skip_solib_resolver. + +2000-05-25 Mark Kettenis + + * acconfig.h (HAVE_R_FS, HAVE_R_GS): Add. + * configure.in: Add checks for r_fs and r_gs members of + `struct reg'. + * config.in, configure: Regenerated. + +2000-05-25 Eli Zaretskii + + * ser-go32.c: Remove PARAMS. + +Thu May 25 15:22:12 2000 Andrew Cagney + + * configure.in (AC_CHECK_HEADERS): Check for , + , and . + * config.in, configure: Re-generate. + * gdb_dirent.h: New file + + * infptrace.c: Include "gdb_dirent.h" instead of . + * core-aout.c: Ditto. + * procfs.c: Include "gdb_dirent.h" instead of . + +Thu May 25 14:43:30 2000 Andrew Cagney + + * config.in: Regenerate. + +Thu May 25 13:49:17 2000 Andrew Cagney + + From Fri 19 May 2000 Eli Zaretskii : * + config/djgpp/fnchange.lst: Fix bfd/coff-tic54x.c, bfd/coff-tc54x.c + and gdb/testsuite/gdb.mi/mi-var-cmd.exp. + +Thu May 25 11:09:50 2000 Andrew Cagney + + * configure.in (AC_OUTPUT): Do not generate tui/Makefile. + (enable-tui): Convert Makefile configury to use the same mechanism + as MI. + + * Makefile.in (BUILD_TUI, TUI_LIBRARY, TUI_DIR, TUI_SRC, + TUI_CFLAGS): Delete + (all-tui): Delete target. + (tuiWin.o, tuiStack.o, tuiSourceWin.o, tuiSource.o, tuiRegs.o, + tuiLayout.o, tuiIO.o, tuiGeneralWin.o, tuiDisassem.o, + tuiDataWin.o, tuiData.o, tuiCommand.o, tui.o): New targets. + (SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_TUI_DEPS, + SUBDIR_TUI_INITS, SUBDIR_TUI_LDFLAGS, SUBDIR_TUI_CFLAGS, + SUBDIR_TUI_ALL, SUBDIR_TUI_CLEAN, SUBDIR_TUI_INSTALL, + SUBDIR_TUI_UNINSTALL): Define. + + * TODO: Update. + +Thu May 25 11:02:24 2000 Andrew Cagney + + * TODO: Update. Mark Kettenis fixed FreeBSD >2.2 support. + * MAINTAINERS: Update Jim Ingham's address. + +2000-05-25 Mark Kettenis + + Add support for FreeBSD/i386 ELF. + * i386bsd-nat.c: New file. + * config/i386/tm-fbsd.h (HAVE_I387_REGS): Define. + Include "i386/tm-i386.h" instead of "i386/tm-i386b.h". + (NUM_REGS): Remove redefinition. + (USE_STRUCT_CONVENTION): Define. + (i386_float_info): Remove prototype. + (FLOAT_INFO): Remove define. + (JB_ELEMENT_SIZE): Define to 4. + (JB_PC): Define to 0. + (GET_LONGJMP_TARGET): Define. + (SIGTRAMP_START, SIGTRAMP_END): Define. + (SIGCONTEXT_PC_OFFSET): Define. + (IN_SOLIB_CALL_TRAMPOLINE): Only define if !SVR4_SHARED_LIBS + * config/i386/nm-fbsd.h (PTRACE_ARG3_TYPE): Define to caddr_t. + (FETCH_INFERIOR_REGISTERS): Define. + (ATTACH_DETACH): Define. + (kernel_u_size): Remove PARAMS. + (register_u_addr): Use CORE_ADDR in prototype where appropriate. + Remove PARAMS. + (SVR4_SHARED_LIBS) [FREEBSD_ELF || __ELF__ && !FREEBSD_AOUT]: + Define. + [SVR4_SHARED_LIBS]: Include "elf/common.h". + Only define aliases for struct members from if + !SVR4_SHARED_LIBS. + * config/i386/xm-fbsd.h: New file. + * config/i386/fbsd.mt (TDEPFILES): Remove solib.o. + * config/i386/fbsd.mh (NATDEPFILES): Remove i386b-nat.o. Add + core-regset.o i387-nat.o i386bsd-nat.o. + +2000-05-24 Michael Snyder + + * findvar.c (value_from_register): Factor code, simplify logic. + +2000-05-23 J.T. Conklin + + * config/i386/nbsd.mt (TDEPFILES): Move solib.o from here... + * config/i386/nbsd.mh (NATDEPFILES): ...to here. + * config/m68k/nbsd.mt (TDEPFILES): Move solib.o from here... + * config/m68k/nbsd.mh (NATDEPFILES): ...to here. + * config/ns32k/nbsd.mt (TDEPFILES): Move solib.o from here... + * config/ns32k/nbsd.mh (NATDEPFILES): ...to here. + + * config/powerpc/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o. + * configure.tgt (powerpc-*-netbsd*): add gdbserver to configdirs. + * gdbserver/low-nbsd.c (initialize_arch): Define for PPC. + (fetch_inferior_registers): Likewise. + (store_inferior_registers): Likewise. + + * gdbserver/low-nbsd.c (fetch_inferior_registers): Handle X86 + floating point registers. + (store_inferior_registers): Likewise. + +2000-05-24 Mark Kettenis + + * i387-nat.h, i387-nat.c: New files. + +Tue May 23 17:21:24 2000 Alexandre Oliva + + * config/sparc/nm-linux.h: Include config/nm-linux.h. + * config/powerpc/nm-linux.h: Likewise. + +Tue May 23 13:20:00 1999 Gregory Lielens + + * f-valprint.c : Corrected f_val_print function for TYPE_CODE + (type) = TYPE_CODE_COMPLEX + +Wed May 24 00:38:09 2000 Andrew Cagney + + * utils.c (make_cleanup_close, do_close_cleanup): New functions. + * defs.h (make_cleanup_close): Add declaration. + +Tue May 23 20:47:50 2000 Andrew Cagney + + * configure.in (build_warnings): Add -Wuninitialized. + * configure: Regenerate. + +Tue May 23 17:44:18 2000 Andrew Cagney + + From Mon May 8 14:49:51 2000 Andrew Cagney + (gdb 5.0): From Michael Paddon : + * configure.in (AC_CHECK_HEADERS): Check for . + + * configure: Re-generate. + * proc-api.c: Only include when available. + (ioctl_table): Check that PIOCGETPR and PIOCGETU are defined. + + * TODO: Update. + +2000-05-17 Michael Snyder + + * config/sparc/tm-sun4sol2.h: Turn on multi-arch. + * sparc-tdep.c (gdb_print_insn_sparc): Remove temp. multi-arch hack. + +2000-05-17 Andrew Cagney + + * GDB 5.0 released. + * Makefile.in (VERSION): Set to 5.0. + +Mon May 22 16:20:31 2000 Andrew Cagney + + * inferior.h (make_cleanup_restore_inferior_status): + * infrun.c (make_cleanup_restore_inferior_status, + do_restore_inferior_status_cleanup): New functions. + * valops.c (hand_function_call): Use. + * infcmd.c (disable_longjmp_breakpoint_cleanup): New function. + (step_1): Use. + * symfile.c (clear_symtab_users_cleanup): New function. + (syms_from_objfile, reread_symbols): Use. + * objfiles.c (make_cleanup_free_objfile, do_free_objfile_cleanup): + New functions. + * objfiles.h (make_cleanup_free_objfile): Add declaration. + * symfile.c (syms_from_objfile, reread_symbols), hpread.c + (hpread_build_psymtabs), hp-psymtab-read.c + (hpread_build_psymtabs): Use. + * dwarf2read.c (make_cleanup_free_die_list, + do_free_die_list_cleanup): New functions. + (psymtab_to_symtab_1): Use. + * tracepoint.c (make_cleanup_free_actions, + do_free_actions_cleanup): New functions. + (read_actions): Use. + * corelow.c (core_close_cleanup): New function. + (core_open): Use. + * dbxread.c (make_cleanup_free_bincl_list, + do_free_bincl_list_cleanup): New function. + (read_dbx_symtab): Use. + * coffread.c (free_linetab_cleanup, free_stringtab_cleanup): New + functions. + (coff_symfile_read): Use. + * varobj.c (make_cleanup_free_variable, do_free_variable_cleanup): + New function. + (varobj_create): Use. + * sparcl-tdep.c (close_tty), infrun.c (resume_cleanups), parse.c + (free_funcalls): Change signature to match make_cleanup_ftype. + * infrun.c (resume), tracepoint.c (encode_actions), remote-udi.c + (download), solib.c (open_symbol_file_object), sparcl-tdep.c + (sparclite_open), parse.c (parse_exp_1): Remove cast using + make_cleanup_func. + +Mon May 22 15:49:13 2000 Andrew Cagney + + * procfs.c (info_proc_cmd): Use make_cleanup_freeargv. + (proc_iterate_over_mappings): Use make_cleanup_close. + (proc_get_LDT_entry): Ditto. + (do_closedir_cleanup): New function. + (proc_update_threads): Use. + (do_destroy_procinfo_cleanup): New function. + (info_proc_cmd): Use. + +Mon May 22 15:21:38 2000 Andrew Cagney + + * top.h (command_loop_marker): Change signature to match + make_cleanup_ftype. + * top.c (command_loop_marker): Update. + (command_loop, simplified_command_loop), event-top.c + (command_handler): Remove cast using make_cleanup_func. + * event-top.c (command_handler): Ditto. + + * top.c (do_chdir_cleanup): New function. + (gdb_init): Use. Use xstrdup instead of strsave. + * top.c (do_fclose_cleanup): New function. + (source_command): Use. + * top.c (do_restore_instream_cleanup): Rename + source_cleanup. Change signature to match make_cleanup. + (read_command_filem execute_user_command): Update. Remove cast + using make_cleanup_func. + * top.c (do_free_command_lines_cleanup, + make_cleanup_free_command_lines): New funtions. + (get_command_line, read_command_lines): Use. + * top.c (arg_cleanup): Change signature to match make_cleanup. + (setup_user_args): Remove cast using make_cleanup_func. + +Mon May 22 12:05:13 2000 Andrew Cagney + + * defs.h (t_reg): Delete typedef. + (preg, preg_nz): Delete function. Replaced by phex and phex_nz. + * utils.c (phex, phex_nz): New functions. + (paddr, paddr_nz): Use. + + * monitor.c (monitor_store_register): Replace preg with phex. + +Mon May 22 11:46:01 2000 Andrew Cagney + + * TODO: Add note on typecast using catch_errors_ftype. + +2000-05-21 Mark Kettenis + + * i387-tdep.c (print_i387_value): Cast &value to (char *) in + pointer arithmetic. Fixes a bug which manifested itself on + FreeBSD. + +2000-05-20 J.T. Conklin + + * target.h (target_memory_bfd_section): Removed declaration. + * target.c (target_memory_bfd_section): Removed. + * exec.c (xfer_memory): Removed #if'ed-out code which referenced + target_memory_bfd_section. + + * target.h (target_read_memory_section): Removed declaration. + * target.c (target_read_memory_section): Removed. + (target_xfer_memory): Update, removed bfd_section argument. + (target_read_string, target_read_memory, target_write_memory): + Update for above change. + + * gdbcore.h (read_memory_section): Removed declaration. + * corefile.c (read_memory_section): Removed. + * jv-lang.c (get_java_utf8_name): Changed calls to + read_memory_section to read_memory. + * printcmd.c (printf_command): Likewise. + * valops.c (value_at, value_fetch_lazy): Likewise. + +2000-05-18 J.T. Conklin + + * configure.host, configure.tgt (powerpc-*-netbsd*): New entry. + * config/powerpc/nbsd.mh, config/powerpc/nbsd.mt, + config/powerpc/tm-nbsd.h, config/powerpc/nm-nbsd.h, + config/powerpc/xm-nbsd.h: New files. + +2000-05-17 Eli Zaretskii + + * gdb/config/djgpp/README: Fine-tune installation instructions + based on user reports. + +Wed May 17 18:27:45 2000 Andrew Cagney + + * configure.in (build_warnings): List possible warnings. + * configure: Regenerate. + * TODO: More updates. + * MAINTAINERS: Add Gary Thomas and Joern Renneck to Write After + Approval. + +Wed May 17 16:48:36 2000 Andrew Cagney + + From 2000-04-14 Gary Thomas : + * config/v850/tm-v850.h: Change breakpoint sequence to be + 'br *' since there is no 16bit "illegal" instruction on this + processor. + +Tue May 16 18:57:14 2000 Andrew Cagney + + * TODO: Review. Delete anything that is no longer applicable. + +Tue May 16 14:17:20 2000 Andrew Cagney + + * utils.c (free_current_contents): Make more robust. + +Tue May 16 13:30:08 2000 Andrew Cagney + + * symtab.h (make_cleanup_discard_minimal_symbols): Replace + discard_minimal_symbols. + * minsyms.c (make_cleanup_discard_minimal_symbols): + (do_discard_minimal_symbols_cleanup): New functions. + + * xcoffread.c (xcoff_initial_scan), somread.c (som_symfile_read), + solib.c (solib_add_common_symbols), os9kread.c + (os9k_symfile_read), nlmread.c (nlm_symfile_read), mipsread.c + (mipscoff_symfile_read), elfread.c (elf_symfile_read), dstread.c + (dst_symfile_read), dbxread.c (dbx_symfile_read), coffread.c + (coff_symfile_read): Replace make_cleanup. + +Mon May 15 09:32:31 2000 Andrew Cagney + + * command.h (add_set_cmd): Change VAR parameter to void pointer. + (add_set_enum_cmd): Change VAR parameter to char pointer pointer. + (struct command): Change member VAR to void pointer. + * command.c (add_set_cmd, add_set_enum_cmd): Update. + + * remote.c (add_packet_config_cmd), mips-tdep.c + (_initialize_mips_tdep), infrun.c (_initialize_infrun), + i386-tdep.c (_initialize_i386_tdep), arm-tdep.c + (_initialize_arm_tdep): Update VAR parameter to add_set_enum_cmd. + +Tue May 16 12:46:04 2000 Andrew Cagney + + * wrapper.h (wrap_value_subscript): Delete declaration. + +Tue May 16 10:54:55 2000 Andrew Cagney + + * defs.h (make_cleanup_bfd_close): Add declaration. + * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_close): New + functions. + + * symfile.c (generic_load), sparcl-tdep.c (download), remote-udi.c + (download), remote-e7000.c (e7000_load), corelow.c (core_open, + core_file_to_sym_file): Replace calls to make_cleanup. + +Mon May 15 16:50:45 2000 Andrew Cagney + + * TODO: Add notes on register cache. + +Mon May 15 21:27:27 2000 J"orn Rennecke + + * sh-tdep.c (sh_dsp_reg_names, sh3_dsp_reg_names): New arrays. + (sh_processor_type_table): Add entries for bfd_mach_sh_dsp and + bfd_mach_sh3_dsp. + (sh_show_regs): Floating point registers are called fr0-fr15. + For sh4, display fpul, fpscr and fr0-fr15 / dr0-dr14 as appropriate. + Handle sh-dsp and sh3-dsp. + config/sh/tm-sh.h (REGISTER_VIRTUAL_TYPE): sh-dsp / sh3-dsp + don't have floating point registers. + (DSR_REGNUM, A0G_REGNUM, A0_REGNUM, A1G_REGNUM, A1_REGNUM): Define. + (M0_REGNUM, M1_REGNUM, X0_REGNUM, X1_REGNUM, Y0_REGNUM): Likewise. + (Y1_REGNUM, MOD_REGNUM, RS_REGNUM, RE_REGNUM, R0B_REGNUM): Likewise. + +2000-05-15 Eli Zaretskii + + * Makefile.in (gdbtypes.o, varobj.o): Depend on wrapper.h. + + * wrapper.h (gdb_value_subscript, wrap_value_subscript): Add + prototypes. + +Mon May 15 15:31:30 2000 Andrew Cagney + + * valops.c (hand_function_call): Replace #ifdef + SAVE_DUMMY_FRAME_TOS with if SAVE_DUMMY_FRAME_TOS_P. + + * gdbarch.sh (SAVE_DUMMY_FRAME_TOS): Add. + * gdbarch.h, gdbarch.c: Regenerate. + +Mon May 15 16:05:46 2000 Andrew Cagney + + * ax.h (make_cleanup_free_agent_expr): Add declaration. + * ax-general.c (do_free_agent_expr_cleanup): + (make_cleanup_free_agent_expr): New functions. + + * tracepoint.c (validate_actionline, encode_actions), ax-gdb.c + (expr_to_agent, gen_trace_for_expr, agent_command): Replace calls + to make_cleanup. + +Mon May 15 14:06:23 2000 Andrew Cagney + + * breakpoint.h (make_cleanup_delete_breakpoint, + make_exec_cleanup_delete_breakpoint): Declare. + * breakpoint.c (make_cleanup_delete_breakpoint, + make_exec_cleanup_delete_breakpoint, + do_delete_breakpoint_cleanup): New fuctions. + + * infcmd.c (finish_command), hppa-tdep.c (hppa_pop_frame), + breakpoint.c (until_break_command, until_break_command): Replace + call to make_cleanup / make_exec_cleanup. + +Mon May 15 13:25:57 2000 Andrew Cagney + + * defs.h (core_addr_greaterthan, core_addr_lessthan), utils.c + (core_addr_greaterthan, core_addr_lessthan): Move from here. + * arch-utils.h (core_addr_greaterthan, core_addr_lessthan), + arch-utils.c (core_addr_greaterthan, core_addr_lessthan): To here. + +Mon May 15 12:07:55 2000 Andrew Cagney + + * printcmd.c (print_frame_args), stack.c (print_frame), command.c + (do_setshow_command), breakpoint.c (print_it_typical, mention): + Use make_cleanup_ui_out_stream_delete. + +Mon May 15 11:23:23 2000 Andrew Cagney + + * proc-events.c (init_syscall_table): Delete stray ``;''. + * ui-out.c (ui_out_set_flags, ui_out_clear_flags): Return old + value. + * mdebugread.c (START_PSYMTAB): Add paren to avoid x=x=x. + +2000-05-12 Michael Snyder + + * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Define. + +2000-05-12 Kevin Buettner + + * dwarf2read.c (dwarf2_const_value_data): Fix typo in sign + extension code. + +Fri May 12 20:38:55 2000 Andrew Cagney + + * TODO: Mention weak symbol problem. Mention UnixWare thread + problem. + +Fri May 12 14:12:17 2000 Andrew Cagney + + * README: Update section on kernel debugging. + +Fri May 12 19:13:15 2000 Andrew Cagney + + * mips-tdep.c (mips_get_saved_register): New function. Handle + case of 32 ABI saving 32 bit registers on stack when target has 64 + bit ISA. + (mips_gdbarch_init): Update. + +Fri May 12 14:46:52 2000 Andrew Cagney + + * mips-tdep.c (MIPS_EABI): Fix typo. Test for MIPS_ABI_EABI64. + +Thu May 11 21:52:55 2000 Andrew Cagney + + * configure.in (WERROR_CFLAGS): Check that GCC accepts a -W + options before using them. Report result. + * configure: Regenerate. + +2000-05-11 Elena Zannoni + + * coffread.c (coff_symtab_read): In the case of C_THUMBEXT | + C_THUMBEXTFUNC | C_EXT, sec will never ever be the index for + .rodata, because cs_to_section doesn't deal with .rodata. Fix test + accordingly. + +Thu May 11 21:33:59 2000 Andrew Cagney + + * gdbarch.sh (gdbarch_dump): Print the value of GDB_MULTI_ARCH. + Always check that a macro is defined before printing it. + * gdbarch.c: Re-generate. + +Thu May 11 17:22:36 2000 Andrew Cagney + + * README: Update for GDB 5.0. + +Thu May 11 13:24:52 2000 Andrew Cagney + + * mips-tdep.c (MIPS_DEFAULT_STACK_ARGSIZE): Fix typo. + + * config/mips/tm-irix5.h (GDB_MULTI_ARCH): Add + definition. Disable. Document known problems. + (MIPS_DEFAULT_ABI): Define. + + * mips-tdep.c (enum mips_abi): Define. + (struct gdbarch_tdep): Replace mips_eabi with mips_abi. + (MIPS_EABI): Update. + (mips_gdbarch_init): Add preliminary support for IRIX N32 ABI. + Determine ABI from either ELF_FLAGS or MIPS_DEFAULT_ABI. When + looking for a matching architecture require a matching MIPS_ABI. + (mips_gdbarch_init): Cleanup arch_debug information. + +2000-05-10 Elena Zannoni + + * solib.c (symbol_add_stub): Remember the index and the name of + the section with the lowest address. Use this data (instead of + data from .text) to pass info into symbol_file_add. + + * elfread.c (record_minimal_symbol_and_info): Use the section + where the symbol lives to get the index, instead of guessing. + +2000-05-10 Michael Snyder + + Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI). + * sparc-tdep.c: include arch-utils.h. + (SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE, + DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions. + (GDB_TARGET_IS_SPARC64): make into a runtime test. + (struct frame_extra_info): Define, use instead of the macro. + (Many places): Use alloca instead of statically allocated buffers + that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE. + (sparc_extract_struct_value_address): Accept a pointer arg instead + of an array sized by REGISTER_BYTES. + (examine_prologue): Accept a pointer to an array of CORE_ADDR, + instead of the defunct struct frame_saved_regs. Recognize new + Sparc64 store instructions as part of the prologue. Ignore the + destination of a frame store when parsing the prologue (so long + as it's on the stack). + (sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE. + (sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR + instead of the defunct struct frame_saved_regs. + (supply_gregset): Discard unnecessary 'zerobuf': just send NULL to + supply_register. Provide 4-byte offset to compensate for diff + between size of the prgreg_t elements on a 64-bit host and size + of the registers for a 32-bit target. Fill all inaccessible regs + with zero so they won't keep being requested again and again. + (fill_gregset): Handle 32/64 size difference between registers + and prgreg_t. Handle as many new 64-bit regs as possible. + (supply_fpregset, fill_fpregset): Attempt to handle 64-bit world. + (sparc_push_arguments): Rename to sparc32_push_arguments. + Copy arguments into registers as well as onto stack, so that the + CALL_DUMMY (code pushed onto the target stack) is not required. + (sparc_extract_return_value): Rename to sparc32_extract_return_value. + (sparc_store_return_value): Use memset instead of bzero. + Use write_register_gen instead of write_register_bytes. + (sparclet_store_return_value): New function. + (_initialize_sparc_tdep): Call register_gdbarch_init to activate + the gdbarch multi-architecture system. + (sp64_push_arguments): Rename to sparc64_push_arguments. + Extend to store arguments in general registers as well as on stack. + (sparc64_extract_return_value): Rename to sp64_extract_return_value. + Use as a private function, to be called by the new external function + sparc64_extract_return_value. + (sparclet_extract_return_value): New function. + (sparc32_stack_align, sparc64_stack_align, sparc32_register_name, + sparc64_register_name, sparc_print_extra_frame_info, + sparclite_register_name, sparclet_register_name, + sparc_push_return_address, sparc64_use_struct_convention, + sparc32_store_struct_return, sparc64_store_struct_return, + sparc32_register_virtual_type, sparc64_register_virtual_type, + sparc32_register_size, sparc64_register_size, + sparc32_register_byte, sparc64_register_byte, + sparc_gdbarch_skip_prologue, sparc_convert_to_virtual, + sparc_convert_to_raw, sparc_frame_init_saved_regs, + sparc_frame_address, sparc_gdbarch_fix_call_dummy, + sparc_coerce_float_to_double, sparc_call_dummy_address, + sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size, + sparc_return_value_on_stack): New functions supporting multi-arch. + (sparc_gdbarch_init): New function; initialize multi-arch. + (struct gdbarch_tdep): Define, use for private multi-arch data. + * config/sparc/tm-sparc.h: Move definitions around, enclose with + #ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate + definitions. Add enums for register names, to help debugging gdb. + This header file must work for non-multi-arch and for multi-arch. + * config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add + AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case. + Define GDB_MULTI_ARCH. + * config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration. + Do not define GDB_MULTI_ARCH (bfd does not correctly identify target). + * config/sparc/tm-sparclite.h: Ditto. + * config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH. + * sparclet-rom.c (sparclet_regnames): Initialize explicitly, to + avoid using deprecated REGISTER_NAMES macro. + * Makefile.in: Let sparc-tdep.c depend on arch-utils.h. + +2000-05-08 Michael Snyder + + * gdbarch.sh: Add FP0_REGNUM to list of multi-arched register numbers. + * gdbarch.c, gdbarch.h: Regenerate. + * core-regset.c: Change FP0_REGNUM to a runtime test. + * procfs.c: Ditto. + * sun3-nat.c: Ditto. + * sparc-tdep.c: Ditto. + + * i386mach-nat.c: Remove unnecessary ifdef for FP0_REGNUM. + * ptx4-nat.c: Ditto. + + * sol-thread.c (sol_thread_create_inferior): only add the thread + to the thread list if it is not already in there. + (prototypes for thread_db func ptrs): pretty up formatting. + +2000-05-08 Eli Zaretskii + + * config/djgpp/djconfig.sh: Use more warning switches. + + * config/djgpp/fnchange.lst: Replace the leading gdb-0222 with the + @V@ placebo. djunpack.bat changed accordingly. + +Mon May 8 11:19:47 2000 Andrew Cagney + + * mips-tdep.c (size_auto, size_32, size_64, size_enums): Rename + saved_gpreg_size_auto, saved_gpreg_size_32, saved_gpreg_size_64 + and saved_gpreg_size_enums. + (mips_stack_argsize): Update. Cleanup. + + * mips-tdep.c (STACK_ARGSIZE): Delete macro. Replaced by + MIPS_STACK_ARGSIZE. + (MIPS_NABI32): Delete macro. Replaced by + MIPS_REGS_HAVE_STACK_HOME_P. + (mips_push_arguments): Update. + (mips_push_arguments): Replace check for MIPS_EABI or MIPS_NABI32 + with test for MIPS_REGS_HAVE_STACK_HOME_P. + (MIPS_REGS_HAVE_STACK_HOME_P): Define. Provide non- multi-arch + default. + (struct gdbarch_tdep): Add mips_regs_have_stack_home_p and + mips_default_stack_argsize. + (MIPS_STACK_ARGSIZE): Define as mips_stack_argsize. + (mips_stack_argsize_string): New static variable. + (mips_stack_argsize): New function, handle default case. + (__initialize_mips_tdep): Add command ``set mips stack-arg-size'' + implemented as an enum using size_auto et.al. + (mips_gdbarch_init): Initialize mips_default_stack_argsize and + mips_regs_have_stack_home_p. + + * config/mips/tm-irix5.h (MIPS_DEFAULT_SAVED_REGSIZE): Define as 8 + for n32. + (MIPS_REGS_HAVE_STACK_HOME_P): Define as 0 for n32. + +Mon May 8 00:49:32 2000 Andrew Cagney + + * procfs.c (PROCFS_TRACE): Delete definition. + * proc-utils.h (PROCFS_NOTE, PROC_PRETTYFPRINT_STATUS): Always + define. + +2000-05-05 Michael Snyder + + * procfs.c: Cleanup of procfs tracing. Move defines and + prototypes to proc-utils.h + * proc-utils.h: Define tracing macros. Declare trace functions. + * proc-api.c: Make procfs tracing a runtime option. + (prepare_to_trace): New function, abstracted out of several + places. Open a trace file if one is required. + (ioctl_with_trace, write_with_trace, open_with_trace, + close_with_trace, wait_with_trace, lseek_with_trace): + Report errno if an error occurs in a system call. + (write_with_trace): Make 2nd arg void *, to agree with write. + +2000-05-05 Elena Zannoni + + * elfread.c (elf_symtab_read): The calculation of 'offset' + must be done for each symbol, not just once. The index + used must be the index of the section where 'sym' resides, + not .text. + +2000-05-05 Michael Snyder + + * procfs.c (many functions): change int cmd; to long cmd; + Solaris /proc API calls this parameter a long, and requires it + for 64-bit hosts (where sizeof(long) != sizeof(int)). UnixWare + calls it an int, but on existing UnixWare hosts, int and long + are the same size. So long it must be. If a future UnixWare + version has problems with this, we'll have to use autoconf. + * proc-api.c (write_with_trace): use long instead of int. + +2000-05-04 Mark Kettenis + + * i386-linux-nat.c: Define PT_READ_U and PT_WRITE_U if they're not + already defined. + +2000-05-01 Mark Kettenis + + * infrun.c (handle_inferior_event): Add missing call to keep_going + and missing return when handling an ordinary signal from the + inferior. + +2000-05-04 Elena Zannoni + + * objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS, + SECT_OFF_RODATA): Define as functions of OBJFILE. Add + sect_index_text, sect_index_data, sect_index_rodata, + sect_index_bss to objfile structure. + * gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS, + SECT_OFF_RODATA): Remove. + * objfiles.c (allocate_objfile): Initialize + sect_index_{text,data,bss,rodata} to -1, for error detection. + + * symfile.c (default_symfile_offsets): Initialize + sect_index_{text,data,bss,rodata} from bfd information. + * xcoffread.c (xcoff_symfile_offsets): Ditto. + * somread.c (som_symfile_offsets): Initialize + sect_index_{text,data,bss,rodata}. + + * coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c, + hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c, + mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h, + remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c, + stabsread.c, symfile.c, xcoffread.c: + Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the + current objfile. + + * xcoffread.c: Add new field objfile to find_targ_sec_arg. + +Thu May 4 20:54:00 2000 Andrew Cagney + + * config/mips/tm-mipsv4.h (Dest_Reg), config/mips/tm-irix5.h + (MIPS_NUM_ARG_REGS, Dest_Reg), config/mips/tm-mips.h + (MIPS_NUM_ARG_REGS), config/mips/tm-mips.h (MIPS_NUM_FP_ARG_REGS): + Delete unused macros. + +2000-05-03 Michael Snyder + + * solib.c (elf_locate_base, info_sharedlibrary_command): + Look at the bfd to determine if it is elf32 or elf64, rather + than using an ifdef. This makes it runtime teststable and + multi-arch. + +2000-05-01 Mark Kettenis + + * infrun.c (handle_inferior_event): When doing a "next", and + stepping out of a signal handler into its calling trampoline + ignore the value of step_frame_address. + (step_over_function): Only modify step_resume_breakpoint->frame if + the value of step_frame_address is non-zero. + +2000-05-03 Michael Snyder + + * monitor.c (monitor_fetch_register): MAX_REGISTER_RAW_SIZE + is not static in the MULTI_ARCH world, so don't use it in a + static array declaration. + +2000-05-03 Elena Zannoni + + * symtab.c (in_prologue): From Jim Blandy. Rewrite, more + intelligently, making sure we use the information from the + symbol tables fully. + +2000-05-02 H.J. Lu + + * ia64-tdep.c (ia64_gdbarch_init): Reference to ELFOSABI_NONE + instead of ELFOSABI_SYSV. + +Tue May 2 19:07:20 2000 Andrew Cagney + + * gdbarch.sh (NPC_REGNUM, NNPC_REGNUM): Add. + * gdbarch.h, gdbarch.c: Re-generate. + + * gdbserver/remote-utils.c (prepare_resume_reply): Change #ifdef + NPC_REGNUM to run-time test. + * findvar.c (generic_target_write_pc): Change #ifdef NPC_REGNUM + and NNPC_REGNUM to run-time test. + * procfs.c (procfs_fetch_registers): Change #ifdef NPC_REGNUM to + run-time test. + (procfs_store_registers): Ditto. + +Tue May 2 18:48:57 2000 Andrew Cagney + + * gdbarch.sh: Provide non- multi-arch defaults by direct + definition in "gdbarch.h" instead of going through "gdbarch.c". + * gdbarch.h, gdbarch.c: Re-generate. + * defs.h: When non- multi-arch, include "arch-utils.h" so that + legacy definitions are globally visible. + +Tue May 2 16:32:06 2000 Andrew Cagney + + * MAINTAINERS: Add Syd Polk to gdbtk maintainers. + (symtabs): Add Elena to symtabs maintainers list. + (Blanket Write Privs): Add Jim Blandy. + +2000-05-01 Stan Shebs + + Remove obsolete Gould configuration: + * configure.host, configure.tgt: Remove Gould configs. + * Makefile.in: Remove Gould-related actions. + * gould-xdep.c, gould-tdep.c, config/gould/*: Remove files. + * NEWS: Mention removal. + +Mon May 1 15:37:58 2000 Andrew Cagney + + From 2000-04-28 Andreas Jaeger : + * defs.h: Properly check for GCC version number. + +2000-04-30 Mark Kettenis + + Fix single-stepping out of signal trampolines. + * config/i386/nm-linux.h (CHILD_RESUME): Define. + * i386-linux-nat.c (child_resume): New function. + +Fri Apr 28 16:22:34 2000 Andrew Cagney + + * blockframe.c (frameless_look_for_prologue): Use + PROLOG_FRAMELESS_P instead of SKIP_PROLOGUE_FRAMELESS_P. + * gdbarch.sh (PROLOG_FRAMELESS_P): Define. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.h, arch-utils.c (generic_prologue_frameless_p): New + function. + +Fri Apr 28 15:31:10 2000 Andrew Cagney + + From "Serge Nikulin" : + * m68k-tdep.c (delta68_in_sigtramp): Return 0 when the function + name is unknow. + +2000-04-27 Michael Snyder + + * gdbarch.sh (d10v_daddr_p, d10v_iaddr_p, d10v_convert_daddr_to_raw, + d10v_convert_iaddr_to_raw): make these multi-arch functions optional. + * gdbarch.c, gdbarch.h: regenerate + +Fri Apr 28 12:21:28 2000 Andrew Cagney + + From Tim Mooney : + * target.c (do_monitor_command): Cast tcomplain to correct + function type in comparison. + +Fri Apr 28 11:43:05 2000 Andrew Cagney + + From 2000-04-25 Guy Harris : + * config/alpha/alpha-osf3.mh (XDEPFILES): Add ser-tcp.o and + ser-pipe.o + +2000-04-27 Michael Snyder + + * jv-valprint.c (java_val_print): Add arg declaration, + fix compiler warning. + * corelow.c (core_open): Call set_gdbarch_from_file so that + gdbarch becomes aware of the architecture encoded in the + corefile. + * findvar.c (write_register_gen): Export this useful interface. + * value.h (write_register_gen): Declare. + +2000-04-27 Elena Zannoni + + * cxux-nat.c (add_shared_symbol_files): Don't treat .text section + as special in the section_addr_info structure. + * pa64solib.c (pa64_solib_add_solib_objfile): Ditto. + * osfsolib.c (symbol_add_stub): Ditto. + * irix5-nat.c (symbol_add_stub): Ditto. + +Thu Apr 27 14:07:16 2000 Andrew Cagney + + * mips-tdep.c, d10v-tdep.c: Include "arch-utils.h". + +Thu Apr 27 10:06:42 2000 Andrew Cagney + + * TODO: Document IRIX X ARM cross compile problems. + +2000-04-26 Michael Snyder + + * utils.c (internal_verror): Call target_terminal_ours. + * wrapper.h: Fix minor comment typo. + * proc-api.c (write_with_trace): Change 'arg' from long to int. + Treat 'off_t' and 'size_t' as unsigned long in printfs. + (lseek_with_trace): Treat 'off_t' as unsigned long in printf. + * procfs.c (comments): Eliminate "???" in comments, which GCC + wants to interpret as a trigraph. (fill_gregset, supply_gregset, + fill_fpregset, supply_fpregset): Declare. + (procfs_wait): Sysargs is a long, change printf format to match. + (test-mapping, mapping_test, test_mapping_cmd) Remove (test only). + +2000-04-26 Kevin Buettner + + * config/djgpp/fnchange.lst (ia64-linux-nat.c): Map to + ia64linux-nat.c. + +Wed Apr 26 13:50:35 2000 Philippe De Muyter + + * ax-gdb.c (agent_command): Remove now useless cast of + `free_current_contents' when passed to `make_cleanup'. + * coffread.c (coff_symfile_read): Ditto. + * dwarf2read.c (dwarf2_add_member_fn, read_array_type): Ditto. + (dwarf_decode_lines): Ditto. + * eval.c (parse_and_eval_address, parse_and_eval_address_1): Ditto. + (parse_and_eval, parse_to_comma_and_eval): Ditto. + * parse.c (parse_exp_1): Ditto. + * printcmd.c (print_command_1, output_command, set_command): Ditto. + (x_command, print_frame_args, printf_command): Ditto. + * top.c (execute_control_command): Ditto. + * tracepoint.c (validate_actionline): Ditto. + * typeprint.c (whatis_exp, ptype_command): Ditto. + (maintenance_print_type): Ditto. + +2000-04-26 Kevin Buettner + + * Makefile.in (ALLDEPFILES): Add ia64-linux-tdep.c. + (ia64-linux-tdep.o): Add dependencies. + (ia64-tdep.o): Add dependency for arch-utils.h. + * ia64-linux-tdep.c, ia64-tdep.c (arch-utils.h): Include. + +2000-04-25 Michael Snyder + + * blockframe.c: Fix a minor typo in a comment. + +2000-04-25 Kevin Buettner + + * ia64-tdep.c (examine_prologue): Recognize store instructions; + those whose source operands are input registers which haven't + been seen before are considered to be part of the prologue. + +Tue Apr 25 13:51:58 2000 glen mccready + + * rs6000-nat.c (xcoff_relocate_symtam): Recover from the wrong + patch being applied `Fri Apr 7 13:44:38 2000'. + +2000-04-24 Kevin Buettner + + * ia64-linux-tdep.c: New file. + * ia64-tdep.c (elf-bfd.h): Include. + (ia64_linux_sigcontext_register_address): New extern declaration. + (struct gdbarch_tdep): New struct. + (SIGCONTEXT_REGISTER_ADDRESS): New define. + (read_sigcontext_register): New static function. + (extract_bit_field, replace_bit_field, slotN_contents, + replace_slotN_contents): Made static. + (ia64_frame_chain, ia64_frame_saved_pc, ia64_init_extra_frame_info): + Added new code for signal handler frames and call dummy frames. + (ia64_frame_init_saved_regs): Handle signal handler frames. + (ia64_find_saved_register): Removed. + (ia64_get_saved_register): Handle call dummy frames; reorganized + to call generic_get_saved_register() to find registers saved + in previous frames. + (process_note_abi_tag_sections): New static function. + (ia64_gdbarch_init): Attempt to determine the ABI/OS of the + executable. Based upon this information, set target dependent + field sigcontext_register_address appropriately. Also set + FRAME_CHAIN_VALID to be generic_func_frame_chain_valid. + * config/ia64/linux.mt (TDEPFILES): Add ia64-linux-tdep.o. + * config/ia64/tm-linux.h (IN_SIGTRAMP): Define. + (ia64_linux_in_sigtramp): New declaration. + +2000-04-23 Eli Zaretskii + + * TODO, NEWS: Update due to inclusion of gdbmi.texinfo in the GDB + manual. + +2000-04-23 Eli Zaretskii + + * config/djgpp/README: Explain how to unpack using djunpack.bat. + +Fri Apr 21 15:23:13 2000 Andrew Cagney + + * stabsread.c (REG_STRUCT_HAS_ADDR): Delete default. + (define_symbol): Check REG_STRUCT_HAS_ADDR_P before using + REG_STRUCT_HAS_ADDR. + (define_symbol): Ditto. + + * valops.c (hand_function_call): Replace #ifdef + REG_STRUCT_HAS_ADDR with if REG_STRUCT_HAS_ADDR_P. Re-indent + affected code. + + * gdbarch.sh (REG_STRUCT_HAS_ADDR): Add along with the predicate + function REG_STRUCT_HAS_ADDR_P. + * gdbarch.h, gdbarch.c: Re-generate. + +2000-04-21 Elena Zannoni + + * gdb-stabs.h (SECT_OFF_MAX): Increase to 40. + +2000-04-21 Elena Zannoni + + * win32-nat.c (handle_load_dll): Don't treat .text as a special + section anymore. + * somread.c (som_symfile_offsets): Ditto. + * somsolib.c (som_solib_add_solib_objfile): Ditto. + +Fri Apr 21 16:14:38 2000 Andrew Cagney + + * MAINTAINERS: Make Jimmy Guo TUI maintainer. + +Fri Apr 21 14:37:40 2000 Andrew Cagney + + * command.h (help_all): Delete declaration. + * command.c (help_all): Add declaration. Convert function + argument list to ISO-C. + +Thu Apr 20 18:15:08 2000 Andrew Cagney + + * d10v-tdep.c (d10v_gdbarch_init): Initialize stack_align. + (d10v_stack_align): Make static. + * config/d10v/tm-d10v.h (STACK_ALIGN): Delete. + +Thu Apr 20 14:35:46 2000 Andrew Cagney + + * valops.c (hand_function_call): Replace #ifdef STACK_ALIGN with + run-time test for STACK_ALIGN_P. + * gdbarch.sh: Add support for function and variable predicates. + (STACK_ALIGN): Add. Implement with predicate - STACK_ALIGN_P. + * gdbarch.h, gdbarch.c: Re-generate. + +Thu Apr 20 17:39:11 2000 Andrew Cagney + + * defs.h, utils.c (free_current_contents): Change parameter to + void*. + + From Philippe De Muyter : + * printcmd.c (print_address_symbolic): Call `make_cleanup' with + `(free_current_contents, &x)', not `(free, x)'. + * utils.c (free_current_contents): Do not `free (NULL)'. + + * printcmd.c (print_address_symbolic): Cleanup after a failed + call to build_address_symbolic. + +2000-04-20 Christopher Faylor + + * wince-stub.c (FREE): New macro. + (mempool): Just free any buffer prior to reuse. Don't bother with + realloc. + (flag_single_step): New function. + (skip_message): Detect "helpful" Windows CE messages and skip sending + them to the host. + (wait_for_debug_event): Use skip_message to avoid sending debug + messages to the host. + (dispatch): Prelimary implementation of single step detection. + * wince.c: Rework SH single stepping code to be more consistent with + other wince targets. + (handle_output_debug_string): Allow first chance exceptions to come + through since they seem to be all that we get on some versions of + Windows CE. + (check_for_step): New function, conditionally compiled based on target. + (regptr): Delete obsolete function. + (handle_exception): Detect illegal instructions. + (get_child_debug_event): Return success only if event code matches + target. + (child_create_inferior): Reflect change to get_child_debug_event + arguments. + +2000-04-20 Christopher Faylor + + * win32-nat.c (thread_rec): Be more defensive about suspending already + suspended threads. + (safe_symbol_file_add_stub): New function. + (safe_symbole_file_add_cleanup): New function. + (safe_symbol_file_add): New function. + (handle_load_dll): Use wrapper to add DLL symbol information to avoid + bogus errors from non-stabs DLLs. + (handle_exception): Add work around for detection of first exception + breakpoint which does not seem to occur on W2K. Detect more "signals" + that can be effectively passed to the debuggee. Reorganize to eliminate + continue_status global. + (child_continue): Reorganize to eliminate continue_status global. + (child_wait): Ditto. + (child_resume): Ditto. + (get_child_debug_event): Ditto. Recognize when an a breakpoint + exception should be ignored. Change method for signalling when an + important event has occured to the caller. + (child_create_inferior): Use new method for noticing when + get_child_debug_event has found something interesting. + +Fri Apr 7 13:44:38 2000 glen mccready + + * rs6000-nat.c (xcoff_relocate_symtab): Grow buffer if ptrace() + fails due to lack of space. + +Fri Mar 24 12:10:38 2000 glen mccready + + * command.c, command.h (help_all): Add functionality to display + a complete listing of available commands. + +2000-04-20 Scott Bambrough + + * arm-linux-nat.c (PIDGET, TIDGET): New. + (get_thread_id, GET_THREAD_ID): New. + (fetch_nwfpe_register, store_nwfpe_register): New. + (fetch_register, store_register): New. + (fetch_fpregister, store_fpregister): New. + (fill_gregset, supply_gregset): New. + (fill_fpregset, supply_fpregset): New. + (fetch_fpregs): Modified to use thread id's. + (store_fpregs): Modified to use thread id's and + fetch_nwfpe_register. + (fetch_regs): Modified to use thread id's. + (store_regs): Modified to use thread id's. + (fetch_inferior_registers): Modified to handle single register + fetches. + (store_inferior_registers): Modified to handle single register + stores. + (arm_linux_register_u_addr): Removed. + + * configure.tgt: Added gdbserver to configdirs for arm*-*-linux*. + + * config/arm/linux.mh + (NATDEPFILES): Removed core-aout.o. Added core-regset.o. + (LOADLIBES): Define. + + * config/arm/nm-linux.h: Include config/nm-linux.h. + (ATTACH_DETACH): Removed. Defined in config/nm-linux.h. + (REGISTER_U_ADDR): Removed. + (SVR4_SHARED_LIBS): Removed. Defined in config/nm-linux.h. + (#include "solib.h"): Removed. Included via config/nm-linux.h. + +Thu Apr 20 18:54:15 2000 Andrew Cagney + + From Daniel Berlin and Tim Mooney + : + * infrun.c (follow_fork_mode_kind_names): NULL terminate + array. Re-indent. + (scheduler_enums): Ditto. + +Mon Apr 17 13:37:10 2000 Andrew Cagney + + * gdbarch.sh: Make multi-arch variable defaults, defaults for non- + multi-arch targets. + (TARGET_BFD_VMA_BIT, IEEE_FLOAT, CALL_DUMMY_WORDS, + SIZEOF_CALL_DUMMY_WORDS): Update. + + * inferior.h (CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS): Default + provided by gdbarch. + (CALL_DUMMY_P): Add FIXME. gdbarch should provide default. + + * valprint.c (IEEE_FLOAT): Default provided by gdbarch. + +2000-04-19 Jim Blandy + + Bring RETURN_VALUE_ON_STACK under gdbarch's control. + * gdbarch.sh (RETURN_VALUE_ON_STACK): New entry. + * gdbarch.c, gdbarch.h: Regenerated. + * arch-utils.c (default_return_value_on_stack): New function. + * arch-utils.h (default_return_value_on_stack): New declaration. + * values.c (RETURN_VALUE_ON_STACK): Delete default definition. + + * i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a + two-dimensional array, instead of faking it with explicit index + arithmetic. + + * minsyms.c (prim_record_minimal_symbol_and_info): Doc fix. + (Thanks to Guy Harris.) + +2000-04-19 Elena Zannoni + + * xcoffsolib.c (solib_add): Fix call to vmap_symtab(). + +2000-04-19 Peter Schauer + + * TODO: Update. + +Wed Apr 19 19:10:07 2000 Andrew Cagney + + * TODO: Document -Wreturn-type problem. + +2000-03-27 Peter Schauer + + * maint.c (_initialize_maint_cmds): Add `mt i' alias for `mt info'. + +2000-03-27 Peter Schauer + + * infcmd.c (_initialize_infcmd): Add `info r' alias for + `info registers'. + +Wed Apr 19 17:03:07 2000 Andrew Cagney + + From Philippe De Muyter : + * bcache.c (free_bcache): Do not free NULL. + +Wed Apr 19 16:37:47 2000 Andrew Cagney + + * TODO: Cleanup. + * NEWS: Update GDB version. Duplicate paragraph explaining + obsolete. + +Wed Apr 19 13:06:55 2000 Andrew Cagney + + * Makefile.in (distclean): Delete tui/Makefile. + * TODO: Add deletion of tui/Makefile.in to list. + +2000-04-17 Elena Zannoni + + * symfile.h (struct section_addr_info ): Remove fields for special + treatment of .text, .data and .bss sections. + + * solib.c (symbol_add_stub): The special field text_addr is not + available anymore. Search for the .text field the hard way. + + * symfile.c (build_section_addr_info_from_section_table): Don't + fill in {text, data, bss}_addr any more. + (default_symfile_offsets): Don't use {text, data, bss}_addr fields + to fill in section_offsets for objfile. + (syms_from_objfile): Don't deal with {text, data, bss}_addr as a + special case anymore. + (add_symbol_file_command): Ditto. + +2000-04-17 Elena Zannoni + + symfile.c: (symbol_file_command): Remove support for rombug, to + simplify code. + +2000-04-17 Elena Zannoni + + * symfile.c (add_symbol_file_command): Rewrite the arguments + processing part. Simplify syntax of command. Remove support for + rombug. + (_initialize_symfile): Update help message for add-symbol-file + command. + +Mon Apr 17 15:53:38 2000 Andrew Cagney + + * gdbarch.sh (IEEE_FLOAT): Only dump when defined. + * gdbarch.h, gdbarch.c: Re-generate. + +Mon Apr 17 11:26:01 2000 Andrew Cagney + + * remote.c (REMOTE_TRANSLATE_XFER_ADDRESS), mem-break.c + (MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT), target.h + (BREAKPOINT_FROM_PC), valops.c (COERCE_FLOAT_TO_DOUBLE), + gdbarch.sh (D10V_MAKE_DADDR, D10V_MAKE_IADDR, + FRAMELESS_FUNCTION_INVOCATION, REGISTER_CONVERTIBLE, + REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, + REGISTER_NAME), findvar.c (POINTER_TO_ADDRESS, + ADDRESS_TO_POINTER): Delete default definition. Handled by + gdbarch. + + * gdbarch.sh: Make multi-arch defaults, defaults for non- + multi-arch targets. + (REGISTER_NAME, COERCE_FLOAT_TO_DOUBLE, REGISTER_CONVERTIBLE, + REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, + D10V_MAKE_DADDR, D10V_MAKE_IADDR, BREAKPOINT_FROM_PC, + MEMORY_INSERT_BREAKPOINT, MEMORY_REMOVE_BREAKPOINT, + REMOTE_TRANSLATE_XFER_ADDRESS, FRAMELESS_FUNCTION_INVOCATION): + Provide default/legacy implementation. + (REGISTER_NAMES, CALL_DUMMY): Allow legacy definition. + * gdbarch.h, gdbarch.c: Re-generate. + +2000-04-16 Jim Blandy + + * findvar.c (store_typed_address, extract_typed_address): Fix + function names in error messages. + +2000-04-16 Eli Zaretskii + + * config/djgpp/config.sed: Fix the lines which edit clean: and + uninstall-info: targets. + +2000-04-14 Jim Blandy + + Bring IEEE_FLOAT under gdbarch's control. + * gdbarch.sh (IEEE_FLOAT): New entry. + * gdbarch.c, gdbarch.h: Regenerated. + * valprint.c (IEEE_FLOAT): Provide a default #definition for this. + (print_floating): Use IEEE_FLOAT as if it were an expression; use + the code specific to IEEE-format numbers whenever the value of + IEEE_FLOAT is non-zero. + * config/a29k/tm-a29k.h, config/alpha/tm-alpha.h, + config/arc/tm-arc.h, config/arm/tm-arm.h, config/fr30/tm-fr30.h, + config/h8300/tm-h8300.h, config/i386/tm-i386.h, + config/i960/tm-i960.h, config/m88k/tm-m88k.h, + config/mips/tm-mips.h, config/pa/tm-hppa.h, + config/sparc/tm-sparc.h, config/delta/tm-delta.h, + config/frv/tm-frv.h (IEEE_FLOAT): For all ports that #define + IEEE_FLOAT, make sure they give it the value (1). + + Provide the hooks needed to support architectures on which + pointers are not always simple byte addresses. + + * gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Two new + functions which architectures can redefine, defaulting to + generic_pointer_to_address and generic_address_to_pointer. + * findvar.c (extract_typed_address, store_typed_address, + generic_pointer_to_address, generic_address_to_pointer): New + functions. + (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default + definitions. + (extract_address, store_address): Doc fixes. + * values.c (value_as_pointer): Doc fix. + (value_from_pointer): New function. + * defs.h (extract_typed_address, store_typed_address): New + declarations. + * inferior.h (generic_address_to_pointer, + generic_pointer_to_address): New declarations. + * value.h (value_from_pointer): New declaration. + + The following changes are all of the general form "Use these + functions instead of these other functions." In each case, the + change is because the new calls provide enough information to do + the appropriate address / pointer conversions, where the old calls + did not, or because the new functions are more appropriately named + for the operation being performed. + + * ax-gdb.c (const_var_ref): Use value_from_pointer, not + value_from_longest. + * blockframe.c (generic_push_dummy_frame): Use read_pc and + read_sp, not read_register. + * c-valprint.c (c_val_print): Use extract_typed_address instead of + extract_address to extract vtable entries and references. + * cp-valprint.c (cp_print_value_fields): Use value_from_pointer + instead of value_from_longest to extract the vtable's address. + * eval.c (evaluate_subexp_standard): Use value_from_pointer + instead of value_from_longest to compute `this', and for doing + pointer-to-member dereferencing. + * findvar.c (read_register): Use extract_unsigned_integer, not + extract_address. + (read_var_value): Use store_typed_address instead of store_address + for building label values. + (locate_var_value): Use value_from_pointer instead of + value_from_longest. + * hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer, + instead of value_from_longest, to build arguments to __d_shl_get. + * printcmd.c (set_next_address): Use value_from_pointer, not + value_from_longest. + (x_command): Use value_from_pointer, not value_from_longest. + * tracepoint.c (set_traceframe_context): Use value_from_pointer, + not value_from_longest. + * valarith.c (value_add, value_sub): Use value_from_pointer, not + value_from_longest. + * valops.c (find_function_in_inferior, value_coerce_array, + value_coerce_function, value_addr, hand_function_call): Same. + * value.h (COERCE_REF): Use unpack_pointer, not unpack_long. + * values.c (unpack_long): Use extract_typed_address to produce + addresses from pointers and references, not extract_address. + (value_from_longest): Use store_typed_address instead of + store_address to produce pointer and reference values. + +2000-04-13 Mark Kettenis + + * acconfig.h (HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, HAVE_LWPID_T, + HAVE_PSADDR_T): Add them here instead of in config.in. + + * acconfig.h (PRFPREGSET_T_BROKEN): New define. + * configure.in: Add check for broken prfpregset_t type. + * lin-thread.c (gdb_prfpregset): New typedef, depends on + definition of PRFPREGSET_T_BROKEN. + (ps_lgetfpregs, ps_lsetfpregs, p_td_thr_getfpregs, + p_td_thr_setfpregs, thread_db_fetch_registers, + thread_db_store_registers): Use gdb_prfpregset_t instead of + prfpregset_t. + * config.in: Regenerated. + * configure: Regenerated. + +2000-04-13 DJ Delorie + + * mips-tdep.c (do_fp_register_row): copy the number of bytes + allocated, not the size of the pointer. + +2000-04-13 Peter Schauer + + * config/i386/nm-i386sol2.h (CANNOT_STEP_HW_WATCHPOINTS): Define. + * config/i386/tm-i386sol2.h (HAVE_I387_REGS): Define. + * i386v4-nat.c (supply_fpregset, fill_fpregset): Add code + to handle floating point registers if NUM_FREGS is not zero. + +2000-04-13 Nick Duffek + + * sol-thread.c (init_sol_core_ops): Initialize to_thread_alive + and document to_find_new_threads bug. + +2000-04-13 Eli Zaretskii + + * infrun.c (proceed, normal_stop): Change the error message about + failure to insert breakpoints/watchpoints so that it makes sense + even if ptrace is not used or no other processes can be active. + +Thu Apr 13 13:24:27 2000 Andrew Cagney + + * configure.in: Add --enable-maintainer-mode. + * aclocal.m4, configure: Re-generate. + + * Makefile.in ($(srcdir)/copying.c): Enable dependencies only when + on maintainer-mode. Update copying.c in source directory. + (copying.txt): Delete rule. + (copying.o): Add explict paths to $(srcdir) and explicit make + rule. + +2000-04-12 Kevin Buettner + + * ia64-linux-nat.c (IA64_PSR_DB, IA64_PSR_DD): Define. + (fetch_debug_register, fetch_debug_register_pair, + store_debug_register, store_debug_register_pair, is_power_of_2, + enable_watchpoints_in_psr, ia64_linux_insert_watchpoint, + ia64_linux_remove_watchpoint, ia64_linux_stopped_by_watchpoint): + New functions. + * config/ia64/nm-linux.h (TARGET_HAS_HARDWARE_WATCHPOINTS, + TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_STEPPABLE_WATCHPOINT, + STOPPED_BY_WATCHPOINT, target_insert_watchpoint, + target_remove_watchpoint): Define. + (ia64_linux_stopped_by_watchpoint, ia64_linux_insert_watchpoint, + ia64_linux_remove_watchpoint): Declare. + +2000-04-12 Eli Zaretskii + + * go32-nat.c (go32_insert_hw_breakpoint): When there are no more + hardware breakpoint resources, return EBUSY. + (go32_handle_nonaligned_watchpoint): If the argument WHAT is not + one of the enumerated values, return EINVAL. + +2000-04-12 Eli Zaretskii + + * README: Mention special build instructions for DJGPP. + * NEWS: Update with FP features on x87 platforms, and + DJGPP-related changes. + +2000-04-12 Eli Zaretskii + + * top.c (gdb_completer_file_name_break_characters): New variable. + (line_completion_function): When completing on file names, use + gdb_completer_file_name_break_characters as word break + characters for the readline library. + +2000-04-12 Mark Kettenis + + * i387-tdep.c (print_i387_value): Avoid call to + floatformat_to_doublest if long double type is the same on host + and target. + +2000-04-11 Fernando Nasser + + * wrapper.h: Remove definitions of internal functions. + * wrapper.c: Remove definitions of exported functions (which are + already in wrapper.h) and make static all internal wrap_* functions. + +Mon Apr 10 21:58:36 2000 Andrew Cagney + + * acconfig.h (USE_INCLUDED_REGEX): Add. + * Makefile.in (REGEX_CFLAGS): Delete + * configure.in (REGEX_CFLAGS): Delete. Use AC_DEFINE instead. + * configure, config.in: Re-generate. + +2000-04-10 Philip Blundell + + * arm-linux-nat.c (arm_skip_solib_resolver): Remove and move to + arm-linux-tdep.c. + * arm-linux-tdep.c (arm_skip_solib_resolver): New. + +2000-04-10 Fernando Nasser + + From 2000-04-10 Rodney Brown : + * command.h (enum command_class): Remove trailing "," to placate + AIX xlc. + +Mon Apr 10 20:17:32 2000 Andrew Cagney + + * TODO, NEWS: Update. Mention MI. + Mon Apr 10 00:21:09 2000 Andrew Cagney * gdbarch-utils.h, gdbarch-utils.c: Delete. @@ -345,7 +2156,7 @@ Fri Mar 31 08:59:58 2000 Andrew Cagney Safe version of value_subscript. * varobj.c (): Use gdb_value_subscript() to get an array element value. -2000-03-30 Michael Snyder +2000-03-30 Michael Snyder * ui-file.c: Include "gdb_string.h" * cli-out.c: Include gdb_string.h to avoid compiler warnings. @@ -354,7 +2165,7 @@ Fri Mar 31 08:59:58 2000 Andrew Cagney at various times. Casting pointer to int and vice versa gives warnings (and is not safe) if they are not the same size. -2000-03-30 Michael Snyder +2000-03-30 Michael Snyder * defs.h (struct continuation_arg): Make 'data' a union, to avoid casting problems when int and pointer are not the same size. @@ -415,7 +2226,7 @@ Wed Mar 29 10:16:35 2000 Andrew Cagney infrun.c (resume): Remove hardware watchpoints before stepping when CANNOT_STEP_HW_WATCHPOINTS is nonzero. -2000-03-28 Michael Snyder +2000-03-28 Michael Snyder * Makefile.in: Anchor tui-file.h dependency to $srcdir. @@ -608,7 +2419,7 @@ Fri Mar 24 13:44:57 2000 Andrew Cagney * MAINTAINERS: Add Fernando Nasser to testsuite maintainers. -2000-03-23 Michael Snyder +2000-03-23 Michael Snyder * solib.c (open_symbol_file_object): To sneak an int argument past catch_errors, instead of casting it to a pointer, simply @@ -655,7 +2466,7 @@ Fri Mar 24 13:44:57 2000 Andrew Cagney names/documentation for regular expressions. (_initialize_command): Add the apropos command. -2000-03-23 Michael Snyder +2000-03-23 Michael Snyder * sol-thread.c (ps_pglobal_lookup): Change argument type from paddr_t to psaddr_t. This mistake appears to date from an @@ -785,7 +2596,7 @@ Wed Mar 22 11:18:59 2000 Andrew Cagney * values.c (value_primitive_field): Set the offset in struct value we return when the field is a packed bitfield. -2000-03-20 Michael Snyder +2000-03-20 Michael Snyder * remote.c (remote_threads_extra_info): New function. Implement the extra thread info query for "info threads". @@ -942,7 +2753,7 @@ Fri Mar 17 11:06:59 2000 Philippe De Muyter * Makefile.in (go32-nat.o): Add prerequisites. (ALLDEPFILES): Add go32-nat.c. -2000-03-15 Michael Snyder +2000-03-15 Michael Snyder From "Peter.Schauer" * symfile.c (reread_symbols): Clear msymbol hash table. @@ -1078,6 +2889,10 @@ Mon Mar 13 18:54:42 2000 Andrew Cagney (rank_one_type): Change #if 0 to #ifdef DEBUG_OLOAD. * gdbtypes.h: Add REFERENCE_CONVERSION_BADNESS for "badness" associated with converting a non-reference to a reference. + * eval.c (evaluate_subexp_standard): for OP_VAR_VALUE, always + return full value object; for STRUCTOP_PTR, use pointer to + rtti type to get member / method if objectprint is set and + target type of pointer is class. * gdbtypes.c (rank_one_type): Add comment on how to eliminate the #ifdef DEBUG_OLOAD. @@ -2420,7 +4235,7 @@ Thu Jan 13 23:34:17 EST 2000 Nicholas Duffek * coffread.c (coff_symfile_read): Reinstate ability to recognize "pe" type. -2000-01-07 Michael Snyder +2000-01-07 Michael Snyder * uw-thread.c: New file to support UnixWare user-mode threads: contributed by Nickolas Duffek . diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 1e06710026f..2eafd6786bf 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -3,6 +3,7 @@ Blanket Write Privs +Jim Blandy jimb@cygnus.com Andrew Cagney ac131313@cygnus.com Stan Shebs shebs@apple.com Michael Snyder msnyder@cygnus.com @@ -36,7 +37,7 @@ mn10300 target Andrew Cagney cagney@cygnus.com powerpc target Kevin Buettner kevinb@cygnus.com Elena Zannoni ezannoni@cygnus.com arm target Fernando Nasser fnasser@cygnus.com - Jim Ingham jingham@cygnus.com + Jim Ingham jingham@apple.com Scott Bambrough scottb@netwinder.org m32r target Michael Snyder msnyder@cygnus.com IA-64 target Kevin Buettner kevinb@cygnus.com @@ -60,8 +61,8 @@ djgpp native Eli Zaretskii eliz@gnu.org MS Windows (N.T., CE, '00) host & native Chris Faylor cgf@cygnus.com GNU/Linux/x86 native & host - Jim Blandy jimb@cygnus.com Mark Kettenis kettenis@gnu.org + Jim Blandy jimb@cygnus.com GNU/Linux PPC native Kevin Buettner kevinb@cygnus.com hurd native Mark Kettenis kettenis@gnu.org macos host & native Stan Shebs shebs@apple.com @@ -75,17 +76,26 @@ Solaris/x86 native & host Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de Solaris/SPARC native & host David Taylor taylor@cygnus.com +Mac OS X Klee Dienes kdienes@apple.com + Jim Ingham jingham@apple.com Core: Generic components used by all of GDB generic arch support Andrew Cagney cagney@cygnus.com + Any host/target maintainer can add to + gdbarch.{c,h,sh}. Send tricky ones to cagney. target vector Andrew Cagney cagney@cygnus.com main (main.c, top.c) Elena Zannoni ezannoni@cygnus.com event loop Elena Zannoni ezannoni@cygnus.com generic symtabs Jim Blandy jimb@cygnus.com -dwarf readers Jim Blandy jimb@cygnus.com -elf reader Jim Blandy jimb@cygnus.com -stabs reader Jim Blandy jimb@cygnus.com + Elena Zannoni ezannoni@cygnus.com + dwarf readers Jim Blandy jimb@cygnus.com + Elena Zannoni ezannoni@cygnus.com + elf reader Jim Blandy jimb@cygnus.com + Elena Zannoni ezannoni@cygnus.com + stabs reader Jim Blandy jimb@cygnus.com + Elena Zannoni ezannoni@cygnus.com + coff reader Philippe De Muyter phdm@macqel.be tracing bytecode stuff Jim Blandy jimb@cygnus.com tracing Michael Snyder msnyder@cygnus.com threads Michael Snyder msnyder@cygnus.com @@ -94,20 +104,22 @@ breakpoint.c Michael Snyder msnyder@cygnus.com language support David Taylor taylor@cygnus.com C++ support Daniel Berlin dan@cgsoftware.com Java support Anthony Green green@cygnus.com + Objective-C/C++ Klee Dienes kdienes@apple.com + Jim Ingham jimgham@apple.com + Pascal support Pierre Muller muller@sourceware.cygnus.com expression eval David Taylor taylor@cygnus.com defs.h David Taylor taylor@cygnus.com utils.c David Taylor taylor@cygnus.com Scheme support Jim Blandy jimb@cygnus.com svr4 shlibs (solib.c) Jim Blandy jimb@cygnus.com -coff reader Philippe De Muyter phdm@macqel.be remote.c Andrew Cagney cagney@cygnus.com J.T. Conklin jtc@redback.com include/remote-sim.h, remote-sim.c Andrew Cagney cagney@cygnus.com sds protocol Fernando Nasser fnasser@cygnus.com - Jim Ingham jingham@cygnus.com + Jim Ingham jingham@apple.com rdi/adp protocol Fernando Nasser fnasser@cygnus.com - Jim Ingham jingham@cygnus.com + Jim Ingham jingham@apple.com gdbserver Stan Shebs shebs@apple.com documentation Stan Shebs shebs@apple.com Eli Zaretskii eliz@gnu.org @@ -121,11 +133,15 @@ Kernel Object Display Fernando Nasser fnasser@cygnus.com UI: External (user) interfaces. command interpreter Fernando Nasser fnasser@cygnus.com -gdbtk (c & tcl) Jim Ingham jingham@cygnus.com -libgui (w/foundry, sn) Jim Ingham jingham@cygnus.com +gdbtk (c & tcl) Syd Polk spolk@cygnus.com + Jim Ingham jingham@apple.com +libgui (w/foundry, sn) Syd Polk spolk@cygnus.com + Jim Ingham jingham@apple.com mi (gdb/mi) Andrew Cagney cagney@cygnus.com Elena Zannoni ezannoni@cygnus.com Fernando Nasser fnasser@cygnus.com +tui Technical Contact Point wdb@cup.hp.com + Jimmy Guo guo@cup.hp.com Misc: @@ -155,6 +171,8 @@ H.J. Lu hjl@lucon.org Nick Clifton nickc@cygnus.com Jonathan Larmour jlarmour@redhat.co.uk Glen McCready gkm@cygnus.com +Gary Thomas gthomas@redhat.com +Pierre Muller muller@sourceware.cygnus.com * Indicates folks we need to get Kerberos/SSH accounts ready so they diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 2684542d7be..32a1d21fc20 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -62,14 +62,6 @@ DLLTOOL = @DLLTOOL@ WINDRES = @WINDRES@ MIG = @MIG@ -# If the user configured GDB to include the TUI, the name of the tui -# library goes here. -TUI_LIBRARY = @TUI_LIBRARY@ - -# If the user configured GDB to include the TUI, the all-tui -# target goes here. -BUILD_TUI = @BUILD_TUI@ - # Flags that describe where you can find the termcap library. # This can be overridden in the host Makefile fragment file. TERMCAP = @TERM_LIB@ @@ -117,7 +109,6 @@ MMALLOC_CFLAGS = @MMALLOC_CFLAGS@ # We are using our own version of REGEX now to be consistent across # machines. REGEX = @REGEX@ -REGEX_CFLAGS = @REGEX_CFLAGS@ # Where is the BFD library? Typically in ../bfd. BFD_DIR = ../bfd @@ -143,11 +134,6 @@ INTL_DEPS = @INTLDEPS@ INTL_SRC = $(srcdir)/$(INTL_DIR) INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC) -# Where is the TUI library? Typically in tui/. -TUI_DIR=tui -TUI_SRC = $(srcdir)/$(TUI_DIR) -TUI_CFLAGS= -I$(TUI_SRC) - # # MI sub directory definitons # @@ -173,6 +159,33 @@ SUBDIR_MI_CLEAN= SUBDIR_MI_INSTALL= SUBDIR_MI_UNINSTALL= +# +# TUI sub directory definitions +# +SUBDIR_TUI_OBS = \ + tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o \ + tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o \ + tuiDisassem.o tuiSourceWin.o tuiRegs.o tuiDataWin.o +SUBDIR_TUI_SRCS = \ + tui/tui.c tui/tuiData.c tui/tuiSource.c \ + tui/tuiStack.c tui/tuiIO.c \ + tui/tuiGeneralWin.c tui/tuiLayout.c \ + tui/tuiWin.c tui/tuiCommand.c \ + tui/tuiDisassem.c tui/tuiSourceWin.c \ + tui/tuiRegs.c tui/tuiDataWin.c +SUBDIR_TUI_DEPS = +SUBDIR_TUI_INITS = \ + $(SUBDIR_TUI_SRCS) +SUBDIR_TUI_LDFLAGS= +SUBDIR_TUI_CFLAGS= \ + -DTUI=1 -I${srcdir}/tui +SUBDIR_TUI_ALL= +SUBDIR_TUI_CLEAN= +SUBDIR_TUI_INSTALL= +SUBDIR_TUI_UNINSTALL= + + + # Opcodes currently live in one of two places. Either they are in the # opcode library, typically ../opcodes, or they are in a header file # in INCLUDE_DIR. @@ -276,8 +289,8 @@ INTERNAL_WARN_CFLAGS = \ $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \ - $(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) \ - $(REGEX_CFLAGS) $(GDB_WARN_CFLAGS) + $(INTL_CFLAGS) $(ENABLE_CFLAGS) \ + $(GDB_WARN_CFLAGS) INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) # LDFLAGS is specifically reserved for setting from the command line @@ -311,7 +324,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 20000204 +VERSION = 5.0 DIST=gdb LINT=/usr/5bin/lint @@ -838,13 +851,6 @@ kdb: $(NTSSTART) $(OBS) $(NTSOBS) $(ADD_DEPS) $(CDEPS) ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \ -lc $(CLIBS) -# Have the TUI library depend on a phony target, so we'll always -# recurse and make sure it's up to date. If it is, then the file will -# be unchanged, and we won't rebuild it. -# .PHONY: check-tui -all-tui: - @(cd tui; ${MAKE} ${FLAGS_TO_PASS} all) - # Put the proper machine-specific files first, so M-. on a machine # specific routine gets the one for the correct machine. (FIXME: those # files go in twice; we should be removing them from the main list). @@ -942,19 +948,12 @@ doc/gdb.dvi: doc/gdb.info: cd doc; $(MAKE) gdb.info $(FLAGS_TO_PASS) -# When DJGPP Make runs on MS-DOS, it downcases all file names, so -# it doesn't find COPYING, and wants to make it... -copying.txt: - test -f copying.txt || \ - (test "$$LN_S" = "ln -s" && \ - ln -s $(srcdir)/COPYING copying.txt;) || \ - cp -p $(srcdir)/COPYING copying.txt 2>/dev/null || \ - ln $(srcdir)/COPYING copying.txt 2>/dev/null || \ - cp $(srcdir)/COPYING copying.txt - # Make copying.c from COPYING -copying.c: copying.txt copying.awk - awk -f $(srcdir)/copying.awk < $(srcdir)/copying.txt > copying.c +$(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ \ + $(srcdir)/COPYING $(srcdir)/copying.awk + awk -f $(srcdir)/copying.awk \ + < $(srcdir)/COPYING > $(srcdir)/copying.tmp + mv $(srcdir)/copying.tmp $(srcdir)/copying.c version.c: Makefile rm -f version.c @@ -1070,7 +1069,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ coff-solib.c convex-tdep.c convex-xdep.c \ core-sol2.c core-regset.c core-aout.c corelow.c \ dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \ - go32-nat.c gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \ + go32-nat.c h8300-tdep.c h8500-tdep.c \ hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \ hp-psymtab-read.c hp-symtab-read.c \ i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \ @@ -1078,7 +1077,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ i387-tdep.c \ i386-linux-tdep.c \ i960-tdep.c \ - ia64-linux-nat.c ia64-tdep.c \ + ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \ infptrace.c inftarg.c irix4-nat.c irix5-nat.c isi-xdep.c \ lynx-nat.c m3-nat.c \ m68k-tdep.c \ @@ -1201,7 +1200,9 @@ complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h) # OBSOLETE convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ # OBSOLETE $(inferior_h) -copying.o: copying.c $(defs_h) $(gdbcmd_h) +# Provide explicit rule/dependency - works for more makes. +copying.o: $(srcdir)/copying.c $(defs_h) $(gdbcmd_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h) @@ -1373,7 +1374,7 @@ arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \ gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h objfiles.h symfile.h $(symtab_h) target.h \ - $(value_h) gdb_string.h + $(value_h) gdb_string.h wrapper.h go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \ $(command_h) $(floatformat_h) target.h @@ -1381,11 +1382,6 @@ go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \ gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \ exc_request_U.h msg_U.h gnu-nat.h -# OBSOLETE gould-tdep.o: gould-tdep.c $(OP_INCLUDE)/np1.h $(defs_h) $(frame_h) \ -# OBSOLETE $(gdbcore_h) $(symtab_h) - -# OBSOLETE gould-xdep.o: gould-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) - h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) \ @@ -1440,8 +1436,10 @@ i960-tdep.o: i960-tdep.c $(floatformat_h) $(defs_h) $(expression_h) \ ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \ $(gdbcore_h) +ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) + ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) symfile.h $(gdbcore_h) \ - $(floatformat_h) objfiles.h $(INCLUDE_DIR)/elf/common.h + $(arch_utils_h) $(floatformat_h) objfiles.h $(INCLUDE_DIR)/elf/common.h infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) target.h language.h gdb_string.h @@ -1811,7 +1809,8 @@ sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ target.h sparc-tdep.o: sparc-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) objfiles.h symfile.h target.h gdb_string.h + $(inferior_h) objfiles.h symfile.h target.h gdb_string.h \ + $(arch_utils_h) sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) target.h @@ -1952,7 +1951,7 @@ gdb-events.o: gdb-events.c gdb-events.h $(defs_h) $(gdbcmd_h) ui-out.o: ui-out.c $(defs_h) $(ui_out_h) expression.h language.h cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \ - $(language_h) valprint.h varobj.h + $(language_h) valprint.h varobj.h wrapper.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) wrapper.h @@ -1995,4 +1994,69 @@ mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_parse_h) $(mi_cmds_h) mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c +# +# TUI dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +tui.o: $(srcdir)/tui/tui.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiIO.h \ + $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui.c +tuiCommand.o: $(srcdir)/tui/tuiCommand.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiWin.h $(srcdir)/tui/tuiIO.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiCommand.c +tuiData.o: $(srcdir)/tui/tuiData.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiData.c +tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiRegs.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDataWin.c +tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiSourceWin.h \ + $(srcdir)/tui/tuiStack.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDisassem.c +tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiGeneralWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c +tuiIO.o: $(srcdir)/tui/tuiIO.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiIO.h $(srcdir)/tui/tuiCommand.h \ + $(srcdir)/tui/tuiWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiIO.c +tuiLayout.o: $(srcdir)/tui/tuiLayout.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \ + $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiDisassem.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiLayout.c +tuiRegs.o: $(srcdir)/tui/tuiRegs.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiRegs.c +tuiSource.o: $(srcdir)/tui/tuiSource.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \ + $(srcdir)/tui/tuiSource.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSource.c +tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \ + $(srcdir)/tui/tuiSource.h $(srcdir)/tui/tuiDisassem.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSourceWin.c +tuiStack.o: $(srcdir)/tui/tuiStack.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiStack.c +tuiWin.o: $(srcdir)/tui/tuiWin.c \ + $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \ + $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \ + $(srcdir)/tui/tuiSourceWin.h $(srcdir)/tui/tuiDataWin.h + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiWin.c + ### end of the gdb Makefile.in. diff --git a/gdb/NEWS b/gdb/NEWS index 83913fdcd69..4f68e81518b 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -1,16 +1,60 @@ What has changed in GDB? (Organized release by release) -*** Changes since GDB-4.18: +*** Changes since GDB 5.0: -* New features +* New native configurations -On SVR4 native platforms (such as Solaris), if you attach to a process -without first loading a symbol file, GDB will now attempt to locate and -load symbols from the running process's executable file. +Alpha FreeBSD alpha*-*-freebsd* +x86 FreeBSD 3.x and 4.x i[3456]86*-freebsd[34]* -C++ support has been greatly improved. Overload resolution now works properly -in almost all cases. RTTI support is on the way. +FreeBSD versions before 2.2 are no longer supported. + +*** Changes in GDB 5.0: + +* Improved support for debugging FP programs on x86 targets + +Unified and much-improved support for debugging floating-point +programs on all x86 targets. In particular, ``info float'' now +displays the FP registers in the same format on all x86 targets, with +greater level of detail. + +* Improvements and bugfixes in hardware-assisted watchpoints + +It is now possible to watch array elements, struct members, and +bitfields with hardware-assisted watchpoints. Data-read watchpoints +on x86 targets no longer erroneously trigger when the address is +written. + +* Improvements in the native DJGPP version of GDB + +The distribution now includes all the scripts and auxiliary files +necessary to build the native DJGPP version on MS-DOS/MS-Windows +machines ``out of the box''. + +The DJGPP version can now debug programs that use signals. It is +possible to catch signals that happened in the debuggee, deliver +signals to it, interrupt it with Ctrl-C, etc. (Previously, a signal +would kill the program being debugged.) Programs that hook hardware +interrupts (keyboard, timer, etc.) can also be debugged. + +It is now possible to debug DJGPP programs that redirect their +standard handles or switch them to raw (as opposed to cooked) mode, or +even close them. The command ``run < foo > bar'' works as expected, +and ``info terminal'' reports useful information about the debuggee's +terminal, including raw/cooked mode, redirection, etc. + +The DJGPP version now uses termios functions for console I/O, which +enables debugging graphics programs. Interrupting GDB with Ctrl-C +also works. + +DOS-style file names with drive letters are now fully supported by +GDB. + +It is now possible to debug DJGPP programs that switch their working +directory. It is also possible to rerun the debuggee any number of +times without restarting GDB; thus, you can use the same setup, +breakpoints, etc. for many debugging sessions. * New native configurations @@ -32,6 +76,26 @@ Pyramid pyramid-*-* ARM RISCix arm-*-* (as host) Tahoe tahoe-*-* +Configurations that have been declared obsolete will be commented out, +but the code will be left in place. If there is no activity to revive +these configurations before the next release of GDB, the sources will +be permanently REMOVED. + +* Gould support removed + +Support for the Gould PowerNode and NP1 has been removed. + +* New features for SVR4 + +On SVR4 native platforms (such as Solaris), if you attach to a process +without first loading a symbol file, GDB will now attempt to locate and +load symbols from the running process's executable file. + +* Many C++ enhancements + +C++ support has been greatly improved. Overload resolution now works properly +in almost all cases. RTTI support is on the way. + * Remote targets can connect to a sub-program A popen(3) style serial-device has been added. This device starts a @@ -69,6 +133,16 @@ The ``apropos'' command searches through command names and documentation strings, printing out matches, making it much easier to try to find a command that does what you are looking for. +* New MI interface + +A new machine oriented interface (MI) has been added to GDB. This +interface is designed for debug environments running GDB as a separate +process. This is part of the long term libGDB project. See the +"GDB/MI" chapter of the GDB manual for further information. It can be +enabled by configuring with: + + .../configure --enable-gdbmi + *** Changes in GDB-4.18: * New native configurations diff --git a/gdb/README b/gdb/README index 46b9074ff17..cd8c6c2da67 100644 --- a/gdb/README +++ b/gdb/README @@ -1,5 +1,5 @@ - README for gdb-4.18 release - Updated 4 Apr 1999 by Jim Blandy + README for gdb-5.0 release + Updated 11 May 2000 by Andrew Cagney This is GDB, the GNU source-level debugger. A summary of new features is in the file `NEWS'. @@ -11,10 +11,10 @@ date release information, mailing list links and archives, etc. Unpacking and Installation -- quick overview ========================== -In this release, the GDB debugger sources, the generic GNU include + In this release, the GDB debugger sources, the generic GNU include files, the BFD ("binary file description") library, the readline library, and other libraries all have directories of their own -underneath the gdb-4.18 directory. The idea is that a variety of GNU +underneath the gdb-5.0 directory. The idea is that a variety of GNU tools can share a common copy of these things. Be aware of variation over time--for example don't try to build gdb with a copy of bfd from a release other than the gdb release (such as a binutils or gas @@ -23,64 +23,70 @@ Configuration scripts and makefiles exist to cruise up and down this directory tree and automatically build all the pieces in the right order. -When you unpack the gdb-4.18.tar.gz file, you'll find a directory -called `gdb-4.18', which contains: + When you unpack the gdb-5.0.tar.gz file, you'll find a directory +called `gdb-5.0', which contains: - COPYING config.sub* libiberty/ opcodes/ - COPYING.LIB configure* mmalloc/ readline/ - Makefile.in configure.in move-if-change* sim/ - README etc/ mpw-README texinfo/ - bfd/ gdb/ mpw-build.in utils/ - config/ include/ mpw-config.in - config.guess* install.sh* mpw-configure + COPYING config.if install-sh mmalloc readline + COPYING.LIB config.sub intl move-if-change sim + Makefile.in configure libiberty mpw-README symlink-tree + README configure.in ltconfig mpw-build.in texinfo + bfd djunpack.bat ltmain.sh mpw-config.in utils + config etc md5.sum mpw-configure ylwrap + config-ml.in gdb missing mpw-install + config.guess include mkinstalldirs opcodes To build GDB, you can just do: - cd gdb-4.18 + cd gdb-5.0 ./configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) -This will configure and build all the libraries as well as GDB. -If `configure' can't determine your system type, specify one as its -argument, e.g., sun4 or decstation. +(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly +different; see the file gdb-5.0/gdb/config/djgpp/README for details.) -If you get compiler warnings during this stage, see the `Reporting Bugs' -section below; there are a few known problems. + This will configure and build all the libraries as well as GDB. If +`configure' can't determine your system type, specify one as its +argument, e.g., `./configure sun4' or `./configure decstation'. -GDB requires an ANSI C compiler. If you do not have an ANSI C -compiler for your system, you may be able to download and install the -GNU CC compiler. It is available via anonymous FTP from ftp.gnu.org, -in /pub/gnu/gcc (as a URL, that's ftp://ftp.gnu.org/pub/gnu/gcc). + If you get compiler errors during this stage, see the `Reporting +Bugs' section below; there are a few known problems. -GDB can be used as a cross-debugger, running on a machine of one type -while debugging a program running on a machine of another type. See below. + GDB requires an ISO-C (ANSI C) compiler. If you do not have an +ISO-C compiler for your system, you may be able to download and +install the GNU CC compiler. It is available via anonymous FTP from +the directory `ftp://ftp.gnu.org/pub/gnu/gcc'. + + GDB can be used as a cross-debugger, running on a machine of one +type while debugging a program running on a machine of another type. +See below. More Documentation ****************** All the documentation for GDB comes as part of the machine-readable -distribution. The documentation is written in Texinfo format, which is -a documentation system that uses a single source file to produce both -on-line information and a printed manual. You can use one of the Info -formatting commands to create the on-line version of the documentation -and TeX (or `texi2roff') to typeset the printed version. - - GDB includes an already formatted copy of the on-line Info version of -this manual in the `gdb/doc' subdirectory. The main Info file is -`gdb-4.18/gdb/doc/gdb.info', and it refers to subordinate files matching -`gdb.info*' in the same directory. If necessary, you can print out -these files, or read them with any editor; but they are easier to read -using the `info' subsystem in GNU Emacs or the standalone `info' program, -available as part of the GNU Texinfo distribution. +distribution. The documentation is written in Texinfo format, which +is a documentation system that uses a single source file to produce +both on-line information and a printed manual. You can use one of the +Info formatting commands to create the on-line version of the +documentation and TeX (or `texi2roff') to typeset the printed version. + + GDB includes an already formatted copy of the on-line Info version +of this manual in the `gdb/doc' subdirectory. The main Info file is +`gdb-5.0/gdb/doc/gdb.info', and it refers to subordinate files +matching `gdb.info*' in the same directory. If necessary, you can +print out these files, or read them with any editor; but they are +easier to read using the `info' subsystem in GNU Emacs or the +standalone `info' program, available as part of the GNU Texinfo +distribution. If you want to format these Info files yourself, you need one of the Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'. If you have `makeinfo' installed, and are in the top level GDB -source directory (`gdb-4.18', in the case of version 4.18), you can make +source directory (`gdb-5.0', in the case of version 5.0), you can make the Info file by typing: cd gdb/doc @@ -89,7 +95,7 @@ the Info file by typing: If you want to typeset and print copies of this manual, you need TeX, a program to print its DVI output files, and `texinfo.tex', the Texinfo definitions file. This file is included in the GDB -distribution, in the directory `gdb-4.18/texinfo'. +distribution, in the directory `gdb-5.0/texinfo'. TeX is a typesetting program; it does not print files directly, but produces output files called DVI files. To print a typeset document, @@ -103,11 +109,11 @@ without any extension or a `.dvi' extension. This file tells TeX how to typeset a document written in Texinfo format. On its own, TeX cannot read, much less typeset a Texinfo file. `texinfo.tex' is distributed with GDB and is located in the -`gdb-4.18/texinfo' directory. +`gdb-5.0/texinfo' directory. If you have TeX and a DVI printer program installed, you can typeset and print this manual. First switch to the the `gdb' subdirectory of -the main source directory (for example, to `gdb-4.18/gdb') and then type: +the main source directory (for example, to `gdb-5.0/gdb') and then type: make gdb.dvi @@ -123,68 +129,71 @@ preparing GDB for installation; you can then use `make' to build the a single directory, whose name is usually composed by appending the version number to `gdb'. - For example, the GDB version 4.18 distribution is in the `gdb-4.18' + For example, the GDB version 5.0 distribution is in the `gdb-5.0' directory. That directory contains: -`gdb-4.18/{COPYING,COPYING.LIB}' +`gdb-5.0/{COPYING,COPYING.LIB}' Standard GNU license files. Please read them. -`gdb-4.18/bfd' +`gdb-5.0/bfd' source for the Binary File Descriptor library -`gdb-4.18/config*' +`gdb-5.0/config*' script for configuring GDB, along with other support files -`gdb-4.18/gdb' +`gdb-5.0/gdb' the source specific to GDB itself -`gdb-4.18/include' +`gdb-5.0/include' GNU include files -`gdb-4.18/libiberty' +`gdb-5.0/libiberty' source for the `-liberty' free software library -`gdb-4.18/mmalloc' +`gdb-5.0/mmalloc' source for the GNU memory-mapped malloc package -`gdb-4.18/opcodes' +`gdb-5.0/opcodes' source for the library of opcode tables and disassemblers -`gdb-4.18/readline' +`gdb-5.0/readline' source for the GNU command-line interface NOTE: The readline library is compiled for use by GDB, but will not be installed on your system when "make install" is issued. -`gdb-4.18/sim' +`gdb-5.0/sim' source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc) -`gdb-4.18/intl' +`gdb-5.0/intl' source for the GNU gettext library, for internationalization. This is slightly modified from the standalone gettext distribution you can get from GNU. -`gdb-4.18/texinfo' +`gdb-5.0/texinfo' The `texinfo.tex' file, which you need in order to make a printed manual using TeX. -`gdb-4.18/etc' +`gdb-5.0/etc' Coding standards, useful files for editing GDB, and other miscellanea. -`gdb-4.18/utils' +`gdb-5.0/utils' A grab bag of random utilities. + Note: the following instructions are for building GDB on Unix or +Unix-like systems. Instructions for building with DJGPP for +MS-DOS/MS-Windows are in the file gdb/config/djgpp/README. The simplest way to configure and build GDB is to run `configure' from the `gdb-VERSION-NUMBER' source directory, which in this example -is the `gdb-4.18' directory. +is the `gdb-5.0' directory. First switch to the `gdb-VERSION-NUMBER' source directory if you are not already in it; then run `configure'. For example: - cd gdb-4.18 + cd gdb-5.0 ./configure make @@ -200,8 +209,8 @@ you may need to run `sh' on it explicitly: sh configure If you run `configure' from a directory that contains source -directories for multiple libraries or programs, such as the `gdb-4.18' -source directory for version 4.18, `configure' creates configuration +directories for multiple libraries or programs, such as the `gdb-5.0' +source directory for version 5.0, `configure' creates configuration files for every directory level underneath (unless you tell it not to, with the `--norecursion' option). @@ -209,10 +218,10 @@ with the `--norecursion' option). directories in the GDB distribution, if you only want to configure that subdirectory; but be sure to specify a path to it. - For example, with version 4.18, type the following to configure only + For example, with version 5.0, type the following to configure only the `bfd' subdirectory: - cd gdb-4.18/bfd + cd gdb-5.0/bfd ../configure You can install `gdb' anywhere; it has no hardwired paths. However, @@ -241,13 +250,13 @@ directory. If the path to `configure' would be the same as the argument to `--srcdir', you can leave out the `--srcdir' option; it will be assumed.) - For example, with version 4.18, you can build GDB in a separate + For example, with version 5.0, you can build GDB in a separate directory for a Sun 4 like this: - cd gdb-4.18 + cd gdb-5.0 mkdir ../gdb-sun4 cd ../gdb-sun4 - ../gdb-4.18/configure sun4 + ../gdb-5.0/configure make When `configure' builds a configuration using a remote source @@ -268,8 +277,8 @@ called `configure' (or one of its subdirectories). The `Makefile' that `configure' generates in each source directory also runs recursively. If you type `make' in a source directory such -as `gdb-4.18' (or in a separate configured directory configured with -`--srcdir=PATH/gdb-4.18'), you will build all the required libraries, +as `gdb-5.0' (or in a separate configured directory configured with +`--srcdir=PATH/gdb-5.0'), you will build all the required libraries, and then build GDB. When you have multiple hosts or targets configured in separate @@ -312,7 +321,7 @@ you can use it to test your guesses on abbreviations--for example: Invalid configuration `i786v': machine `i786v' not recognized `config.sub' is also distributed in the GDB source directory -(`gdb-4.18', for version 4.18). +(`gdb-5.0', for version 5.0). `configure' options @@ -366,11 +375,13 @@ prefer; but you may abbreviate option names if you use `--'. code which looks even vaguely suspicious. You should only using this feature if you're compiling with GNU CC. It passes the following flags: - -Wall + -Wimplicit + -Wreturn-type + -Wcomment + -Wtrigraphs + -Wformat + -Wparentheses -Wpointer-arith - -Wstrict-prototypes - -Wmissing-prototypes - -Wmissing-declarations `--target=TARGET' Configure GDB for cross-debugging programs running on the specified @@ -404,32 +415,30 @@ See the GDB manual (gdb/doc/gdb.texinfo) for information on this. Kernel debugging ================= -I have't done this myself so I can't really offer any advice. -Remote debugging over serial lines works fine, but the kernel debugging -code in here has not been tested in years. Van Jacobson has + Remote debugging over serial lines works fine, but the kernel +debugging code in here has not been tested in years. Van Jacobson has better kernel debugging, but the UC lawyers won't let FSF have it. Remote debugging ================= -The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples of -remote stubs to be used with remote.c. They are designed to run -standalone on an m68k, i386, or SPARC cpu and communicate properly with -the remote.c stub over a serial line. + The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples +of remote stubs to be used with remote.c. They are designed to run +standalone on an m68k, i386, or SPARC cpu and communicate properly +with the remote.c stub over a serial line. -The directory gdb/gdbserver/ contains `gdbserver', a program that + The directory gdb/gdbserver/ contains `gdbserver', a program that allows remote debugging for Unix applications. gdbserver is only -supported for some native configurations, including Sun 3, Sun 4, -and Linux. +supported for some native configurations, including Sun 3, Sun 4, and +Linux. -There are a number of remote interfaces for talking to existing ROM + There are a number of remote interfaces for talking to existing ROM monitors and other hardware: remote-adapt.c AMD 29000 "Adapt" remote-array.c Array Tech RAID controller remote-bug.c Motorola BUG monitor - remote-d10v.c GDB protocol, talking to a d10v chip remote-e7000.c Hitachi E7000 ICE remote-eb.c AMD 29000 "EBMON" remote-es.c Ericsson 1800 monitor @@ -448,34 +457,36 @@ monitors and other hardware: remote-udi.c AMD 29000 using the AMD "Universal Debug Interface" remote-vx.c VxWorks realtime kernel -Remote-vx.c and the vx-share subdirectory contain a remote interface for the -VxWorks realtime kernel, which communicates over TCP using the Sun -RPC library. This would be a useful starting point for other remote- -via-ethernet back ends. + Remote-vx.c and the vx-share subdirectory contain a remote +interface for the VxWorks realtime kernel, which communicates over TCP +using the Sun RPC library. This would be a useful starting point for +other remote- via-ethernet back ends. -Remote-udi.c and the 29k-share subdirectory contain a remote interface -for AMD 29000 programs, which uses the AMD "Universal Debug Interface". -This allows GDB to talk to software simulators, emulators, and/or bare -hardware boards, via network or serial interfaces. Note that GDB only -provides an interface that speaks UDI, not a complete solution. You -will need something on the other end that also speaks UDI. + Remote-udi.c and the 29k-share subdirectory contain a remote +interface for AMD 29000 programs, which uses the AMD "Universal Debug +Interface". This allows GDB to talk to software simulators, +emulators, and/or bare hardware boards, via network or serial +interfaces. Note that GDB only provides an interface that speaks UDI, +not a complete solution. You will need something on the other end +that also speaks UDI. Reporting Bugs =============== -The correct address for reporting bugs found in gdb is -"bug-gdb@gnu.org". Please email all bugs, and all requests for -help with GDB, to that address. Please include the GDB version number -(e.g., gdb-4.18), and how you configured it (e.g., "sun4" or "mach386 + The correct address for reporting bugs found in gdb is +"bug-gdb@gnu.org". Please email all bugs, and all requests for help +with GDB, to that address. Please include the GDB version number +(e.g., gdb-5.0), and how you configured it (e.g., "sun4" or "mach386 host, i586-intel-synopsys target"). Since GDB now supports so many -different configurations, it is important that you be precise about this. -If at all possible, you should include the actual banner that GDB prints -when it starts up, or failing that, the actual configure command that -you used when configuring GDB. +different configurations, it is important that you be precise about +this. If at all possible, you should include the actual banner that +GDB prints when it starts up, or failing that, the actual configure +command that you used when configuring GDB. -For more information on how/whether to report bugs, see the GDB Bugs -section of the GDB manual (gdb/doc/gdb.texinfo). + For more information on how/whether to report bugs, see the GDB +Bugs section of the GDB manual (gdb/doc/gdb.texinfo) or the +gdb/CONTRIBUTE file. Known bugs: @@ -525,61 +536,47 @@ Known bugs: subsystem that is on the IDO CD, otherwise you will get complaints that certain files such as `/usr/include/syms.h' cannot be found. - * Notes for BSD/386: - To compile gdb-4.18 on BSD/386, you must run the configure script and - its subscripts with bash. Here is an easy way to do this: - - bash -c 'CONFIG_SHELL=/bin/bash ./configure' - - (configure will report i386-unknown-bsd). Then, compile with the - standard "make" command. - -GDB can produce warnings about symbols that it does not understand. By -default, these warnings are disabled. You can enable them by executing -`set complaint 10' (which you can put in your ~/.gdbinit if you like). -I recommend doing this if you are working on a compiler, assembler, -linker, or GDB, since it will point out problems that you may be able -to fix. Warnings produced during symbol reading indicate some mismatch -between the object file and GDB's symbol reading code. In many cases, -it's a mismatch between the specs for the object file format, and what -the compiler actually outputs or the debugger actually understands. - - -X Windows versus GDB -===================== + * Under Irix 6 you must build with GCC. The vendor compiler reports + as errors certain assignments that GCC considers to be warnings. + + GDB can produce warnings about symbols that it does not understand. +By default, these warnings are disabled. You can enable them by +executing `set complaint 10' (which you can put in your ~/.gdbinit if +you like). I recommend doing this if you are working on a compiler, +assembler, linker, or GDB, since it will point out problems that you +may be able to fix. Warnings produced during symbol reading indicate +some mismatch between the object file and GDB's symbol reading code. +In many cases, it's a mismatch between the specs for the object file +format, and what the compiler actually outputs or the debugger +actually understands. + + +Graphical interface to GDB -- X Windows, MS Windows +========================== -You should check out DDD, the Data Display Debugger. Here's the blurb -from the DDD web site, http://www.cs.tu-bs.de/softech/ddd: + Several graphical interfaces to GDB are available. You should +check: - The Data Display Debugger (DDD) is a popular graphical user - interface for command-line debuggers such as GDB, DBX, JDB, WDB, - XDB, the Perl debugger, and the Python debugger. Besides ``usual'' - front-end features such as viewing source texts, DDD has become - famous through its interactive graphical data display, where data - structures are displayed as graphs. A simple mouse click - dereferences pointers or views structure contents, updated each - time the program stops. Using DDD, you can reason about your - application by watching its data, not just by viewing it execute - lines of source code. + http://sourceware.cygnus.com/gdb/#gui -Emacs users will very likely enjoy the Grand Unified Debugger mode; -try typing `M-x gdb RET'. +for an up-to-date list. -Those interested in experimenting with a new kind of gdb-mode -should load gdb/gdba.el into GNU Emacs 19.25 or later. Comments -on this mode are also welcome. + Emacs users will very likely enjoy the Grand Unified Debugger mode; +try typing `M-x gdb RET'. Those interested in experimenting with a +new kind of gdb-mode should load gdb/gdba.el into GNU Emacs 19.25 or +later. Comments on this mode are also welcome. Writing Code for GDB ===================== -There is a lot of information about writing code for GDB in the + There is a lot of information about writing code for GDB in the internals manual, distributed with GDB in gdb/doc/gdbint.texinfo. You can read it by hand, print it by using TeX and texinfo, or process it into an `info' file for use with Emacs' info mode or the standalone `info' program. -If you are pondering writing anything but a short patch, especially + If you are pondering writing anything but a short patch, especially take note of the information about copyrights in the node Submitting Patches. It can take quite a while to get all the paperwork done, so we encourage you to start that process as soon as you decide you are @@ -590,26 +587,33 @@ think you will be ready to submit the patches. GDB Testsuite ============= -There is a DejaGNU based testsuite available for testing your newly -built GDB, or for regression testing GDBs with local modifications. + Included with the GDB distribution is a DejaGNU based testsuite +that can either be used to test your newly built GDB, or for +regression testing a GDB with local modifications. + + Running the testsuite requires the prior installation of DejaGNU, +which is generally available via ftp. The directory +ftp://sourceware.cygnus.com/pub/dejagnu/ will contain a recent +snapshot. Once DejaGNU is installed, you can run the tests in one of +the following ways: -Running the testsuite requires the prior installation of DejaGNU, -which is generally available via ftp; you'll need a pretty recent -release. Once DejaGNU is installed, you can run the tests in one of -two ways: + (1) cd gdb-5.0 + make check-gdb + +or - (1) cd gdb-4.18/gdb (assuming you also unpacked gdb) + (2) cd gdb-5.0/gdb make check or - (2) cd gdb-4.18/gdb/testsuite + (3) cd gdb-5.0/gdb/testsuite make site.exp (builds the site specific file) runtest -tool gdb GDB=../gdb (or GDB= as appropriate) -The second method gives you slightly more control in case of problems with -building one or more test executables or if you are using the testsuite -'standalone', without it being part of the GDB source tree. +The last method gives you slightly more control in case of problems +with building one or more test executables or if you are using the +testsuite `standalone', without it being part of the GDB source tree. See the DejaGNU documentation for further details. diff --git a/gdb/TODO b/gdb/TODO index b03a689f1df..bef7155d4f7 100644 --- a/gdb/TODO +++ b/gdb/TODO @@ -1,425 +1,1183 @@ If you find inaccuracies in this list, please send mail to -bug-gdb@prep.ai.mit.edu. If you would like to work on any of these, -you should consider sending mail to the same address, to find out -whether anyone else is working on it. +gdb-patches@sourceware.cygnus.com. If you would like to work on any +of these, you should consider sending mail to the same address, to +find out whether anyone else is working on it. -TODO: GDB 5.0 -============= + Known problems in GDB 5.0 + ========================= -Here are _all_ the issues that have been raised vis-a-vis the 5.0 -release. Also check the GDB, and other, mail archives -(http://sourceware.cygnus.com/ml/gdb/). +Below is a list of problems identified during the GDB 5.0 release +cycle. People hope to have these problems fixed in a follow-on +release. -If, however, you fix something, then feel free to tweek this file -(deleting the problem). Just send a note to gdb-patches so that I see -the change. +-- + +The BFD directory requires bug-fixed AUTOMAKE et.al. + +AUTOMAKE 1.4 incorrectly set the TEXINPUTS environment variable. It +contained the full path to texinfo.tex when it should have only +contained the directory. The bug has been fixed in the current +AUTOMAKE sources. Automake snapshots can be found in: + ftp://sourceware.cygnus.com/pub/gdb/snapshots +and ftp://sourceware.cygnus.com/pub/binutils + +-- + +RFD: infrun.c: No bpstat_stop_status call after proceed over break? +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00665.html + +GDB misses watchpoint triggers after proceeding over a breakpoint on +x86 targets. + +-- + +x86 linux GDB and SIGALRM (???) +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00803.html + +I know there are problems with single stepping through signal +handlers. These problems were present in 4.18. They were just masked +because 4.18 failed to recognize signal handlers. Fixing it is not +easy, and will require changes to handle_inferior_event(), that I +prefer not to make before the 5.0 release. + +Mark + +-- + +Revised UDP support (was: Re: [Fwd: [patch] UDP transport support]) +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00000.html + +(Broken) support for GDB's remote protocol across UDP is to be +included in the follow-on release. + +-- + +Can't build IRIX -> arm GDB. +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00356.html + +David Whedon writes: +> Now I'm building for an embedded arm target. If there is a way of turning +> remote-rdi off, I couldn't find it. It looks like it gets built by default +> in gdb/configure.tgt(line 58) Anyway, the build dies in +> gdb/rdi-share/unixcomm.c. SERPORT1 et. al. never get defined because we +> aren't one of the architectures supported. + +-- + +Problem with weak functions +http://sourceware.cygnus.com/ml/gdb/2000-05/msg00060.html + +Dan Nicolaescu writes: +> It seems that gdb-4.95.1 does not display correctly the function when +> stoping in weak functions. +> +> It stops in a function that is defined as weak, not in the function +> that is actualy run... + +-- + +GDB 5.0 doesn't work on Linux/SPARC + +-- + + Code Cleanups: Next Release + =========================== + +The following are small cleanups that will hopefully be completed by +the follow on to 5.0. + +-- + +Delete macro TARGET_BYTE_ORDER_SELECTABLE. + +Patches in the database. + +-- + +Purge PARAMS. + +Eliminate all uses of PARAMS in GDB's source code. + +-- + +Elimination of make_cleanup_func. (Andrew Cagney) + +make_cleanup_func elimination +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00791.html +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00814.html + +-- + +Fix copyright notices. + +Turns out that ``1998-2000'' isn't considered valid :-( + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00467.html + +-- + + Code Cleanups: General + ====================== + +The following are more general cleanups and fixes. They are not tied +to any specific release. + +-- + +Eliminate more compiler warnings. + +Of course there also needs to be the usual debate over which warnings +are valid and how to best go about this. + +One method: choose a single option; get agreement that it is +reasonable; try it out to see if there isn't anything silly about it +(-Wunused-parameters is an example of that) then incrementally hack +away. + +The other method is to enable all warnings and eliminate them from one +file at a time. + +-- + +Elimination of ``(catch_errors_ftype *) func''. + +Like make_cleanup_func it isn't portable. + +-- + +Nuke USG define. + +-- + +[PATCH/5] src/intl/Makefile.in:distclean additions +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00363.html + +Do not forget to merge the patch back into the trunk. + +-- + +Rationalize the host-endian code (grep for HOST_BYTE_ORDER). + +At present defs.h includes (which is linux specific) yet +almost nothing depends on it. Suggest "gdb_endian.h" which can also +handle and only include that where it is really +needed. + +-- + +Replace asprintf() calls with xasprintf() calls. + +As with things like strdup() most calls to asprintf() don't check the +return value. + +-- + +Replace strsave() + mstrsave() with libiberty:xstrdup(). + +-- + +Replace savestring() with something from libiberty. + +An xstrldup()? but that would have different semantics. + +-- + +Rationalize use of floatformat_unknown in GDB sources. + +Instead of defaulting to floatformat_unknown, should hosts/targets +specify the value explicitly? + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00447.html + +-- + +Add a ``name'' member to include/floatformat.h:struct floatformat. +Print that name in gdbarch.c. + +-- + +Sort out the harris mess in include/floatformat.h (it hardwires two +different floating point formats). + +-- + +See of the GDB local floatformat_do_doublest() and libiberty's +floatformat_to_double (which was once GDB's ...) can be merged some +how. + +-- + +Eliminate mmalloc() from GDB. + +Also eliminate it from defs.h. + +-- + +Eliminate PTR. ISO-C allows ``void *''. + +-- + +Eliminate abort (). + +GDB should never abort. GDB should either throw ``error ()'' or +``internal_error ()''. Better still GDB should naturally unwind with +an error status. + +-- + +GDB probably doesn't build on FreeBSD pre 2.2.x +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00378.html + +Fixes to get FreeBSD working on 2.2.x, 3.x and 4.x caused the code to +suffer bit rot. + +-- + +Updated readline + +Readline 4.? is out. A merge wouldn't hurt. Patches are in: + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00436.html + +-- + +Deprecate "fg". Apparently ``fg'' is actually continue. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00417.html + +-- + +Deprecate current use of ``floatformat_unknown''. + +Require all targets to explicitly provide their float format instead +of defaulting to floatformat unknown. Doing the latter leads to nasty +bugs. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00447.html + +-- + +Rationalize floatformat_to_double() vs floatformat_to_doublest(). + +Looks like GDB migrated floatformat_to_double() to libiberty but then +turned around and created a ..._to_doublest() the latter containing +several bug fixes. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00472.html + +-- + +Move floatformat_ia64_ext to libiberty/include floatformat.[ch]. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00466.html + +-- + +Always build ser-tcp.c. + +The patch as submitted was just going to add ser-tcp.c to the Alpha's +makefile. A better patch is to instead add ser-tcp.c to SER_HARDWARE +and make it a standard part of all debuggers. + +If problems occure then configure.in can sort them out. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00544.html + +-- + +Follow through `make check' with --enable-shared. + +When the srcware tree is configured with --enable-shared, the `expect' +program won't run properly. Jim Wilson found out gdb has a local hack +to set LD_LIBRARY_PATH, but, AFAIK, no other project has been hacked +similarly. + +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00845.html + +-- + + + New Features and Fixes + ====================== + +These are harder than cleanups but easier than work involving +fundamental architectural change. + +-- + +Add built-by, build-date, tm, xm, nm and anything else into gdb binary +so that you can see how the GDB was created. + +Some of these (*m.h) would be added to the generated config.h. That +in turn would fix a long standing bug where by the build process many +not notice a changed tm.h file. Since everything depends on config.h, +a change to *m.h forces a change to config.h and, consequently forces +a rebuild. + +-- + +Add an "info bfd" command that displays supported object formats, +similarly to objdump -i. + +Is there a command already? + +-- + +Fix ``I'm sorry, Dave, I can't do that.'' from symfile.c. + +This requires internationalization. + +-- + +Convert GDB build process to AUTOMAKE. + +See also sub-directory configure below. + +-- + +Cleanup configury support for optional sub-directories. + +Check how GCC handles multiple front ends for an example of how things +could work. A tentative first step is to rationalize things so that +all sub directories are handled in a fashion similar to gdb/mi. + +See also automake above. + +-- + +Restructure gdb directory tree so that it avoids any 8.3 and 14 +filename problems. + +-- + +Add a transcript mechanism to GDB. + +Such a mechanism might log all gdb input and output to a file in a +form that would allow it to be replayed. It could involve ``gdb +--transcript=FILE'' or it could involve ``(gdb) transcript file''. + +-- + +Can the xdep files be replaced by autoconf? + +-- + +Document trace machinery + +-- + +Document ui-out and ui-file. + +http://sourceware.cygnus.com/ml/gdb/2000-04/msg00121.html + +-- + +Update texinfo.tex to latest? + + + +-- + +Incorporate agentexpr.texi into gdb.texinfo + +agentexpr.texi mostly describes the details of the byte code used for +tracepoints, not the internals of the support for this in GDB. So it +looks like gdb.texinfo is a better place for this information. + +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00566.html + +-- + +Document overlay machinery. + +-- + +``(gdb) catch signal SIGNAL'' + +Overlaps with ``handle SIGNAL'' but the implied behavour is different. +You can attach commands to a catch but not a handle. A handle has a +limited number of hardwired actions. + +-- + +Get the TUI working on all platforms. + +-- + +Add support for ``gdb --- PROGRAM ARGS ...''. +Add support for ``gdb -cmd=...'' + +Along with many variations. Check: + +????? for a full discussion. + +for a discussion. + +-- + +Implement ``(gdb) !ls''. + +Which is very different from ``(gdb) ! ls''. Implementing the latter +is trivial. + +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00034.html + +-- + +Replace the code that uses the host FPU with an emulator of the target +FPU. + +-- + + Thread Support + ============== + +-- + +Generic: lin-thread cannot handle thread exit (Mark Kettenis, Michael +Snyder) http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00525.html + +The thread_db assisted debugging code doesn't handle exiting threads +properly, at least in combination with glibc 2.1.3 (the framework is +there, just not the actual code). There are at least two problems +that prevent this from working. + +As an additional reference point, the pre thread_db code did not work +either. + +-- + +GNU/Linux/x86 and random thread signals (and Solaris/SPARC but not +Solaris/x86). +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00336.html + +Christopher Blizzard writes: + +So, I've done some more digging into this and it looks like Jim +Kingdon has reported this problem in the past: + +http://sourceware.cygnus.com/ml/bug-gdb/1999-10/msg00058.html + +I can reproduce this problem both with and without Tom's patch. Has +anyone seen this before? Maybe have a solution for it hanging around? +:) + +There's a test case for this documented at: + +when debugging threaded applications you get extra SIGTRAPs +http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=9565 + +[There should be a GDB testcase - cagney] + +-- + +GDB5 TOT on unixware 7 +http://sourceware.cygnus.com/ml/gdb/2000-04/msg00119.html + +Robert Lipe writes: +> I just spun the top of tree of the GDB5 branch on UnixWare 7. As a +> practical matter, the current thread support is somewhat more annoying +> than when GDB was thread-unaware. + +-- + +Migrate qfThreadInfo packet -> qThreadInfo. (Andrew Cagney) + +Add support for packet enable/disable commands with these thread +packets. General cleanup. + +[PATCH] Document the ThreadInfo remote protocol queries +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00832.html + +[PATCH] "info threads" queries for remote.c +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00831.html + +-- + + Language Support + ================ + +New languages come onto the scene all the time. + +-- + +Pascal (Pierre Muller, David Taylor) + +Pierre Muller has contributed patches for adding Pascal Language +support to GDB. + +2 pascal language patches inserted in database +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00521.html + +Indent -gnu ? +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00496.html + +-- + +Java (Anthony Green, David Taylor) + +Anthony Green has a number of Java patches that did not make it into +the 5.0 release. + +Patch: java tests +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00512.html + +Patch: java booleans +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00515.html + +Patch: handle N_MAIN stab +http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00527.html + +-- + +[Comming...] + +Modify gdb to work correctly with Pascal. + +-- + +Re: Various C++ things + +value_headof/value_from_vtable_info are worthless, and should be +removed. The one place in printcmd.c that uses it should use the RTTI +functions. + +RTTI for g++ should be using the typeinfo functions rather than the +vtables. The typeinfo functions are always at offset 4 from the +beginning of the vtable, and are always right. The vtables will have +weird names like E::VB sometimes. The typeinfo function will always +be "E type_info function", or somesuch. + +value_virtual_fn_field needs to be fixed so there are no failures for +virtual functions for C++ using g++. + +Testsuite cases are the major priority right now for C++ support, +since i have to make a lot of changes that could potentially break +each other. + +-- + +Add support for Modula3 + +Get DEC/Compaq to contribute their Modula-3 support. + +-- + + Remote Protocol Support + ======================= + +-- + +set/show remote X-packet ... + +``(gdb) help set remote X-packet'' doesn't list the applicable +responses. The help message needs to be expanded. + +-- + +Remote protocol doco feedback. + +Too much feedback to mention needs to be merged in (901660). Search +for the word ``remote''. + + +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00023.html +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00056.html +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00382.html + +-- + +GDB doesn't recover gracefully from remote protocol errors. + +GDB wasn't checking for NAKs from the remote target. Instead a NAK is +ignored and a timeout is required before GDB retries. A pre-cursor to +fixing this this is making GDB's remote protocol packet more robust. -The names in paren are those that might know more about the problem. -They don't necessarily indicate the people that will fix the problem. +While downloading to a remote protocol target, gdb ignores packet +errors in so far as it will continue to edownload with chunk N+1 even +if chunk N was not correctly sent. This causes gdb.base/remote.exp to +take a painfully long time to run. As a PS that test needs to be +fixed so that it builds on 16 bit machines. -- -GDB 5.0: Must have ------------------- +Add the cycle step command. -These are things that have been identifed as must-have for this -release of GDB. +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00237.html -- -GDB 5.0: Nice to have ---------------------- +Resolve how to scale things to support very large packets. -These are things that might make it in 5.0 but don't sit in the -critical path. If they miss the 5.0 cut then they definitly should -make the follow-on release. +-- + +Resolve how to handle a target that changes things like its endianess +on the fly - should it be returned in the ``T'' packet? + +Underlying problem is that the register file is target endian. If the +target endianess changes gdb doesn't know. -- -Generic: lin-thread cannot handle thread exit (Mark Kettenis, Michael Snyder) -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00525.html + Symbol Support + ============== -The thread_db assisted debugging code doesn't handle exiting threads -properly, at least in combination with glibc 2.1.3 (the framework is -there, just not the actual code). There are at least two problems -that prevent this from working. +If / when GDB starts to support the debugging of multi-processor +(rather than multi-thread) applications the symtab code will need to +be updated a little so that several independant symbol tables are +active at a given time. -As an additional reference point, the pre thread_db code didn't work -either. +The other interesting change is a clarification of the exact meaning +of CORE_ADDR and that has had consequences for a few targets (that +were abusing that data type). -- -Java (Anthony Green, David Taylor) +Investiagate ways of reducing memory. -Anthony Green has started contributing late breaking Java patches: +-- -Patch: java tests -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00512.html +Investigate ways of improving load time. -Patch: java booleans -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00515.html +-- -Patch: handle N_MAIN stab -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00527.html +Get the d10v to use POINTER_TO_ADDRESS and ADDRESS_TO_POINTER. -It should be able to squeeze these in. +Consequence of recent symtab clarification. No marks for figuring out +who maintains the d10v. -- -Pascal (Pierre Muller, David Taylor) +Get the MIPS to correctly sign extend all address <-> pointer +conversions. -The pascal support patches nave been added to the patch data base. I -[cagney] strongly suspect that they are better suited for 5.1. +Consequence of recent symtab clarification. No marks for figuring out +who maintains the MIPS. -Indent -gnu ? -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00496.html +-- -2 pascal language patches inserted in database -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00521.html + Testsuite Support + ================= + +There are never to many testcases. -- -Programs run under GDB have SIGCHLD masked. +Better thread testsuite. -[I think this can be worked around by using the action command - -cagney] +-- + +Better C++ testsuite. -- -GNU/Linux/x86 and random thread signals (and Solaris/SPARC but not -Solaris/x86) +Look at adding a GDB specific testsuite directory so that white box +tests of key internals can be added (eg ui_file). -Christopher Blizzard writes: +-- -So, I've done some more digging into this and it looks like Jim -Kingdon has reported this problem in the past: +Separate out tests that involve the floating point (FP). -http://sourceware.cygnus.com/ml/bug-gdb/1999-10/msg00058.html +(Something for people brining up new targets). FP and non-fp tests +are combined. I think there should be set of basic tests that +exercise pure integer support and then a more expanded set that +exercise FP and FP/integer interactions. -I can reproduce this problem both with and without Tom's patch. Has -anyone seen this before? Maybe have a solution for it hanging around? -:) +As an example, the MIPS, for n32 as problems with passing FP's and +structs. Since most inferior call tests include FP it is difficult to +determine of the integer tests are ok. -There's a test case for this documented at: +-- -when debugging threaded applications you get extra SIGTRAPs -http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=9565 + Architectural Changes: General + ============================== -[There should be a GDB testcase - cagney] +These are harder than simple cleanups / fixes and, consequently +involve more work. Typically an Architectural Change will be broken +down into a more digestible set of cleanups and fixes. -- -IRIX? +Cleanup software single step. -Benjamin Gamsa wrote: +At present many targets implement software single step by directly +blatting memory (see rs6000-tdep.c). Those targets should register +the applicable breakpoints using the breakpoint framework. Perhaphs a +new internal breakpoint class ``step'' is needed. -Has anyone successfully built the latest (from cvs) gdb on IRIX6.4 or -later? The first problem I hit is that proc-api.c includes -sys/user.h, which no longer exists under IRIX6.4. If I comment out -that include, the next problem I hit is that PIOCGETPR and PIOCGETU -are no longer defined in IRIX6.4 (presumably related to the -disappearance of user.h). +-- + +Replace READ_FP() with FRAME_HANDLE(). + +READ_FP() is a hangover from the days of the vax when the ABI really +did have a frame pointer register. Modern architectures typically +construct a virtual frame-handle from the stack pointer and various +other bits of string. + +Unfortunatly GDB still treats this synthetic FP register as though it +is real. That in turn really confuses users (arm and ``print $fp'' VS +``info registers fp''). The synthetic FP should be separated out of +the true register set presented to the user. -- -Regressions (prologue) with devel GCC. +Register Cache Cleanup (below from Andrew Cagney) + +I would depict the current register architecture as something like: + + High GDB --> Low GDB + | | + \|/ \|/ + --- REG NR ----- + | + register + REGISTER_BYTE(reg_nr) + | + \|/ + ------------------------- + | extern register[] | + ------------------------- + +where neither the high (valops.c et.al.) or low gdb (*-tdep.c) are +really clear on what mechanisms they should be using to manipulate that +buffer. Further, much code assumes, dangerously, that registers are +contigious. Having got mips-tdep.c to support multiple ABIs, believe +me, that is a bad assumption. Finally, that register cache layout is +determined by the current remote/local target and _not_ the less +specific target ISA. In fact, in many cases it is determined by the +somewhat arbitrary layout of the [gG] packets! + + +How I would like the register file to work is more like: + + + High GDB + | + \|/ + pseudo reg-nr + | + map pseudo <-> + random cache + bytes + | + \|/ + ------------ + | register | + | cache | + ------------ + /|\ + | + map random cache + bytes to target + dependant i-face + /|\ + | + target dependant + such as [gG] packet + or ptrace buffer + +The main objectives being: + + o a clear separation between the low + level target and the high level GDB + + o a mechanism that solves the general + problem of register aliases, overlaps + etc instead of treating them as optional + extras that can be wedged in as an after + thought (that is a reasonable description + of the current code). + + Identify then solve the hard case and the + rest just falls out. GDB solved the easy + case and then tried to ignore the real + world :-) + + o a removal of the assumption that the + mapping between the register cache + and virtual registers is largely static. + If you flip the USR/SSR stack register + select bit in the status-register then + the corresponding stack registers should + reflect the change. + + o a mechanism that clearly separates the + gdb internal register cache from any + target (not architecture) dependant + specifics such as [gG] packets. + +Of course, like anything, it sounds good in theory. In reality, it +would have to contend with many<->many relationships at both the +virt<->cache and cache<->target level. For instance: + + virt<->cache + Modifying an mmx register may involve + scattering values across both FP and + mmpx specific parts of a buffer + + cache<->target + When writing back a SP it may need to + both be written to both SP and USP. + + +Hmm, + +Rather than let this like the last time it was discussed, just slip, I'm +first going to add this e-mail (+ references) to TODO. I'd then like to +sketch out a broad strategy I think could get us there. + + +First thing I'd suggest is separating out the ``extern registers[]'' +code so that we can at least identify what is using it. At present +things are scattered across many files. That way we can at least +pretend that there is a cache instead of a global array :-) + +I'd then suggest someone putting up a proposal for the pseudo-reg / +high-level side interface so that code can be adopted to it. For old +code, initially a blanket rename of write_register_bytes() to +deprecated_write_register_bytes() would help. + +Following that would, finaly be the corresponding changes to the target. -The current head of the GCC branch doesn't co-operate well with GDB -over debug information. +-- + +Check that GDB can handle all BFD architectures (Andrew Cagney) -Regressions problem (200 failures) -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00475.html +There should be a test that checks that BFD/GDB are in sync with +regard to architecture changes. Something like a test that first +queries GDB for all supported architectures and then feeds each back +to GDB.. Anyone interested in learning how to write tests? :-) -- -RFA: infrun.c, breakpoint.c: Kludge for Solaris x86 hardware watchpoint support -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00664.html + Architectural Change: Multi-arch et al. + ======================================= + +The long term objective is to remove all assumptions that there is a +single target with a single address space with a single instruction +set architecture and single application binary interface. -Unfortunately I'd need the following kludge to work around a Solaris -x86 kernel problem with hardware watchpoint support. See the comment -in the patches for a description of the problem. +This is an ongoing effort. The first milestone is to enable +``multi-arch'' where by all architectural decisions are made at +runtime. + +It should be noted that ``gdbarch'' is really ``gdbabi'' and +``gdbisa''. Once things are multi-arched breaking that down correctly +will become much easier. -- -RFD: infrun.c: No bpstat_stop_status call after proceed over break ? -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00665.html +GDBARCH cleanup (Andrew Cagney) + +The non-generated parts of gdbarch.{sh,h,c} should be separated out +into arch-utils.[hc]. -I am currently trying to fix a GDB bug with missing watchpoint triggers -after proceeding over a breakpoint on x86 targets. +Document that gdbarch_init_ftype could easily fail because it didn't +identify an architecture. -- -x86 linux GDB and SIGALRM (???) -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00803.html +Fix BELIEVE_PPC_PROMOTION. Change it to BELIEVE_PPC_PROMOTION_P? + +At present there is still #ifdef BELIEVE_PPC_PROMOTION code in the +symtab file. -- -Migrate qfThreadInfo packet -> qThreadInfo. (Andrew Cagney) +Fix ``set architecture '' -Add support for packet enable/disable commands with these thread -packets. General cleanup. +This command should expand to a list of all supported architectures. +At present ``info architecture'' needs to be used. That is simply +wrong. It involves the use of add_set_enum_cmd(). -[PATCH] Document the ThreadInfo remote protocol queries -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00832.html +-- -[PATCH] "info threads" queries for remote.c -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00831.html +Fix target_signal_from_host() etc. + +The name is wrong for starters. ``target_signal'' should probably be +``gdb_signal''. ``from_host'' should be ``from_target_signal''. +After that it needs to be multi-arched and made independant of any +host signal numbering. -- -MI documentation in GDB user guide. (Andrew Cagney, Elena Zannoni, -Stan Shebs, anyone else?) +Update ALPHA so that it uses ``struct frame_extra_info'' instead of +EXTRA_FRAME_INFO. + +This is a barrier to replacing mips_extra_func_info with something +that works with multi-arch. -> (Are there plans to make gdbmi.texi be part of the manual as well?) +-- -I'd like to see it go in there sooner rather than later too. Otherwise -you're introducing discrepancies between the manual and the documentation, -and everybody is confused - witness the lack of doc for the tracing -commands still, some two years after they were added... +Multi-arch mips_extra_func_info. -Discussion on MI can be found on the thread: [PATCH] GDB command-line -switches and annotations docs -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00639.html +This first needs the alpha to be updated so that it uses ``struct +frame_extra_info''. -- -Revised UDP support (was: Re: [Fwd: [patch] UDP transport support]) -http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00000.html +Rationalize TARGET_SINGLE_FORMAT and TARGET_SINGLE_BIT et al. + +Surely one of them is redundant. -- -problems loading shared libraries - with attached test case -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00820.html +Convert ALL architectures to MULTI-ARCH. -Hi, I'm having problems loading shared libraries. This is with a -build of gdb out of cvs that I pulled and built on March 27th and has -been there for at least a week. I haven't gone back further than -that. This is with the gcc that is shipping with Red Hat 6.2: +-- -Reading specs from -/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs gcc version -egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) +Select the initial multi-arch ISA / ABI based on --target or similar. -I'm using "set auto-solib-add 0" after main has been called. If I use -"shar" to load a shared library manually once I can't use it again to -load another shared library later. Please see the attached log for an -example of how to reproduce the problem. +At present the default is based on what ever is first in the BFD +archures table. It should be determined based on the ``--target=...'' +name. -- -GDB 5.0: Won't have -------------------- +Truly multi-arch. + +Enable the code to recognize --enable-targets=.... like BINUTILS does. -The following are on hold until GDB 5.0 is branched. In general they -won't go in as they unsettle the GDB sources. +Can the tm.h and nm.h files be eliminated by multi-arch. -- -ATTRIBUTE_UNUSED + Architectural Change: MI, LIBGDB and scripting languages + ======================================================== -The need for this as almost been eliminated. The next version of GCC -(assuming cagney gets the revised patch approved) will be able to -supress unused parameter warnings. +See also architectural changes related to the event loop. LIBGDB +can't be finished until there is a generic event loop being used by +all targets. + +The long term objective is it to be possible to integrate GDB into +scripting languages. -- -Delete macro TARGET_BYTE_ORDER_SELECTABLE. +Implement generic ``(gdb) commmand > file'' -Patches in the database. +Once everything is going through ui_file it should be come fairly +easy. + +http://sourceware.cygnus.com/ml/gdb/2000-04/msg00104.html -- -Updated readline +Replace gdb_stdtarg with gdb_targout (and possibly gdb_targerr). -Readline 4.? is out. A merge wouldn't hurt. +gdb_stdtarg is easily confused with gdb_stdarg. -- -Purge PARAMS +Extra ui_file methods - dump. -Something to do post 5.0 branch +Very useful for whitebox testing. -- -Elimination of make_cleanup_func. (Andrew Cagney) +Eliminate error_begin(). -make_cleanup_func elimination -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00791.html -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00814.html +With ui_file, there is no need for the statefull error_begin () +function. -- -ChangeLog.mi vs ChangeLog-mi (Andrew Cagney) -Needs further debate. +Send normal output to gdb_stdout. +Send error messages to gdb_stderror. +Send debug and log output log gdb_stdlog. -Re: [PATCH] Add change-log variables to more MI files -http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00811.html +GDB still contains many cases where (f)printf or printf_filtered () is +used when it should be sending the messages to gdb_stderror or +gdb_stdlog. The thought of #defining printf to something has crossed +peoples minds ;-) -- -Re: gdb-cvs fails on freebsd-elf -http://sourceware.cygnus.com/ml/gdb/2000-04/msg00004.html +Re-do GDB's output pager. -FreeBSD haven't contributed their local GDB changes back to the master -sources (they would at least need an FSF assignment by all -individuales that contributed to the work). Given the strong -likelhood that this will never happen, I'd suggest that a better -strategy would be for someone (with an FSF/GDD assignment) to do a new -(clean-room) implementation. That can then be accepted in time for -GDB 5.1. +GDB's output pager still relies on people correctly using *_filtered +for gdb_stdout and *_unfiltered for gdb_stdlog / gdb_stderr. +Hopefully, with all normal output going to gdb_stdout, the pager can +just look at the ui_file that the output is on and then use that to +decide what to do about paging. Sounds good in theory. -- -Re: Various C++ things +Check/cleanup MI documentation. -value_headof/value_from_vtable_info are worthless, and should be removed. -The one place in printcmd.c that uses it should use the RTTI functions. +The list of commands specified in the documentation needs to be +checked against the mi-cmds.c table in a mechanical way (so that they +two can be kept up-to-date). -RTTI for g++ should be using the typeinfo functions rather than the vtables. -The typeinfo functions are always at offset 4 from the beginning of the vtable, -and are always right. The vtables will have weird names like E::VB sometimes. -The typeinfo function will always be "E type_info function", or somesuch. +-- + +Convert MI into libgdb -value_virtual_fn_field needs to be fixed so there are no failures for virtual -functions for C++ using g++. +MI provides a text interface into what should be many of the libgdb +functions. The implementation of those functions should be separated +into the MI interface and the functions proper. Those functions being +moved to gdb/lib say. + +-- -Testsuite cases are the major priority right now for C++ support, since i have -to make a lot of changes that could potentially break each other. +Create libgdb.h +The first part can already be found in defs.h. -- -GDB 5.0: Test results ---------------------- -Please include: +MI's input does not use buffering. + +At present the MI interface reads raw characters of from an unbuffered +FD. This is to avoid several nasty buffer/race conditions. That code +should be changed so that it registers its self with the event loop +(on the input FD) and then push commands up to MI as they arrive. + +The serial code already does this. + +-- - o the output of `config.guess` - o the date - o the compiler - o a note mentioning the reason - for any serious failures. +Make MI interface accessable from existing CLI. -- -alpha-dec-osf4.0a, vendor compiler, 2000-03-04 +Add a breakpoint-edit command to MI. -Still has many compile warnings (mostly relating back to PTR vs void*) -but it did compile using: +It would be similar to MI's breakpoint create but would apply to an +existing breakpoint. It saves the need to delete/create breakpoints +when ever they are changed. - CC=cc .../configure - make +-- -Test results are: +Add directory path to MI breakpoint. -# of expected passes 6223 -# of unexpected failures 103 -# of unexpected successes 2 -# of expected failures 196 -# of unresolved testcases 6 -# of unsupported tests 1 +That way the GUI's task of finding the file within which the +breakpoint was set is simplified. -Looking at the output it would appear that GDB is stepping into some -functions instead of ``next'' ing over them: +-- - 35 dummy(); - (gdb) next - dummy () at /home/cagney/GDB-DEJAGNU/src/gdb/testsuite/gdb.base/all-types.c:41 - 41 { +Add a mechanism to reject certain expression classes to MI -Since there is no active maintainer, I'd consider this sufficient for -5.0 :-/ +There are situtations where you don't want GDB's expression +parser/evaluator to perform inferior function calls or variable +assignments. A way of restricting the expression parser so that such +operations are not accepted would be very helpful. -- -sparc-sun-solaris2.6, egcs-2.91.66, 2000-02-10 -http://sourceware.cygnus.com/ml/gdb-testers/2000-q1/msg00030.html +Remove sideffects from libgdb breakpoint create function. -There is a SIGTRAP problem that occures in ptrace.exp (Cagney to -expand on). +The user can use the CLI to create a breakpoint with partial +information - no file (gdb would use the file from the last +breakpoint). -# of expected passes 6420 -# of unexpected failures 7 -# of expected failures 199 +The libgdb interface currently affects that environment which can lead +to confusion when a user is setting breakpoints via both the MI and +the CLI. + +This is also a good example of how getting the CLI ``right'' will be +hard. -- -solaris 2.5.1 sparc?, 2.9-gnupro-99r1, 2000-02-10 -http://sourceware.cygnus.com/ml/gdb-testers/2000-q1/msg00032.html +Move gdb_lasterr to ui_out? -# of expected passes 6420 -# of unexpected failures 6 -# of expected failures 199 +The way GDB throws errors and records them needs a re-think. ui_out +handles the correct output well. It doesn't resolve what to do with +output / error-messages when things go wrong. -- -sparc-unknown-netbsdelf1.4P, egcs-1.1.2+, 2000-03-01 + Architectural Change: Async + =========================== -This is with a very recent kernel. +While GDB uses an event loop when prompting the user for input. That +event loop is not exploited by targets when they allow the target +program to continue. Typically targets still block in (target_wait()) +until the program again halts. -# of expected passes 6055 -# of unexpected failures 88 -# of unexpected successes 1 -# of expected failures 190 -# of unresolved testcases 59 +The closest a target comes to supporting full asynchronous mode are +the remote targets ``async'' and ``extended-async''. -- -GNU/Linux PPC -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00185.html +Asynchronous expression evaluator -Kevins merged it all in. +Inferior function calls hang GDB. -- -Unixware +Fix implementation of ``target xxx''. + +At present when the user specifies ``target xxxx'', the CLI maps that +directly onto a target open method. It is then assumed that the +target open method should do all sorts of complicated things as this +is the only chance it has. Check how the various remote targets +duplicate the target operations. Check also how the various targets +behave differently for purely arbitrary reasons. -Builds ok. Problems with some of the thread code. Unfortunate but -not a show stopper. Nick D's still looking at it. +What should happen is that ``target xxxx'' should call a generic +``target'' function and that should then co-ordinate the opening of +``xxxx''. This becomes especially important when you're trying to +open an asynchronous target that may need to perform background tasks +as part of the ``attach'' phase. -Re: uw-threads issues -http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00025.html +Unfortunatly, due to limitations in the old/creaking command.h +interface, that isn't possible. The function being called isn't told +of the ``xxx'' or any other context information. +Consequently a precursor to fixing ``target xxxx'' is to clean up the +CLI code so that it passes to the callback function (attatched to a +command) useful information such as the actual command and a context +for that command. Other changes such as making ``struct command'' +opaque may also help. - ------------------------------------------------ +-- +Make "target xxx" command interruptible. -General Wish List -================= +As things become async this becomes possible. A target would start +the connect and then return control to the event loop. A cntrl-c +would notify the target that the operation is to be abandoned and the +target code could respond. -- -GDBARCH cleanup (Andrew Cagney) +Add a "suspend" subcommand of the "continue" command to suspend gdb +while continuing execution of the subprocess. Useful when you are +debugging servers and you want to dodge out and initiate a connection +to a server running under gdb. -The non-generated parts of gdbarch.{sh,h,c} should be separated out -into gdbarch-utils.[hc] (Name ok). +[hey async!!] -The ``info architecture'' command should be replaced with a fixed -``set architecture'' (implemented using the command.c enum code). +-- -Document that gdbarch_init_ftype could easily fail because it didn't -identify an architecture. + TODO FAQ + ======== + +Frequently requested but not approved requests. -- -Check that GDB can handle all BFD architectures (Andrew Cagney) +Eliminate unused argument warnings using ATTRIBUTE_UNUSED. -There should be a test that checks that BFD/GDB are in sync with -regard to architecture changes. Something like a test that first -queries GDB for all supported architectures and then feeds each back -to GDB.. Anyone interested in learning how to write tests? :-) +The benefits on this one are thought to be marginal - GDBs design +means that unused parameters are very common. GCC 3.0 will also +include the option -Wno-unused-parameter which means that ``-Wall +-Wno-unused-parameters -Werror'' can be specified. -- -This list is probably not up to date, and opinions vary about the -importance or even desirability of some of the items. -Document trace machinery. -Document overlay machinery. + Legacy Wish List + ================ -Extend .gdbinit mechanism to specify name on command line, allow for -lists of files to load, include function of --tclcommand. +This list is not up to date, and opinions vary about the importance or +even desirability of some of the items. If you do fix something, it +always pays to check the below. + +-- @c This does not work (yet if ever). FIXME. @c @item --parse=@var{lang} @dots{} @@ -428,21 +1186,33 @@ lists of files to load, include function of --tclcommand. @c list of all supported languages, omit the argument. Without this @c option, @value{GDBN} is configured to parse all supported languages. -Add an "info bfd" command that displays supported object formats, -similarly to objdump -i. +-- START_INFERIOR_TRAPS_EXPECTED need never be defined to 2, since that is its default value. Clean this up. +-- + It should be possible to use symbols from shared libraries before we know exactly where the libraries will be loaded. E.g. "b perror" before running the program. This could maybe be done as an extension of the "breakpoint re-evaluation" after new symbols are loaded. +-- + Make single_step() insert and remove breakpoints in one operation. +[If this is talking about having single_step() insert the breakpoints, +run the target then pull the breakpoints then it is wrong. The +function has to return as control has to eventually be passed back to +the main event loop.] + +-- + Speed up single stepping by avoiding extraneous ptrace calls. +-- + Speed up single stepping by not inserting and removing breakpoints each time the inferior starts and stops. @@ -450,160 +1220,114 @@ Breakpoints should not be inserted and deleted all the time. Only the one(s) there should be removed when we have to step over one. Support breakpoints that don't have to be removed to step over them. -Update gdbint.texinfo to include doc on the directory structure and -the various tricks of building gdb. +[this has resulted in numerous debates. The issue isn't clear cut] -Do a tutorial in gdb.texinfo on how to do simple things in gdb. -E.g. how to set a breakpoint that just prints something and continues. -How to break on aborts. Etc. +-- Provide "voodoo" debugging of core files. This creates a zombie process as a child of the debugger, and loads it up with the data, stack, and regs of the core file. This allows you to call functions in the executable, to manipulate the data in the core file. -GDB reopens the source file on every line, as you "next" through it. +[you wish] -Referencing the vtbl member of a struct doesn't work. It prints OK -if you print the struct, but it gets 0 if you try to deref it. +-- -Persistent command history: A feature where you could save off a list -of the commands you did, so you can edit it into something that will bring -the target to the same place every time you source it. -This would also be useful for automated fast watchpointing; if you go -past the place where it watchpoints, you just start it over again and -do it more carefully. +GDB reopens the source file on every line, as you "next" through it. -Deal with the SunOS 4.0 and 4.1.1 ptrace bug that loses the registers if -the stack is paged out. +[still true? I've a memory of this being fixed] -Finish the C++ exception handling stub routines. Lint points them out -as unused statics functions. +-- Perhaps "i source" should take an argument like that of "list". -See if core-aout.c's fetch_core_registers can be used on more machines. -E.g. MIPS (mips-xdep.c). - -unpack_double() does not handle IEEE float on the target unless the host -is also IEEE. Death on a vax. - -Set up interface between GDB and INFO so that you can hop into interactive -INFO and back out again. When running under Emacs, should use Emacs -info, else fork the info program. Installation of GDB should install -its texinfo files into the info tree automagically, including the readline -texinfo files. - -"help address" ought to find the "help set print address" entry. - -Remove the VTBL internal guts from printouts of C++ structs, unless -vtblprint is set. +-- Remove "at 0xnnnn" from the "b foo" response, if `print address off' and if it matches the source line indicated. -The prompt at end of screen should accept space as well as CR. - -Check STORE_RETURN_VALUE on all architectures. Check near it in tm-sparc.h -for other bogosities. +-- -Check for storage leaks in GDB, I'm sure there are a lot! +The prompt at end of screen should accept space as well as CR. -vtblprint of a vtbl should demangle the names it's printing. +-- Backtrace should point out what the currently selected frame is, in its display, perhaps showing "@3 foo (bar, ...)" or ">3 foo (bar, ...)" rather than "#3 foo (bar, ...)". +-- + "i program" should work for core files, and display more info, like what actually caused it to die. +-- + "x/10i" should shorten the long name, if any, on subsequent lines. -Check through the code for FIXME comments and fix them. dbxread.c, -blockframe.c, and plenty more. (I count 634 as of 940621 - sts) +-- "next" over a function that longjumps, never stops until next time you happen to get to that spot by accident. E.g. "n" over execute_command which has an error. +-- + "set zeroprint off", don't bother printing members of structs which are entirely zero. Useful for those big structs with few useful members. +-- + GDB does four ioctl's for every command, probably switching terminal modes to/from inferior or for readline or something. +-- + terminal_ours versus terminal_inferior: cache state. Switch should be a noop if the state is the same, too. -ptype $i6 = void??! - -Clean up invalid_float handling so gdb doesn't coredump when it tries to -access a NaN. While this might work on SPARC, other machines are not -configured right. - -"b value_at ; commands ; continue ; end" stops EVERY OTHER TIME! -Then once you enter a command, it does the command, runs two more -times, and then stops again! Bizarre... (This behaviour has been -modified, but it is not yet 100% predictable when e.g. the commands -call functions in the child, and while there, the child is interrupted -with a signal, or hits a breakpoint.) - -help completion, help history should work. - -Check that we can handle stack trace through varargs AND alloca in same -function, on 29K. - -wait_for_inferior loops forever if wait() gives it an error. +-- "i frame" shows wrong "arglist at" location, doesn't show where the args should be found, only their actual values. +-- + There should be a way for "set" commands to validate the new setting before it takes effect. -A mess of floating point opcodes are missing from sparc-opcode.h. -Also, a little program should test the table for bits that are -overspecified or underspecified. E.g. if the must-be-ones bits -and the must-be-zeroes bits leave some fields unexamined, and the format -string leaves them unprinted, then point this out. If multiple -non-alias patterns match, point this out too. Finally, there should -be a sparc-optest.s file that tries each pattern out. This file -should end up coming back the same (modulo transformation comments) -if fed to "gas" then the .o is fed to gdb for disassembly. - -Eliminate all the core_file_command's in all the xdep files. -Eliminate separate declarations of registers[] everywhere. +-- "ena d" is ambiguous, why? "ena delete" seems to think it is a command! -Perhaps move the tdep, xdep, and nat files, into the config -subdirectories. If not, at least straighten out their names so that -they all start with the machine name. - -inferior_status should include stop_print_frame. It won't need to be -reset in wait_for_inferior after bpstat_stop_status call, then. +-- i line VAR produces "Line number not known for symbol ``var''.". I thought we were stashing that info now! +-- + We should be able to write to random files at hex offsets like adb. -Make "target xxx" command interruptible. +-- + +[elena - delete this] Handle add_file with separate text, data, and bss addresses. Maybe handle separate addresses for each segment in the object file? +-- + +[Jimb/Elena delete this one] + Handle free_named_symtab to cope with multiply-loaded object files in a dynamic linking environment. Should remember the last copy loaded, but not get too snowed if it finds references to the older copy. -Generalize and Standardize the RPC interface to a target program, -improve it beyond the "ptrace" interface, and see if it can become a -standard for remote debugging. (This is talking about the vxworks -interface. Seems unlikely to me that there will be "a standard" for -remote debugging anytime soon --kingdon, 8 Nov 1994). +-- + +[elena delete this also] Remove all references to: text_offset @@ -614,42 +1338,26 @@ Remove all references to: ... now that we have BFD. All remaining are in machine dependent files. -When quitting with a running program, if a core file was previously -examined, you get "Couldn't read float regs from core file"...if -indeed it can't. generic_mourn_inferior... - -Have remote targets give a warning on a signal argument to -target_resume. Or better yet, extend the protocols so that it works -like it does on the Unix-like systems. - -Sort help and info output. +-- Re-organize help categories into things that tend to fit on a screen and hang together. -renote-nindy.c handles interrupts poorly; it error()s out of badly -chosen places, e.g. leaving current_frame zero, which causes core dumps -on the next command. +-- Add in commands like ADB's for searching for patterns, etc. We should be able to examine and patch raw unsymboled binaries as well in gdb as we can in adb. (E.g. increase the timeout in /bin/login without source). -Those xdep files that call register_addr without defining it are -probably simply broken. When reconfiguring this part of gdb, I could -only make guesses about how to redo some of those files, and I -probably guessed wrong, or left them "for later" when I have a -machine that can attempt to build them. +[actually, add ADB interface :-] + +-- When doing "step" or "next", if a few lines of source are skipped between the previous line and the current one, print those lines, not just the last line of a multiline statement. -When searching for C++ superclasses in value_cast in valops.c, we must -not search the "fields", only the "superclasses". There might be a -struct with a field name that matches the superclass name. This can -happen when the struct was defined before the superclass (before the -name became a typedef). +-- Handling of "&" address-of operator needs some serious overhaul for ANSI C and consistency on arrays and functions. @@ -661,65 +1369,75 @@ ptype &malloc ==> "char *(*)()" call printf ("%x\n", malloc) ==> weird value, should be same as call printf ("%x\n", &malloc) ==> correct value +-- + Fix dbxread.c symbol reading in the presence of interrupts. It currently leaves a cleanup to blow away the entire symbol table when a QUIT occurs. (What's wrong with that? -kingdon, 28 Oct 1993). +[I suspect that the grype was that, on a slow system, you might want +to cntrl-c and get just half the symbols and then load the rest later +- scary to be honest] + +-- + Mipsread.c reads include files depth-first, because the dependencies in the psymtabs are way too inclusive (it seems to me). Figure out what really depends on what, to avoid recursing 20 or 30 times while reading real symtabs. +-- + value_add() should be subtracting the lower bound of arrays, if known, and possibly checking against the upper bound for error reporting. -mipsread.c symbol table allocation and deallocation should be checked. -My suspicion is that it's full of memory leaks. - -SunOS should have a target_lookup_symbol() for common'd things allocated -by the shared library linker ld.so. +-- When listing source lines, check for a preceding \n, to verify that the file hasn't changed out from under us. -When listing source lines, eat leading whitespace corresponding to the -line-number prefix we print. This avoids long lines wrapping. +[fixed by some other means I think. That hack wouldn't actually work +reliably - the file might move such that another \n appears. ] -mipsread.c needs to check for old symtabs and psymtabs for the same -files, the way it happens for dbxread.c and coffread.c, for VxWorks -incremental symbol table reloading. +-- Get all the remote systems (where the protocol allows it) to be able to stop the remote system when the GDB user types ^C (like remote.c does). For ebmon, use ^Ak. +-- + Possible feature: A version of the "disassemble" command which shows both source and assembly code ("set symbol-filename on" is a partial solution). +[has this been done? It was certainly done for MI and GDBtk] + +-- + investigate "x/s 0" (right now stops early) (I think maybe GDB is using a 0 address for bad purposes internally). +-- + Make "info path" and path_command work again (but independent of the environment either of gdb or that we'll pass to the inferior). +-- + Make GDB understand the GCC feature for putting octal constants in enums. Make it so overflow on an enum constant does not error_type the whole type. Allow arbitrarily large enums with type attributes. Put all this stuff in the testsuite. +-- + Make TYPE_CODE_ERROR with a non-zero TYPE_LENGTH more useful (print the value in hex; process type attributes). Add this to the testsuite. This way future compilers can add new types and old versions of GDB can do something halfway reasonable. -Clean up formatting of "info registers" on MIPS and 88k. See if it -is possible to do this generically across all target architectures. - -GDB gets bfd/corefile.c and gdb/corefile.c confused (this should be easy to -repeat even with something more recent than GDB 4.9). - -Check that unmatched RBRAC doesn't abort(). +-- Fix mdebugread.c:parse_type to do fundamental types right (see rs6000_builtin_type in stabsread.c for what "right" is--the point is @@ -728,49 +1446,42 @@ depend on stuff like TARGET_PTR_BIT and so on. For mdebug, there seem to be separate bt* codes for 64 bit and 32 bit things, and GDB should be aware of that). Also use a switch statement for clarity and speed. +-- + Investigate adding symbols in target_load--some targets do, some don't. +-- + Put dirname in psymtabs and change lookup*symtab to use dirname (so /foo/bar.c works whether compiled by cc /foo/bar.c, or cd /foo; cc bar.c). +-- + Merge xcoffread.c and coffread.c. Use breakpoint_re_set instead of fixup_breakpoints. -Fix byte order and int size sins in tm-a29k.h -(EXTRACT_RETURN_VALUE). Perhaps should reproduce bug and verify fix -(or perhaps should just fix it...). - -Make a watchpoint on a constant expression an error (or warning -perhaps) +-- Make a watchpoint which contains a function call an error (it is broken now, making it work is probably not worth the effort). -Re-do calls to signal() in remote.c, and inflow.c (set_sigint_trap and -so on) to be independent of the debugging target, using target_stop to -stop the inferior. Probably the part which is now handled by -interrupt_query in remote.c can be done without any new features in -the debugging target. +-- New test case based on weird.exp but in which type numbers are not renumbered (thus multiply defining a type). This currently causes an infinite loop on "p v_comb". -Nuke baseclass_addr. - -Nuke USG define. +-- -"source file more recent" loses on re-read +[Hey! Hint Hint Delete Delete!!!] Fix 386 floating point so that floating point registers are real registers (but code can deal at run-time if they are missing, like mips and 68k). This would clean up "info float" and related stuff. -Look at Solaris bug in interrupt.exp. Can get out of syscall with -PRSABORT (syscall will return EINTR) but merely doing that leads to a -"can't read memory" error. +-- gcc -g -c enummask.c then gdb enummask.o, then "p v". GDB complains about not being able to access memory location 0. @@ -794,49 +1505,33 @@ enum mask LARGE = 0x20 } v; +-- + If try to modify value in file with "set write off" should give appropriate error not "cannot access memory at address 0x65e0". -Why do we allow a target to omit standard register names (NO_STD_REGS -in tm-z8k.h)? I thought the standard register names were supposed to -be just that, standard. +-- Allow core file without exec file on RS/6000. +-- + Make sure "shell" with no arguments works right on DOS. +-- + Make gdb.ini (as well as .gdbinit) be checked on all platforms, so the same directory can be NFS-mounted on unix or DOS, and work the same way. -cd ~/tmp/ causes infinite loop (where ~/tmp is a directory). +-- + +[Is this another delete???] Get SECT_OFF_TEXT stuff out of objfile_relocate (might be needed to get RS/6000 to work right, might not be immediately relevant). -Clean up add_toc_to_loadinfo - -Think about attached processes and sharing terminal. - -John sez in reference to ignoring errors from tcsegpgrp if attach_flag: -set_tty_state should not have any trouble with attached processes. -Instead, the tty handling should leave the pgrp of the tty alone when -attaching to processes (perhaps pass terminal_init_inferior a flag -saying whether we're attaching). - -PAGE_SIZE redefined warnings on AIX. Probably should be using -BFD_PAGE_SIZE throughout BFD. - -Rewrite proceed, wait_for_inferior, and normal_stop to clean them up. -Suggestions: - - 1) Make each test in wait_for_inferior a seperate subroutine - call. - 2) Combine wait_for_inferior and normal_stop to clean up - communication via global variables. - 3) See if you can find some way to clean up the global - variables that are used; possibly group them by data flow - and information content? +-- Work out some kind of way to allow running the inferior to be done as a sub-execution of, eg. breakpoint command lists. Currently running @@ -844,26 +1539,17 @@ the inferior interupts any command list execution. This would require some rewriting of wait_for_inferior & friends, and hence should probably be done in concert with the above. +-- + Add function arguments to gdb user defined functions. +-- + Add convenience variables that refer to exec file, symbol file, selected frame source file, selected frame function, selected frame line number, etc. -Add a "suspend" subcommand of the "continue" command to suspend gdb -while continuing execution of the subprocess. Useful when you are -debugging servers and you want to dodge out and initiate a connection -to a server running under gdb. - -Add stab information to allow reasonable debugging of inline functions -(possibly they should show up on a stack backtrace? With a note -indicating that they weren't "real"?). - -Modify the naked "until" command to step until past the current source -line, rather than past the current pc value. This is tricky simply -because the low level routines have no way of specifying a multi-line -step range, and there is no way of saying "don't print stuff when we -stop" from above (otherwise could just call step many times). +-- Modify the handling of symbols grouped through BINCL/EINCL stabs to allocate a partial symtab for each BINCL/EINCL grouping. This will @@ -871,17 +1557,14 @@ seriously decrease the size of inter-psymtab dependencies and hence lessen the amount that needs to be read in when a new source file is accessed. -Do an "x/i $pc" after each stepi or nexti. - -Modify all of the disassemblers to use printf_filtered to get correct -more filtering. - -Modify gdb to work correctly with Pascal. +-- Add a command for searching memory, a la adb. It specifies size, mask, value, start address. ADB searches until it finds it or hits an error (or is interrupted). +-- + Remove the range and type checking code and documentation, if not going to implement. diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c index e1bd628a8d6..0ade234a179 100644 --- a/gdb/abug-rom.c +++ b/gdb/abug-rom.c @@ -28,7 +28,7 @@ /* Prototypes for local functions. */ -static void abug_open PARAMS ((char *args, int from_tty)); +static void abug_open (char *args, int from_tty); static void abug_supply_register (regname, regnamelen, val, vallen) diff --git a/gdb/acconfig.h b/gdb/acconfig.h index 27b4d21cf19..74c3b6fdade 100644 --- a/gdb/acconfig.h +++ b/gdb/acconfig.h @@ -1,6 +1,12 @@ /* Define if compiling on Solaris 7. */ #undef _MSE_INT_H +/* Define if your struct reg has r_fs. */ +#undef HAVE_STRUCT_REG_R_FS + +/* Define if your struct reg has r_gs. */ +#undef HAVE_STRUCT_REG_R_GS + /* Define if pstatus_t type is available */ #undef HAVE_PSTATUS_T @@ -13,6 +19,21 @@ /* Define if gregset_t type is available. */ #undef HAVE_GREGSET_T +/* Define if has prgregset_t. */ +#undef HAVE_PRGREGSET_T + +/* Define if has prfpregset_t. */ +#undef HAVE_PRFPREGSET_T + +/* Define if has lwpid_t. */ +#undef HAVE_LWPID_T + +/* Define if has psaddr_t. */ +#undef HAVE_PSADDR_T + +/* Define if the prfpregset_t type is broken. */ +#undef PRFPREGSET_T_BROKEN + /* Define if you want to use new multi-fd /proc interface (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */ #undef NEW_PROC_API @@ -91,3 +112,6 @@ /* Define if defines the PTRACE_GETXFPREGS request. */ #undef HAVE_PTRACE_GETXFPREGS + +/* Define if gnu-regex.c included with GDB should be used. */ +#undef USE_INCLUDED_REGEX diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index 1a1183223c1..de9e2d5e5a0 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -872,6 +872,39 @@ dnl AC_SUBST(TIX_BUILD_INCLUDES) dnl AC_SUBST(TIX_LIB_SPEC) ]) +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + # serial 1 diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index 089e56fea10..4bf33b352a2 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -33,10 +33,8 @@ /* Prototypes for local functions. */ -static void fetch_osf_core_registers PARAMS ((char *, - unsigned, int, CORE_ADDR)); -static void fetch_elf_core_registers PARAMS ((char *, - unsigned, int, CORE_ADDR)); +static void fetch_osf_core_registers (char *, unsigned, int, CORE_ADDR); +static void fetch_elf_core_registers (char *, unsigned, int, CORE_ADDR); /* Size of elements in jmpbuf */ @@ -199,6 +197,9 @@ kernel_u_size () #if defined(USE_PROC_FS) || defined(HAVE_GREGSET_T) #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* * See the comment in m68k-tdep.c regarding the utility of these functions. */ diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index e4962d050b2..465efaca60f 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -34,35 +34,34 @@ /* Prototypes for local functions. */ -static alpha_extra_func_info_t push_sigtramp_desc PARAMS ((CORE_ADDR low_addr)); +static alpha_extra_func_info_t push_sigtramp_desc (CORE_ADDR low_addr); -static CORE_ADDR read_next_frame_reg PARAMS ((struct frame_info *, int)); +static CORE_ADDR read_next_frame_reg (struct frame_info *, int); -static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR)); +static CORE_ADDR heuristic_proc_start (CORE_ADDR); -static alpha_extra_func_info_t heuristic_proc_desc PARAMS ((CORE_ADDR, - CORE_ADDR, - struct frame_info *)); +static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR, + CORE_ADDR, + struct frame_info *); -static alpha_extra_func_info_t find_proc_desc PARAMS ((CORE_ADDR, - struct frame_info *)); +static alpha_extra_func_info_t find_proc_desc (CORE_ADDR, + struct frame_info *); #if 0 -static int alpha_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR)); +static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR); #endif -static void reinit_frame_cache_sfunc PARAMS ((char *, int, - struct cmd_list_element *)); +static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); -static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc, - alpha_extra_func_info_t proc_desc)); +static CORE_ADDR after_prologue (CORE_ADDR pc, + alpha_extra_func_info_t proc_desc); -static int alpha_in_prologue PARAMS ((CORE_ADDR pc, - alpha_extra_func_info_t proc_desc)); +static int alpha_in_prologue (CORE_ADDR pc, + alpha_extra_func_info_t proc_desc); -static int alpha_about_to_return PARAMS ((CORE_ADDR pc)); +static int alpha_about_to_return (CORE_ADDR pc); -void _initialize_alpha_tdep PARAMS ((void)); +void _initialize_alpha_tdep (void); /* Heuristic_proc_start may hunt through the text section for a long time across a 2400 baud serial line. Allows the user to limit this @@ -169,7 +168,7 @@ struct linked_proc_info #ifndef TM_LINUXALPHA_H /* HACK: Provide a prototype when compiling this file for non linuxalpha targets. */ -long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR pc)); +long alpha_linux_sigtramp_offset (CORE_ADDR pc); #endif long alpha_linux_sigtramp_offset (pc) diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c new file mode 100644 index 00000000000..40937a81943 --- /dev/null +++ b/gdb/alphabsd-nat.c @@ -0,0 +1,187 @@ +/* Native-dependent code for Alpha BSD's. + Copyright (C) 2000 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 "inferior.h" + +#include +#include +#include + +#ifdef HAVE_SYS_PROCFS_H +#include +#endif + +#ifndef HAVE_GREGSET_T +typedef struct reg gregset_t; +#endif + +#ifndef HAVE_FPREGSET_T +typedef struct fpreg fpregset_t; +#endif + +#include "gregset.h" + +/* Number of general-purpose registers. */ +#define NUM_GREGS 32 + +/* Number of floating point registers. */ +#define NUM_FPREGS 31 + + +/* Transfering the registers between GDB, inferiors and core files. */ + +/* Fill GDB's register array with the genereal-purpose register values + in *GREGSETP. */ + +void +supply_gregset (gregset_t *gregsetp) +{ + int i; + + for (i = 0; i < NUM_GREGS; i++) + { + if (CANNOT_FETCH_REGISTER (i)) + supply_register (i, NULL); + else + supply_register (i, (char *) &gregsetp->r_regs[i]); + } + + /* The PC travels in the R_ZERO slot. */ + supply_register (PC_REGNUM, (char *) &gregsetp->r_regs[R_ZERO]); +} + +/* Fill register REGNO (if it is a general-purpose register) in + *GREGSETPS with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_gregset (gregset_t *gregsetp, int regno) +{ + int i; + + for (i = 0; i < NUM_GREGS; i++) + if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i)) + memcpy (&gregsetp->r_regs[i], ®isters[REGISTER_BYTE (i)], + REGISTER_RAW_SIZE (i)); + + /* The PC travels in the R_ZERO slot. */ + if (regno == -1 || regno == PC_REGNUM) + memcpy (&gregsetp->r_regs[R_ZERO], ®isters[REGISTER_BYTE (PC_REGNUM)], + REGISTER_RAW_SIZE (PC_REGNUM)); +} + +/* Fill GDB's register array with the floating-point register values + in *FPREGSETP. */ + +void +supply_fpregset (fpregset_t *fpregsetp) +{ + int i; + + for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++) + { + if (CANNOT_FETCH_REGISTER (i)) + supply_register (i, NULL); + else + supply_register (i, (char *) &fpregsetp->fpr_regs[i - FP0_REGNUM]); + } + + supply_register (FPCR_REGNUM, (char *) &fpregsetp->fpr_cr); +} + +/* Fill register REGNO (if it is a floating-point register) in + *FPREGSETP with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_fpregset (fpregset_t *fpregsetp, int regno) +{ + int i; + + for (i = FP0_REGNUM; i < FP0_REGNUM + NUM_FPREGS; i++) + if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i)) + memcpy (&fpregsetp->fpr_regs[i - FP0_REGNUM], + ®isters[REGISTER_BYTE (i)], REGISTER_RAW_SIZE (i)); + + if (regno == -1 || regno == FPCR_REGNUM) + memcpy (&fpregsetp->fpr_cr, ®isters[REGISTER_BYTE (FPCR_REGNUM)], + REGISTER_RAW_SIZE (FPCR_REGNUM)); +} + +/* Fetch register REGNO from the inferior. If REGNO is -1, do this + for all registers (including the floating point registers). */ + +void +fetch_inferior_registers (int regno) +{ + gregset_t gregs; + + if (ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't get registers"); + + supply_gregset (&gregs); + + if (regno == -1 || regno >= FP0_REGNUM) + { + fpregset_t fpregs; + + if (ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + supply_fpregset (&fpregs); + } + + /* Reset virtual frame pointer. */ + supply_register (FP_REGNUM, NULL); +} + +/* Store register REGNO back into the inferior. If REGNO is -1, do + this for all registers (including the floating point registers). */ + +void +store_inferior_registers (int regno) +{ + gregset_t gregs; + + if (ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't get registers"); + + fill_gregset (&gregs, regno); + + if (ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't write registers"); + + if (regno == -1 || regno >= FP0_REGNUM) + { + fpregset_t fpregs; + + if (ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + fill_fpregset (&fpregs, regno); + + if (ptrace (PT_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't write floating point status"); + } +} diff --git a/gdb/annotate.c b/gdb/annotate.c index 4508ad8cf06..ee26290a95e 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -28,17 +28,17 @@ /* Prototypes for local functions. */ -extern void _initialize_annotate PARAMS ((void)); +extern void _initialize_annotate (void); -static void print_value_flags PARAMS ((struct type *)); +static void print_value_flags (struct type *); -static void breakpoint_changed PARAMS ((struct breakpoint *)); +static void breakpoint_changed (struct breakpoint *); -void (*annotate_starting_hook) PARAMS ((void)); -void (*annotate_stopped_hook) PARAMS ((void)); -void (*annotate_signalled_hook) PARAMS ((void)); -void (*annotate_signal_hook) PARAMS ((void)); -void (*annotate_exited_hook) PARAMS ((void)); +void (*annotate_starting_hook) (void); +void (*annotate_stopped_hook) (void); +void (*annotate_signalled_hook) (void); +void (*annotate_signal_hook) (void); +void (*annotate_exited_hook) (void); static int ignore_count_changed = 0; diff --git a/gdb/annotate.h b/gdb/annotate.h index 0521896f23d..3e4711235bc 100644 --- a/gdb/annotate.h +++ b/gdb/annotate.h @@ -21,85 +21,85 @@ #include "symtab.h" #include "gdbtypes.h" -extern void breakpoints_changed PARAMS ((void)); +extern void breakpoints_changed (void); extern void annotate_ignore_count_change (void); -extern void annotate_breakpoint PARAMS ((int)); -extern void annotate_catchpoint PARAMS ((int)); -extern void annotate_watchpoint PARAMS ((int)); -extern void annotate_starting PARAMS ((void)); -extern void annotate_stopped PARAMS ((void)); -extern void annotate_exited PARAMS ((int)); -extern void annotate_signalled PARAMS ((void)); -extern void annotate_signal_name PARAMS ((void)); -extern void annotate_signal_name_end PARAMS ((void)); -extern void annotate_signal_string PARAMS ((void)); -extern void annotate_signal_string_end PARAMS ((void)); -extern void annotate_signal PARAMS ((void)); - -extern void annotate_breakpoints_headers PARAMS ((void)); -extern void annotate_field PARAMS ((int)); -extern void annotate_breakpoints_table PARAMS ((void)); -extern void annotate_record PARAMS ((void)); -extern void annotate_breakpoints_table_end PARAMS ((void)); - -extern void annotate_frames_invalid PARAMS ((void)); +extern void annotate_breakpoint (int); +extern void annotate_catchpoint (int); +extern void annotate_watchpoint (int); +extern void annotate_starting (void); +extern void annotate_stopped (void); +extern void annotate_exited (int); +extern void annotate_signalled (void); +extern void annotate_signal_name (void); +extern void annotate_signal_name_end (void); +extern void annotate_signal_string (void); +extern void annotate_signal_string_end (void); +extern void annotate_signal (void); + +extern void annotate_breakpoints_headers (void); +extern void annotate_field (int); +extern void annotate_breakpoints_table (void); +extern void annotate_record (void); +extern void annotate_breakpoints_table_end (void); + +extern void annotate_frames_invalid (void); struct type; -extern void annotate_field_begin PARAMS ((struct type *)); -extern void annotate_field_name_end PARAMS ((void)); -extern void annotate_field_value PARAMS ((void)); -extern void annotate_field_end PARAMS ((void)); - -extern void annotate_quit PARAMS ((void)); -extern void annotate_error PARAMS ((void)); -extern void annotate_error_begin PARAMS ((void)); - -extern void annotate_value_history_begin PARAMS ((int, struct type *)); -extern void annotate_value_begin PARAMS ((struct type *)); -extern void annotate_value_history_value PARAMS ((void)); -extern void annotate_value_history_end PARAMS ((void)); -extern void annotate_value_end PARAMS ((void)); - -extern void annotate_display_begin PARAMS ((void)); -extern void annotate_display_number_end PARAMS ((void)); -extern void annotate_display_format PARAMS ((void)); -extern void annotate_display_expression PARAMS ((void)); -extern void annotate_display_expression_end PARAMS ((void)); -extern void annotate_display_value PARAMS ((void)); -extern void annotate_display_end PARAMS ((void)); - -extern void annotate_arg_begin PARAMS ((void)); -extern void annotate_arg_name_end PARAMS ((void)); -extern void annotate_arg_value PARAMS ((struct type *)); -extern void annotate_arg_end PARAMS ((void)); - -extern void annotate_source PARAMS ((char *, int, int, int, CORE_ADDR)); - -extern void annotate_frame_begin PARAMS ((int, CORE_ADDR)); -extern void annotate_function_call PARAMS ((void)); -extern void annotate_signal_handler_caller PARAMS ((void)); -extern void annotate_frame_address PARAMS ((void)); -extern void annotate_frame_address_end PARAMS ((void)); -extern void annotate_frame_function_name PARAMS ((void)); -extern void annotate_frame_args PARAMS ((void)); -extern void annotate_frame_source_begin PARAMS ((void)); -extern void annotate_frame_source_file PARAMS ((void)); -extern void annotate_frame_source_file_end PARAMS ((void)); -extern void annotate_frame_source_line PARAMS ((void)); -extern void annotate_frame_source_end PARAMS ((void)); -extern void annotate_frame_where PARAMS ((void)); -extern void annotate_frame_end PARAMS ((void)); - -extern void annotate_array_section_begin PARAMS ((int, struct type *)); -extern void annotate_elt_rep PARAMS ((unsigned int)); -extern void annotate_elt_rep_end PARAMS ((void)); -extern void annotate_elt PARAMS ((void)); -extern void annotate_array_section_end PARAMS ((void)); - -extern void (*annotate_starting_hook) PARAMS ((void)); -extern void (*annotate_stopped_hook) PARAMS ((void)); -extern void (*annotate_signalled_hook) PARAMS ((void)); -extern void (*annotate_signal_hook) PARAMS ((void)); -extern void (*annotate_exited_hook) PARAMS ((void)); +extern void annotate_field_begin (struct type *); +extern void annotate_field_name_end (void); +extern void annotate_field_value (void); +extern void annotate_field_end (void); + +extern void annotate_quit (void); +extern void annotate_error (void); +extern void annotate_error_begin (void); + +extern void annotate_value_history_begin (int, struct type *); +extern void annotate_value_begin (struct type *); +extern void annotate_value_history_value (void); +extern void annotate_value_history_end (void); +extern void annotate_value_end (void); + +extern void annotate_display_begin (void); +extern void annotate_display_number_end (void); +extern void annotate_display_format (void); +extern void annotate_display_expression (void); +extern void annotate_display_expression_end (void); +extern void annotate_display_value (void); +extern void annotate_display_end (void); + +extern void annotate_arg_begin (void); +extern void annotate_arg_name_end (void); +extern void annotate_arg_value (struct type *); +extern void annotate_arg_end (void); + +extern void annotate_source (char *, int, int, int, CORE_ADDR); + +extern void annotate_frame_begin (int, CORE_ADDR); +extern void annotate_function_call (void); +extern void annotate_signal_handler_caller (void); +extern void annotate_frame_address (void); +extern void annotate_frame_address_end (void); +extern void annotate_frame_function_name (void); +extern void annotate_frame_args (void); +extern void annotate_frame_source_begin (void); +extern void annotate_frame_source_file (void); +extern void annotate_frame_source_file_end (void); +extern void annotate_frame_source_line (void); +extern void annotate_frame_source_end (void); +extern void annotate_frame_where (void); +extern void annotate_frame_end (void); + +extern void annotate_array_section_begin (int, struct type *); +extern void annotate_elt_rep (unsigned int); +extern void annotate_elt_rep_end (void); +extern void annotate_elt (void); +extern void annotate_array_section_end (void); + +extern void (*annotate_starting_hook) (void); +extern void (*annotate_stopped_hook) (void); +extern void (*annotate_signalled_hook) (void); +extern void (*annotate_signal_hook) (void); +extern void (*annotate_exited_hook) (void); diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 2a1f0006702..8b69770edbe 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -90,9 +90,9 @@ int debug_pipeline_p; | ((d) & 511)) /* Codestream stuff. */ -static void codestream_read PARAMS ((unsigned int *, int)); -static void codestream_seek PARAMS ((CORE_ADDR)); -static unsigned int codestream_fill PARAMS ((int)); +static void codestream_read (unsigned int *, int); +static void codestream_seek (CORE_ADDR); +static unsigned int codestream_fill (int); #define CODESTREAM_BUFSIZ 16 static CORE_ADDR codestream_next_addr; diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 9048bd75419..be2433d37e6 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -41,6 +41,8 @@ #include "symfile.h" /* for overlay functions */ #endif +#include "floatformat.h" + /* Convenience macro for allocting typesafe memory. */ #ifndef XMALLOC @@ -97,6 +99,12 @@ generic_frameless_function_invocation_not (struct frame_info *fi) return 0; } +int +generic_return_value_on_stack_not (struct type *type) +{ + return 0; +} + char * legacy_register_name (int i) { @@ -127,6 +135,77 @@ generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len, *rem_len = gdb_len; } +int +generic_prologue_frameless_p (CORE_ADDR ip) +{ +#ifdef SKIP_PROLOGUE_FRAMELESS_P + return ip == SKIP_PROLOGUE_FRAMELESS_P (ip); +#else + return ip == SKIP_PROLOGUE (ip); +#endif +} + + +/* Helper functions for INNER_THAN */ + +int +core_addr_lessthan (lhs, rhs) + CORE_ADDR lhs; + CORE_ADDR rhs; +{ + return (lhs < rhs); +} + +int +core_addr_greaterthan (lhs, rhs) + CORE_ADDR lhs; + CORE_ADDR rhs; +{ + return (lhs > rhs); +} + + +/* Helper functions for TARGET_{FLOAT,DOUBLE}_FORMAT */ + +const struct floatformat * +default_float_format (struct gdbarch *gdbarch) +{ +#if GDB_MULTI_ARCH + int byte_order = gdbarch_byte_order (gdbarch); +#else + int byte_order = TARGET_BYTE_ORDER; +#endif + switch (byte_order) + { + case BIG_ENDIAN: + return &floatformat_ieee_single_big; + case LITTLE_ENDIAN: + return &floatformat_ieee_single_little; + default: + internal_error ("default_float_format: bad byte order"); + } +} + + +const struct floatformat * +default_double_format (struct gdbarch *gdbarch) +{ +#if GDB_MULTI_ARCH + int byte_order = gdbarch_byte_order (gdbarch); +#else + int byte_order = TARGET_BYTE_ORDER; +#endif + switch (byte_order) + { + case BIG_ENDIAN: + return &floatformat_ieee_double_big; + case LITTLE_ENDIAN: + return &floatformat_ieee_double_little; + default: + internal_error ("default_double_format: bad byte order"); + } +} + /* */ extern initialize_file_ftype __initialize_gdbarch_utils; diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 57da8ceb45f..a9ff6f52ad9 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -39,6 +39,11 @@ extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc; /* Frameless functions not identifable. */ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not; +/* Only structures, unions, and arrays are returned using the struct + convention. Note that arrays are never passed by value in the C + language family, so that case is irrelevant for C. */ +extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not; + /* Map onto old REGISTER_NAMES. */ extern char *legacy_register_name (int i); @@ -49,4 +54,17 @@ extern int legacy_sizeof_call_dummy_words; /* Typical remote_translate_xfer_address */ extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address; +/* Generic implementation of prologue_frameless_p. Just calls + SKIP_PROLOG and checks the return value to see if it actually + changed. */ +extern gdbarch_prologue_frameless_p_ftype generic_prologue_frameless_p; + +/* The only possible cases for inner_than. */ +extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs); +extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs); + +/* Floating point values. */ +extern const struct floatformat *default_float_format (struct gdbarch *gdbarch); +extern const struct floatformat *default_double_format (struct gdbarch *gdbarch); + #endif diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index b8d30e590af..7c8e04b1885 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -26,6 +26,10 @@ #include #include #include +#include + +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" extern int arm_apcs_32; @@ -71,6 +75,27 @@ FPA11; static unsigned int os_version, os_major, os_minor, os_release; +/* On Linux, threads are implemented as pseudo-processes, in which + case we may be tracing more than one process at a time. In that + case, inferior_pid will contain the main process ID and the + individual thread (process) ID mashed together. These macros are + used to separate them out. These definitions should be overridden + if thread support is included. */ + +#if !defined (PIDGET) /* Default definition for PIDGET/TIDGET. */ +#define PIDGET(PID) PID +#define TIDGET(PID) 0 +#endif + +int +get_thread_id (int inferior_pid) +{ + int tid = TIDGET (inferior_pid); + if (0 == tid) tid = inferior_pid; + return tid; +} +#define GET_THREAD_ID(PID) get_thread_id ((PID)); + static void fetch_nwfpe_single (unsigned int fn, FPA11 * fpa11) { @@ -113,6 +138,30 @@ fetch_nwfpe_extended (unsigned int fn, FPA11 * fpa11) supply_register (F0_REGNUM + fn, (char *) &mem[0]); } +static void +fetch_nwfpe_register (int regno, FPA11 * fpa11) +{ + int fn = regno - F0_REGNUM; + + switch (fpa11->fType[fn]) + { + case typeSingle: + fetch_nwfpe_single (fn, fpa11); + break; + + case typeDouble: + fetch_nwfpe_double (fn, fpa11); + break; + + case typeExtended: + fetch_nwfpe_extended (fn, fpa11); + break; + + default: + fetch_nwfpe_none (fn); + } +} + static void store_nwfpe_single (unsigned int fn, FPA11 * fpa11) { @@ -146,20 +195,96 @@ store_nwfpe_extended (unsigned int fn, FPA11 * fpa11) fpa11->fType[fn] = typeDouble; } -/* Get the whole floating point state of the process and store the - floating point stack into registers[]. */ +void +store_nwfpe_register (int regno, FPA11 * fpa11) +{ + if (register_valid[regno]) + { + unsigned int fn = regno - F0_REGNUM; + switch (fpa11->fType[fn]) + { + case typeSingle: + store_nwfpe_single (fn, fpa11); + break; + + case typeDouble: + store_nwfpe_double (fn, fpa11); + break; + + case typeExtended: + store_nwfpe_extended (fn, fpa11); + break; + } + } +} + + +/* Get the value of a particular register from the floating point + state of the process and store it into registers[]. */ + +static void +fetch_fpregister (int regno) +{ + int ret, tid; + FPA11 fp; + + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + /* Read the floating point state. */ + ret = ptrace (PT_GETFPREGS, tid, 0, &fp); + if (ret < 0) + { + warning ("Unable to fetch floating point register."); + return; + } + + /* Fetch fpsr. */ + if (FPS_REGNUM == regno) + supply_register (FPS_REGNUM, (char *) &fp.fpsr); + + /* Fetch the floating point register. */ + if (regno >= F0_REGNUM && regno <= F7_REGNUM) + { + int fn = regno - F0_REGNUM; + + switch (fp.fType[fn]) + { + case typeSingle: + fetch_nwfpe_single (fn, &fp); + break; + + case typeDouble: + fetch_nwfpe_double (fn, &fp); + break; + + case typeExtended: + fetch_nwfpe_extended (fn, &fp); + break; + + default: + fetch_nwfpe_none (fn); + } + } +} + +/* Get the whole floating point state of the process and store it + into registers[]. */ static void fetch_fpregs (void) { - int ret, regno; + int ret, regno, tid; FPA11 fp; + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + /* Read the floating point state. */ - ret = ptrace (PT_GETFPREGS, inferior_pid, 0, &fp); + ret = ptrace (PT_GETFPREGS, tid, 0, &fp); if (ret < 0) { - warning ("Unable to fetch the floating point state."); + warning ("Unable to fetch the floating point registers."); return; } @@ -191,15 +316,64 @@ fetch_fpregs (void) } } +/* Save a particular register into the floating point state of the + process using the contents from registers[]. */ + +static void +store_fpregister (int regno) +{ + int ret, tid; + FPA11 fp; + + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + /* Read the floating point state. */ + ret = ptrace (PT_GETFPREGS, tid, 0, &fp); + if (ret < 0) + { + warning ("Unable to fetch the floating point registers."); + return; + } + + /* Store fpsr. */ + if (FPS_REGNUM == regno && register_valid[FPS_REGNUM]) + read_register_gen (FPS_REGNUM, (char *) &fp.fpsr); + + /* Store the floating point register. */ + if (regno >= F0_REGNUM && regno <= F7_REGNUM) + { + store_nwfpe_register (regno, &fp); + } + + ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp); + if (ret < 0) + { + warning ("Unable to store floating point register."); + return; + } +} + /* Save the whole floating point state of the process using the contents from registers[]. */ static void store_fpregs (void) { - int ret, regno; + int ret, regno, tid; FPA11 fp; + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + /* Read the floating point state. */ + ret = ptrace (PT_GETFPREGS, tid, 0, &fp); + if (ret < 0) + { + warning ("Unable to fetch the floating point registers."); + return; + } + /* Store fpsr. */ if (register_valid[FPS_REGNUM]) read_register_gen (FPS_REGNUM, (char *) &fp.fpsr); @@ -207,32 +381,52 @@ store_fpregs (void) /* Store the floating point registers. */ for (regno = F0_REGNUM; regno <= F7_REGNUM; regno++) { - if (register_valid[regno]) - { - unsigned int fn = regno - F0_REGNUM; - switch (fp.fType[fn]) - { - case typeSingle: - store_nwfpe_single (fn, &fp); - break; - - case typeDouble: - store_nwfpe_double (fn, &fp); - break; - - case typeExtended: - store_nwfpe_extended (fn, &fp); - break; - } - } + fetch_nwfpe_register (regno, &fp); + } + + ret = ptrace (PTRACE_SETFPREGS, tid, 0, &fp); + if (ret < 0) + { + warning ("Unable to store floating point registers."); + return; } +} + +/* Fetch a general register of the process and store into + registers[]. */ + +static void +fetch_register (int regno) +{ + int ret, tid; + struct pt_regs regs; - ret = ptrace (PTRACE_SETFPREGS, inferior_pid, 0, &fp); + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + ret = ptrace (PTRACE_GETREGS, tid, 0, ®s); if (ret < 0) { - warning ("Unable to store floating point state."); + warning ("Unable to fetch general register."); return; } + + if (regno >= A1_REGNUM && regno < PC_REGNUM) + supply_register (regno, (char *) ®s.uregs[regno]); + + if (PS_REGNUM == regno) + { + if (arm_apcs_32) + supply_register (PS_REGNUM, (char *) ®s.uregs[CPSR_REGNUM]); + else + supply_register (PS_REGNUM, (char *) ®s.uregs[PC_REGNUM]); + } + + if (PC_REGNUM == regno) + { + regs.uregs[PC_REGNUM] = ADDR_BITS_REMOVE (regs.uregs[PC_REGNUM]); + supply_register (PC_REGNUM, (char *) ®s.uregs[PC_REGNUM]); + } } /* Fetch all general registers of the process and store into @@ -241,10 +435,13 @@ store_fpregs (void) static void fetch_regs (void) { - int ret, regno; + int ret, regno, tid; struct pt_regs regs; - ret = ptrace (PTRACE_GETREGS, inferior_pid, 0, ®s); + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + ret = ptrace (PTRACE_GETREGS, tid, 0, ®s); if (ret < 0) { warning ("Unable to fetch general registers."); @@ -266,13 +463,48 @@ fetch_regs (void) /* Store all general registers of the process from the values in registers[]. */ +static void +store_register (int regno) +{ + int ret, tid; + struct pt_regs regs; + + if (!register_valid[regno]) + return; + + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + /* Get the general registers from the process. */ + ret = ptrace (PTRACE_GETREGS, tid, 0, ®s); + if (ret < 0) + { + warning ("Unable to fetch general registers."); + return; + } + + if (regno >= A1_REGNUM && regno <= PC_REGNUM) + read_register_gen (regno, (char *) ®s.uregs[regno]); + + ret = ptrace (PTRACE_SETREGS, tid, 0, ®s); + if (ret < 0) + { + warning ("Unable to store general register."); + return; + } +} + static void store_regs (void) { - int ret, regno; + int ret, regno, tid; struct pt_regs regs; - ret = ptrace (PTRACE_GETREGS, inferior_pid, 0, ®s); + /* Get the thread id for the ptrace call. */ + tid = GET_THREAD_ID (inferior_pid); + + /* Fetch the general registers. */ + ret = ptrace (PTRACE_GETREGS, tid, 0, ®s); if (ret < 0) { warning ("Unable to fetch general registers."); @@ -285,7 +517,7 @@ store_regs (void) read_register_gen (regno, (char *) ®s.uregs[regno]); } - ret = ptrace (PTRACE_SETREGS, inferior_pid, 0, ®s); + ret = ptrace (PTRACE_SETREGS, tid, 0, ®s); if (ret < 0) { @@ -301,11 +533,19 @@ store_regs (void) void fetch_inferior_registers (int regno) { - if ((regno < F0_REGNUM) || (regno > FPS_REGNUM)) - fetch_regs (); + if (-1 == regno) + { + fetch_regs (); + fetch_fpregs (); + } + else + { + if (regno < F0_REGNUM || regno > FPS_REGNUM) + fetch_register (regno); - if (((regno >= F0_REGNUM) && (regno <= FPS_REGNUM)) || (regno == -1)) - fetch_fpregs (); + if (regno >= F0_REGNUM && regno <= FPS_REGNUM) + fetch_fpregister (regno); + } } /* Store registers back into the inferior. Store all registers if @@ -315,143 +555,118 @@ fetch_inferior_registers (int regno) void store_inferior_registers (int regno) { - if ((regno < F0_REGNUM) || (regno > FPS_REGNUM)) - store_regs (); + if (-1 == regno) + { + store_regs (); + store_fpregs (); + } + else + { + if ((regno < F0_REGNUM) || (regno > FPS_REGNUM)) + store_register (regno); - if (((regno >= F0_REGNUM) && (regno <= FPS_REGNUM)) || (regno == -1)) - store_fpregs (); + if ((regno >= F0_REGNUM) && (regno <= FPS_REGNUM)) + store_fpregister (regno); + } } -/* - Dynamic Linking on ARM Linux - ---------------------------- - - Note: PLT = procedure linkage table - GOT = global offset table - - As much as possible, ELF dynamic linking defers the resolution of - jump/call addresses until the last minute. The technique used is - inspired by the i386 ELF design, and is based on the following - constraints. - - 1) The calling technique should not force a change in the assembly - code produced for apps; it MAY cause changes in the way assembly - code is produced for position independent code (i.e. shared - libraries). - - 2) The technique must be such that all executable areas must not be - modified; and any modified areas must not be executed. - - To do this, there are three steps involved in a typical jump: - - 1) in the code - 2) through the PLT - 3) using a pointer from the GOT - - When the executable or library is first loaded, each GOT entry is - initialized to point to the code which implements dynamic name - resolution and code finding. This is normally a function in the - program interpreter (on ARM Linux this is usually ld-linux.so.2, - but it does not have to be). On the first invocation, the function - is located and the GOT entry is replaced with the real function - address. Subsequent calls go through steps 1, 2 and 3 and end up - calling the real code. +/* Fill register regno (if it is a general-purpose register) in + *gregsetp with the appropriate value from GDB's register array. + If regno is -1, do this for all registers. */ - 1) In the code: - - b function_call - bl function_call - - This is typical ARM code using the 26 bit relative branch or branch - and link instructions. The target of the instruction - (function_call is usually the address of the function to be called. - In position independent code, the target of the instruction is - actually an entry in the PLT when calling functions in a shared - library. Note that this call is identical to a normal function - call, only the target differs. - - 2) In the PLT: - - The PLT is a synthetic area, created by the linker. It exists in - both executables and libraries. It is an array of stubs, one per - imported function call. It looks like this: - - PLT[0]: - str lr, [sp, #-4]! @push the return address (lr) - ldr lr, [pc, #16] @load from 6 words ahead - add lr, pc, lr @form an address for GOT[0] - ldr pc, [lr, #8]! @jump to the contents of that addr - - The return address (lr) is pushed on the stack and used for - calculations. The load on the second line loads the lr with - &GOT[3] - . - 20. The addition on the third leaves: - - lr = (&GOT[3] - . - 20) + (. + 8) - lr = (&GOT[3] - 12) - lr = &GOT[0] - - On the fourth line, the pc and lr are both updated, so that: +void +fill_gregset (gregset_t *gregsetp, int regno) +{ + if (-1 == regno) + { + int regnum; + for (regnum = A1_REGNUM; regnum <= PC_REGNUM; regnum++) + if (register_valid[regnum]) + read_register_gen (regnum, (char *) &(*gregsetp)[regnum]); + } + else if (regno >= A1_REGNUM && regno <= PC_REGNUM) + { + if (register_valid[regno]) + read_register_gen (regno, (char *) &(*gregsetp)[regno]); + } - pc = GOT[2] - lr = &GOT[0] + 8 - = &GOT[2] + if (PS_REGNUM == regno || -1 == regno) + { + if (register_valid[regno] || -1 == regno) + { + if (arm_apcs_32) + read_register_gen (PS_REGNUM, (char *) &(*gregsetp)[CPSR_REGNUM]); + else + read_register_gen (PC_REGNUM, (char *) &(*gregsetp)[PC_REGNUM]); + } + } + +} - NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little - "tight", but allows us to keep all the PLT entries the same size. +/* Fill GDB's register array with the general-purpose register values + in *gregsetp. */ - PLT[n+1]: - ldr ip, [pc, #4] @load offset from gotoff - add ip, pc, ip @add the offset to the pc - ldr pc, [ip] @jump to that address - gotoff: .word GOT[n+3] - . +void +supply_gregset (gregset_t *gregsetp) +{ + int regno, reg_pc; - The load on the first line, gets an offset from the fourth word of - the PLT entry. The add on the second line makes ip = &GOT[n+3], - which contains either a pointer to PLT[0] (the fixup trampoline) or - a pointer to the actual code. + for (regno = A1_REGNUM; regno < PC_REGNUM; regno++) + supply_register (regno, (char *) &(*gregsetp)[regno]); - 3) In the GOT: + if (arm_apcs_32) + supply_register (PS_REGNUM, (char *) &(*gregsetp)[CPSR_REGNUM]); + else + supply_register (PS_REGNUM, (char *) &(*gregsetp)[PC_REGNUM]); - The GOT contains helper pointers for both code (PLT) fixups and - data fixups. The first 3 entries of the GOT are special. The next - M entries (where M is the number of entries in the PLT) belong to - the PLT fixups. The next D (all remaining) entries belong to - various data fixups. The actual size of the GOT is 3 + M + D. + reg_pc = ADDR_BITS_REMOVE ((CORE_ADDR)(*gregsetp)[PC_REGNUM]); + supply_register (PC_REGNUM, (char *) ®_pc); +} - The GOT is also a synthetic area, created by the linker. It exists - in both executables and libraries. When the GOT is first - initialized , all the GOT entries relating to PLT fixups are - pointing to code back at PLT[0]. - - The special entries in the GOT are: +/* Fill register regno (if it is a floating-point register) in + *fpregsetp with the appropriate value from GDB's register array. + If regno is -1, do this for all registers. */ - GOT[0] = linked list pointer used by the dynamic loader - GOT[1] = pointer to the reloc table for this module - GOT[2] = pointer to the fixup/resolver code +void +fill_fpregset (fpregset_t *fpregsetp, int regno) +{ + FPA11 *fp = (FPA11 *) fpregsetp; + + if (-1 == regno) + { + int regnum; + for (regnum = F0_REGNUM; regnum <= F7_REGNUM; regnum++) + store_nwfpe_register (regnum, fp); + } + else if (regno >= F0_REGNUM && regno <= F7_REGNUM) + { + store_nwfpe_register (regno, fp); + return; + } - The first invocation of function call comes through and uses the - fixup/resolver code. On the entry to the fixup/resolver code: - - ip = &GOT[n+3] - lr = &GOT[2] - stack[0] = return address (lr) of the function call - [r0, r1, r2, r3] are still the arguments to the function call + /* Store fpsr. */ + if (register_valid[FPS_REGNUM]) + if (FPS_REGNUM == regno || -1 == regno) + read_register_gen (FPS_REGNUM, (char *) &fp->fpsr); +} - This is enough information for the fixup/resolver code to work - with. Before the fixup/resolver code returns, it actually calls - the requested function and repairs &GOT[n+3]. */ +/* Fill GDB's register array with the floating-point register values + in *fpregsetp. */ -CORE_ADDR -arm_skip_solib_resolver (CORE_ADDR pc) +void +supply_fpregset (fpregset_t *fpregsetp) { - /* FIXME */ - return 0; -} + int regno; + FPA11 *fp = (FPA11 *) fpregsetp; -int -arm_linux_register_u_addr (int blockend, int regnum) -{ - return blockend + REGISTER_BYTE (regnum); + /* Fetch fpsr. */ + supply_register (FPS_REGNUM, (char *) &fp->fpsr); + + /* Fetch the floating point registers. */ + for (regno = F0_REGNUM; regno <= F7_REGNUM; regno++) + { + fetch_nwfpe_register (regno, fp); + } } int diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 8a575a4ff49..cbe8c182def 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -24,6 +24,11 @@ #include "gdbtypes.h" #include "floatformat.h" +/* For arm_linux_skip_solib_resolver. */ +#include "symtab.h" +#include "symfile.h" +#include "objfiles.h" + #ifdef GET_LONGJMP_TARGET /* Figure out where the longjmp will land. We expect that we have @@ -221,6 +226,213 @@ arm_linux_push_arguments (int nargs, value_ptr * args, CORE_ADDR sp, return sp; } +/* + Dynamic Linking on ARM Linux + ---------------------------- + + Note: PLT = procedure linkage table + GOT = global offset table + + As much as possible, ELF dynamic linking defers the resolution of + jump/call addresses until the last minute. The technique used is + inspired by the i386 ELF design, and is based on the following + constraints. + + 1) The calling technique should not force a change in the assembly + code produced for apps; it MAY cause changes in the way assembly + code is produced for position independent code (i.e. shared + libraries). + + 2) The technique must be such that all executable areas must not be + modified; and any modified areas must not be executed. + + To do this, there are three steps involved in a typical jump: + + 1) in the code + 2) through the PLT + 3) using a pointer from the GOT + + When the executable or library is first loaded, each GOT entry is + initialized to point to the code which implements dynamic name + resolution and code finding. This is normally a function in the + program interpreter (on ARM Linux this is usually ld-linux.so.2, + but it does not have to be). On the first invocation, the function + is located and the GOT entry is replaced with the real function + address. Subsequent calls go through steps 1, 2 and 3 and end up + calling the real code. + + 1) In the code: + + b function_call + bl function_call + + This is typical ARM code using the 26 bit relative branch or branch + and link instructions. The target of the instruction + (function_call is usually the address of the function to be called. + In position independent code, the target of the instruction is + actually an entry in the PLT when calling functions in a shared + library. Note that this call is identical to a normal function + call, only the target differs. + + 2) In the PLT: + + The PLT is a synthetic area, created by the linker. It exists in + both executables and libraries. It is an array of stubs, one per + imported function call. It looks like this: + + PLT[0]: + str lr, [sp, #-4]! @push the return address (lr) + ldr lr, [pc, #16] @load from 6 words ahead + add lr, pc, lr @form an address for GOT[0] + ldr pc, [lr, #8]! @jump to the contents of that addr + + The return address (lr) is pushed on the stack and used for + calculations. The load on the second line loads the lr with + &GOT[3] - . - 20. The addition on the third leaves: + + lr = (&GOT[3] - . - 20) + (. + 8) + lr = (&GOT[3] - 12) + lr = &GOT[0] + + On the fourth line, the pc and lr are both updated, so that: + + pc = GOT[2] + lr = &GOT[0] + 8 + = &GOT[2] + + NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little + "tight", but allows us to keep all the PLT entries the same size. + + PLT[n+1]: + ldr ip, [pc, #4] @load offset from gotoff + add ip, pc, ip @add the offset to the pc + ldr pc, [ip] @jump to that address + gotoff: .word GOT[n+3] - . + + The load on the first line, gets an offset from the fourth word of + the PLT entry. The add on the second line makes ip = &GOT[n+3], + which contains either a pointer to PLT[0] (the fixup trampoline) or + a pointer to the actual code. + + 3) In the GOT: + + The GOT contains helper pointers for both code (PLT) fixups and + data fixups. The first 3 entries of the GOT are special. The next + M entries (where M is the number of entries in the PLT) belong to + the PLT fixups. The next D (all remaining) entries belong to + various data fixups. The actual size of the GOT is 3 + M + D. + + The GOT is also a synthetic area, created by the linker. It exists + in both executables and libraries. When the GOT is first + initialized , all the GOT entries relating to PLT fixups are + pointing to code back at PLT[0]. + + The special entries in the GOT are: + + GOT[0] = linked list pointer used by the dynamic loader + GOT[1] = pointer to the reloc table for this module + GOT[2] = pointer to the fixup/resolver code + + The first invocation of function call comes through and uses the + fixup/resolver code. On the entry to the fixup/resolver code: + + ip = &GOT[n+3] + lr = &GOT[2] + stack[0] = return address (lr) of the function call + [r0, r1, r2, r3] are still the arguments to the function call + + This is enough information for the fixup/resolver code to work + with. Before the fixup/resolver code returns, it actually calls + the requested function and repairs &GOT[n+3]. */ + +/* Find the minimal symbol named NAME, and return both the minsym + struct and its objfile. This probably ought to be in minsym.c, but + everything there is trying to deal with things like C++ and + SOFUN_ADDRESS_MAYBE_TURQUOISE, ... Since this is so simple, it may + be considered too special-purpose for general consumption. */ + +static struct minimal_symbol * +find_minsym_and_objfile (char *name, struct objfile **objfile_p) +{ + struct objfile *objfile; + + ALL_OBJFILES (objfile) + { + struct minimal_symbol *msym; + + ALL_OBJFILE_MSYMBOLS (objfile, msym) + { + if (SYMBOL_NAME (msym) + && STREQ (SYMBOL_NAME (msym), name)) + { + *objfile_p = objfile; + return msym; + } + } + } + + return 0; +} + + +static CORE_ADDR +skip_hurd_resolver (CORE_ADDR pc) +{ + /* The HURD dynamic linker is part of the GNU C library, so many + GNU/Linux distributions use it. (All ELF versions, as far as I + know.) An unresolved PLT entry points to "_dl_runtime_resolve", + which calls "fixup" to patch the PLT, and then passes control to + the function. + + We look for the symbol `_dl_runtime_resolve', and find `fixup' in + the same objfile. If we are at the entry point of `fixup', then + we set a breakpoint at the return address (at the top of the + stack), and continue. + + It's kind of gross to do all these checks every time we're + called, since they don't change once the executable has gotten + started. But this is only a temporary hack --- upcoming versions + of Linux will provide a portable, efficient interface for + debugging programs that use shared libraries. */ + + struct objfile *objfile; + struct minimal_symbol *resolver + = find_minsym_and_objfile ("_dl_runtime_resolve", &objfile); + + if (resolver) + { + struct minimal_symbol *fixup + = lookup_minimal_symbol ("fixup", 0, objfile); + + if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc) + return (SAVED_PC_AFTER_CALL (get_current_frame ())); + } + + return 0; +} + +/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c. + This function: + 1) decides whether a PLT has sent us into the linker to resolve + a function reference, and + 2) if so, tells us where to set a temporary breakpoint that will + trigger when the dynamic linker is done. */ + +CORE_ADDR +arm_linux_skip_solib_resolver (CORE_ADDR pc) +{ + CORE_ADDR result; + + /* Plug in functions for other kinds of resolvers here. */ + result = skip_hurd_resolver (pc); + printf ("Result = 0x%08x\n"); + if (result) + return result; + + + return 0; +} + void _initialize_arm_linux_tdep (void) { diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 7112c4caf71..84a350af8c1 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2083,7 +2083,7 @@ The valid values are:\n"); /* Add the disassembly-flavor command */ new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class, valid_flavors, - (char *) &disassembly_flavor, + &disassembly_flavor, helptext, &setlist); new_cmd->function.sfunc = set_disassembly_flavor_sfunc; diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 51fe5b6d54c..e0d6ce581c6 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -56,101 +56,81 @@ struct agent_expr * --- agent expression buffer to generate code into struct axs_value * --- describes value left on top of stack */ -static struct value *const_var_ref PARAMS ((struct symbol * var)); -static struct value *const_expr PARAMS ((union exp_element ** pc)); -static struct value *maybe_const_expr PARAMS ((union exp_element ** pc)); - -static void gen_traced_pop PARAMS ((struct agent_expr *, struct axs_value *)); - -static void gen_sign_extend PARAMS ((struct agent_expr *, struct type *)); -static void gen_extend PARAMS ((struct agent_expr *, struct type *)); -static void gen_fetch PARAMS ((struct agent_expr *, struct type *)); -static void gen_left_shift PARAMS ((struct agent_expr *, int)); - - -static void gen_frame_args_address PARAMS ((struct agent_expr *)); -static void gen_frame_locals_address PARAMS ((struct agent_expr *)); -static void gen_offset PARAMS ((struct agent_expr * ax, int offset)); -static void gen_sym_offset PARAMS ((struct agent_expr *, struct symbol *)); -static void gen_var_ref PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct symbol * var)); - - -static void gen_int_literal PARAMS ((struct agent_expr * ax, - struct axs_value * value, - LONGEST k, struct type * type)); - - -static void require_rvalue PARAMS ((struct agent_expr * ax, - struct axs_value * value)); -static void gen_usual_unary PARAMS ((struct agent_expr * ax, - struct axs_value * value)); -static int type_wider_than PARAMS ((struct type * type1, - struct type * type2)); -static struct type *max_type PARAMS ((struct type * type1, - struct type * type2)); -static void gen_conversion PARAMS ((struct agent_expr * ax, - struct type * from, - struct type * to)); -static int is_nontrivial_conversion PARAMS ((struct type * from, - struct type * to)); -static void gen_usual_arithmetic PARAMS ((struct agent_expr * ax, - struct axs_value * value1, - struct axs_value * value2)); -static void gen_integral_promotions PARAMS ((struct agent_expr * ax, - struct axs_value * value)); -static void gen_cast PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct type * type)); -static void gen_scale PARAMS ((struct agent_expr * ax, - enum agent_op op, - struct type * type)); -static void gen_add PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct axs_value * value1, - struct axs_value * value2, - char *name)); -static void gen_sub PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct axs_value * value1, - struct axs_value * value2)); -static void gen_binop PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct axs_value * value1, - struct axs_value * value2, - enum agent_op op, - enum agent_op op_unsigned, - int may_carry, - char *name)); -static void gen_logical_not PARAMS ((struct agent_expr * ax, - struct axs_value * value)); -static void gen_complement PARAMS ((struct agent_expr * ax, - struct axs_value * value)); -static void gen_deref PARAMS ((struct agent_expr *, struct axs_value *)); -static void gen_address_of PARAMS ((struct agent_expr *, struct axs_value *)); -static int find_field PARAMS ((struct type * type, char *name)); -static void gen_bitfield_ref PARAMS ((struct agent_expr * ax, - struct axs_value * value, - struct type * type, - int start, int end)); -static void gen_struct_ref PARAMS ((struct agent_expr * ax, - struct axs_value * value, - char *field, - char *operator_name, - char *operand_name)); -static void gen_repeat PARAMS ((union exp_element ** pc, - struct agent_expr * ax, - struct axs_value * value)); -static void gen_sizeof PARAMS ((union exp_element ** pc, - struct agent_expr * ax, - struct axs_value * value)); -static void gen_expr PARAMS ((union exp_element ** pc, - struct agent_expr * ax, - struct axs_value * value)); +static struct value *const_var_ref (struct symbol *var); +static struct value *const_expr (union exp_element **pc); +static struct value *maybe_const_expr (union exp_element **pc); + +static void gen_traced_pop (struct agent_expr *, struct axs_value *); + +static void gen_sign_extend (struct agent_expr *, struct type *); +static void gen_extend (struct agent_expr *, struct type *); +static void gen_fetch (struct agent_expr *, struct type *); +static void gen_left_shift (struct agent_expr *, int); + + +static void gen_frame_args_address (struct agent_expr *); +static void gen_frame_locals_address (struct agent_expr *); +static void gen_offset (struct agent_expr *ax, int offset); +static void gen_sym_offset (struct agent_expr *, struct symbol *); +static void gen_var_ref (struct agent_expr *ax, + struct axs_value *value, struct symbol *var); + + +static void gen_int_literal (struct agent_expr *ax, + struct axs_value *value, + LONGEST k, struct type *type); + + +static void require_rvalue (struct agent_expr *ax, struct axs_value *value); +static void gen_usual_unary (struct agent_expr *ax, struct axs_value *value); +static int type_wider_than (struct type *type1, struct type *type2); +static struct type *max_type (struct type *type1, struct type *type2); +static void gen_conversion (struct agent_expr *ax, + struct type *from, struct type *to); +static int is_nontrivial_conversion (struct type *from, struct type *to); +static void gen_usual_arithmetic (struct agent_expr *ax, + struct axs_value *value1, + struct axs_value *value2); +static void gen_integral_promotions (struct agent_expr *ax, + struct axs_value *value); +static void gen_cast (struct agent_expr *ax, + struct axs_value *value, struct type *type); +static void gen_scale (struct agent_expr *ax, + enum agent_op op, struct type *type); +static void gen_add (struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, + struct axs_value *value2, char *name); +static void gen_sub (struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, struct axs_value *value2); +static void gen_binop (struct agent_expr *ax, + struct axs_value *value, + struct axs_value *value1, + struct axs_value *value2, + enum agent_op op, + enum agent_op op_unsigned, int may_carry, char *name); +static void gen_logical_not (struct agent_expr *ax, struct axs_value *value); +static void gen_complement (struct agent_expr *ax, struct axs_value *value); +static void gen_deref (struct agent_expr *, struct axs_value *); +static void gen_address_of (struct agent_expr *, struct axs_value *); +static int find_field (struct type *type, char *name); +static void gen_bitfield_ref (struct agent_expr *ax, + struct axs_value *value, + struct type *type, int start, int end); +static void gen_struct_ref (struct agent_expr *ax, + struct axs_value *value, + char *field, + char *operator_name, char *operand_name); +static void gen_repeat (union exp_element **pc, + struct agent_expr *ax, struct axs_value *value); +static void gen_sizeof (union exp_element **pc, + struct agent_expr *ax, struct axs_value *value); +static void gen_expr (union exp_element **pc, + struct agent_expr *ax, struct axs_value *value); static void print_axs_value (struct ui_file *f, struct axs_value * value); -static void agent_command PARAMS ((char *exp, int from_tty)); +static void agent_command (char *exp, int from_tty); /* Detecting constant expressions. */ @@ -185,7 +165,7 @@ const_var_ref (var) return value_from_longest (type, (LONGEST) SYMBOL_VALUE (var)); case LOC_LABEL: - return value_from_longest (type, (LONGEST) SYMBOL_VALUE_ADDRESS (var)); + return value_from_pointer (type, (CORE_ADDR) SYMBOL_VALUE_ADDRESS (var)); default: return 0; @@ -1798,7 +1778,7 @@ expr_to_agent (expr, value) struct agent_expr *ax = new_agent_expr (0); union exp_element *pc; - old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax); + old_chain = make_cleanup_free_agent_expr (ax); pc = expr->elts; trace_kludge = 0; @@ -1854,7 +1834,7 @@ gen_trace_for_expr (scope, expr) union exp_element *pc; struct axs_value value; - old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax); + old_chain = make_cleanup_free_agent_expr (ax); pc = expr->elts; trace_kludge = 1; @@ -1923,9 +1903,9 @@ agent_command (exp, from_tty) error_no_arg ("expression to translate"); expr = parse_expression (exp); - old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr); + old_chain = make_cleanup (free_current_contents, &expr); agent = gen_trace_for_expr (fi->pc, expr); - make_cleanup ((make_cleanup_func) free_agent_expr, agent); + make_cleanup_free_agent_expr (agent); ax_print (gdb_stdout, agent); /* It would be nice to call ax_reqs here to gather some general info @@ -1938,7 +1918,7 @@ agent_command (exp, from_tty) /* Initialization code. */ -void _initialize_ax_gdb PARAMS ((void)); +void _initialize_ax_gdb (void); void _initialize_ax_gdb () { diff --git a/gdb/ax-gdb.h b/gdb/ax-gdb.h index 3764b692e64..e46a69983d1 100644 --- a/gdb/ax-gdb.h +++ b/gdb/ax-gdb.h @@ -94,21 +94,19 @@ struct axs_value /* Given a GDB expression EXPR, translate it into the agent bytecode, and return it. FLAGS are from enum expr_to_agent_flags. */ -extern struct agent_expr *expr_to_agent PARAMS ((struct expression * EXPR, - struct axs_value * VALUE)); +extern struct agent_expr *expr_to_agent (struct expression *EXPR, + struct axs_value *VALUE); /* Given a GDB expression EXPR denoting an lvalue in memory, produce a string of agent bytecode which will leave its address and size on the top of stack. Return the agent expression. */ -extern struct agent_expr *expr_to_address_and_size - PARAMS ((struct expression * EXPR)); +extern struct agent_expr *expr_to_address_and_size (struct expression *EXPR); /* Given a GDB expression EXPR, return bytecode to trace its value. The result will use the `trace' and `trace_quick' bytecodes to record the value of all memory touched by the expression, and leave no values on the stack. The caller can then use the ax_reqs function to discover which registers the expression uses. */ -extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR, - struct expression *)); +extern struct agent_expr *gen_trace_for_expr (CORE_ADDR, struct expression *); #endif /* AX_GDB_H */ diff --git a/gdb/ax-general.c b/gdb/ax-general.c index 34ec3b3071e..0c851ebb7bf 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -28,13 +28,13 @@ #include "value.h" -static void grow_expr PARAMS ((struct agent_expr * x, int n)); +static void grow_expr (struct agent_expr *x, int n); -static void append_const PARAMS ((struct agent_expr * x, LONGEST val, int n)); +static void append_const (struct agent_expr *x, LONGEST val, int n); -static LONGEST read_const PARAMS ((struct agent_expr * x, int o, int n)); +static LONGEST read_const (struct agent_expr *x, int o, int n); -static void generic_ext PARAMS ((struct agent_expr * x, enum agent_op op, int n)); +static void generic_ext (struct agent_expr *x, enum agent_op op, int n); /* Functions for building expressions. */ @@ -62,6 +62,18 @@ free_agent_expr (x) free (x); } +static void +do_free_agent_expr_cleanup (void *x) +{ + free_agent_expr (x); +} + +struct cleanup * +make_cleanup_free_agent_expr (struct agent_expr *x) +{ + return make_cleanup (do_free_agent_expr_cleanup, x); +} + /* Make sure that X has room for at least N more bytes. This doesn't affect the length, just the allocated size. */ diff --git a/gdb/ax.h b/gdb/ax.h index bf1fd2c8622..1d601bb800d 100644 --- a/gdb/ax.h +++ b/gdb/ax.h @@ -139,25 +139,26 @@ enum agent_op /* Functions for building expressions. */ /* Allocate a new, empty agent expression. */ -extern struct agent_expr *new_agent_expr PARAMS ((CORE_ADDR)); +extern struct agent_expr *new_agent_expr (CORE_ADDR); /* Free a agent expression. */ -extern void free_agent_expr PARAMS ((struct agent_expr *)); +extern void free_agent_expr (struct agent_expr *); +extern struct cleanup *make_cleanup_free_agent_expr (struct agent_expr *); /* Append a simple operator OP to EXPR. */ -extern void ax_simple PARAMS ((struct agent_expr * EXPR, enum agent_op OP)); +extern void ax_simple (struct agent_expr *EXPR, enum agent_op OP); /* Append the floating-point prefix, for the next bytecode. */ #define ax_float(EXPR) (ax_simple ((EXPR), aop_float)) /* Append a sign-extension instruction to EXPR, to extend an N-bit value. */ -extern void ax_ext PARAMS ((struct agent_expr * EXPR, int N)); +extern void ax_ext (struct agent_expr *EXPR, int N); /* Append a zero-extension instruction to EXPR, to extend an N-bit value. */ -extern void ax_zero_ext PARAMS ((struct agent_expr * EXPR, int N)); +extern void ax_zero_ext (struct agent_expr *EXPR, int N); /* Append a trace_quick instruction to EXPR, to record N bytes. */ -extern void ax_trace_quick PARAMS ((struct agent_expr * EXPR, int N)); +extern void ax_trace_quick (struct agent_expr *EXPR, int N); /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or aop_if_goto). We assume we don't know the target offset yet, @@ -165,21 +166,21 @@ extern void ax_trace_quick PARAMS ((struct agent_expr * EXPR, int N)); for the target, and return the offset in EXPR of that space, so we can backpatch it once we do know the target offset. Use ax_label to do the backpatching. */ -extern int ax_goto PARAMS ((struct agent_expr * EXPR, enum agent_op OP)); +extern int ax_goto (struct agent_expr *EXPR, enum agent_op OP); /* Suppose a given call to ax_goto returns some value PATCH. When you know the offset TARGET that goto should jump to, call ax_label (EXPR, PATCH, TARGET) to patch TARGET into the ax_goto instruction. */ -extern void ax_label PARAMS ((struct agent_expr * EXPR, int patch, int target)); +extern void ax_label (struct agent_expr *EXPR, int patch, int target); /* Assemble code to push a constant on the stack. */ -extern void ax_const_l PARAMS ((struct agent_expr * EXPR, LONGEST l)); -extern void ax_const_d PARAMS ((struct agent_expr * EXPR, LONGEST d)); +extern void ax_const_l (struct agent_expr *EXPR, LONGEST l); +extern void ax_const_d (struct agent_expr *EXPR, LONGEST d); /* Assemble code to push the value of register number REG on the stack. */ -extern void ax_reg PARAMS ((struct agent_expr * EXPR, int REG)); +extern void ax_reg (struct agent_expr *EXPR, int REG); /* Functions for printing out expressions, and otherwise debugging @@ -284,7 +285,6 @@ struct agent_reqs /* Given an agent expression AX, fill in an agent_reqs structure REQS describing it. */ -extern void ax_reqs PARAMS ((struct agent_expr * ax, - struct agent_reqs * reqs)); +extern void ax_reqs (struct agent_expr *ax, struct agent_reqs *reqs); #endif /* AGENTEXPR_H */ diff --git a/gdb/bcache.c b/gdb/bcache.c index 766aff9c3bb..fcff55e5ac9 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -28,42 +28,25 @@ #include "bcache.h" #include "gdb_string.h" /* For memcpy declaration */ - +/* The old hash function was stolen from SDBM. This is what DB 3.0 uses now, + * and is better than the old one. + */ -/* The hash function. */ - unsigned long -hash (void *addr, int length) +hash(void *addr, int length) { - /* If it's a short string, hash on every character. Otherwise, sample - characters from throughout the string. */ - if (length <= 64) - { - char *byte = addr; - unsigned long h = 0; - int i; - - for (i = 0; i < length; i++) - h = h * 65793 ^ (h >> (sizeof (h) * 8 - 6)) ^ byte[i]; - - return h; - } - else - { - char *byte = addr; - int n, i; - unsigned long h = 0; - - for (n = i = 0; n < 64; n++) - { - h = h * 65793 + (h >> (sizeof (h) * 8 - 6)) + byte[i]; - i = h % length; - } - - return h; - } + const unsigned char *k, *e; + unsigned long h; + + k = (const unsigned char *)addr; + e = k+length; + for (h=0; k< e;++k) + { + h *=16777619; + h ^= *k; + } + return (h); } - /* Growing the bcache's hash table. */ @@ -189,7 +172,8 @@ void free_bcache (struct bcache *bcache) { obstack_free (&bcache->cache, 0); - free (bcache->bucket); + if (bcache->bucket) + free (bcache->bucket); /* This isn't necessary, but at least the bcache is always in a consistent state. */ diff --git a/gdb/bcache.h b/gdb/bcache.h index 4735af71cd3..5355e7481c2 100644 --- a/gdb/bcache.h +++ b/gdb/bcache.h @@ -125,5 +125,6 @@ extern void free_bcache (struct bcache *bcache); kind of data BCACHE holds. Statistics are printed using `printf_filtered' and its ilk. */ extern void print_bcache_statistics (struct bcache *bcache, char *type); - +/* The hash function */ +extern unsigned long hash(void *addr, int length); #endif /* BCACHE_H */ diff --git a/gdb/blockframe.c b/gdb/blockframe.c index d00f5c23fc6..ccc80dbbd3f 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -300,15 +300,9 @@ frameless_look_for_prologue (frame) if (func_start) { func_start += FUNCTION_START_OFFSET; - after_prologue = func_start; -#ifdef SKIP_PROLOGUE_FRAMELESS_P /* This is faster, since only care whether there *is* a prologue, not how long it is. */ - after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue); -#else - after_prologue = SKIP_PROLOGUE (after_prologue); -#endif - return after_prologue == func_start; + return PROLOGUE_FRAMELESS_P (func_start); } else if (frame->pc == 0) /* A frame with a zero PC is usually created by dereferencing a @@ -1109,7 +1103,7 @@ pc_in_call_dummy_at_entry_point (pc, sp, frame_address) /* Dummy frame. This saves the processor state just prior to setting up the inferior function call. Older targets save the registers - target stack (but that really slows down function calls). */ + on the target stack (but that really slows down function calls). */ struct dummy_frame { @@ -1213,8 +1207,8 @@ generic_push_dummy_frame () dummy_frame = xmalloc (sizeof (struct dummy_frame)); dummy_frame->registers = xmalloc (REGISTER_BYTES); - dummy_frame->pc = read_register (PC_REGNUM); - dummy_frame->sp = read_register (SP_REGNUM); + dummy_frame->pc = read_pc (); + dummy_frame->sp = read_sp (); dummy_frame->top = dummy_frame->sp; dummy_frame->fp = fp; read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 89b15909a71..c80c4531b2e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -49,105 +49,75 @@ static void until_break_command_continuation (struct continuation_arg *arg); -static void -catch_command_1 PARAMS ((char *, int, int)); +static void catch_command_1 (char *, int, int); -static void -enable_delete_command PARAMS ((char *, int)); +static void enable_delete_command (char *, int); -static void -enable_delete_breakpoint PARAMS ((struct breakpoint *)); +static void enable_delete_breakpoint (struct breakpoint *); -static void -enable_once_command PARAMS ((char *, int)); +static void enable_once_command (char *, int); -static void -enable_once_breakpoint PARAMS ((struct breakpoint *)); +static void enable_once_breakpoint (struct breakpoint *); -static void -disable_command PARAMS ((char *, int)); +static void disable_command (char *, int); -static void -enable_command PARAMS ((char *, int)); +static void enable_command (char *, int); -static void -map_breakpoint_numbers PARAMS ((char *, void (*)(struct breakpoint *))); +static void map_breakpoint_numbers (char *, void (*)(struct breakpoint *)); -static void -ignore_command PARAMS ((char *, int)); +static void ignore_command (char *, int); -static int breakpoint_re_set_one PARAMS ((PTR)); +static int breakpoint_re_set_one (PTR); -static void -clear_command PARAMS ((char *, int)); +static void clear_command (char *, int); -static void -catch_command PARAMS ((char *, int)); +static void catch_command (char *, int); -static void -handle_gnu_4_16_catch_command PARAMS ((char *, int, int)); +static void handle_gnu_4_16_catch_command (char *, int, int); -static struct symtabs_and_lines -get_catch_sals PARAMS ((int)); +static struct symtabs_and_lines get_catch_sals (int); -static void -watch_command PARAMS ((char *, int)); +static void watch_command (char *, int); -static int -can_use_hardware_watchpoint PARAMS ((struct value *)); +static int can_use_hardware_watchpoint (struct value *); -static void break_at_finish_command PARAMS ((char *, int)); -static void break_at_finish_at_depth_command PARAMS ((char *, int)); +static void break_at_finish_command (char *, int); +static void break_at_finish_at_depth_command (char *, int); -void -tbreak_command PARAMS ((char *, int)); +void tbreak_command (char *, int); -static void tbreak_at_finish_command PARAMS ((char *, int)); +static void tbreak_at_finish_command (char *, int); -static void -break_command_1 PARAMS ((char *, int, int)); +static void break_command_1 (char *, int, int); -static void -mention PARAMS ((struct breakpoint *)); +static void mention (struct breakpoint *); -struct breakpoint * - set_raw_breakpoint PARAMS ((struct symtab_and_line)); +struct breakpoint *set_raw_breakpoint (struct symtab_and_line); -static void -check_duplicates PARAMS ((CORE_ADDR, asection *)); +static void check_duplicates (CORE_ADDR, asection *); -static void -describe_other_breakpoints PARAMS ((CORE_ADDR, asection *)); +static void describe_other_breakpoints (CORE_ADDR, asection *); -static void -breakpoints_info PARAMS ((char *, int)); +static void breakpoints_info (char *, int); -static void -breakpoint_1 PARAMS ((int, int)); +static void breakpoint_1 (int, int); -static bpstat - bpstat_alloc PARAMS ((struct breakpoint *, bpstat)); +static bpstat bpstat_alloc (struct breakpoint *, bpstat); -static int breakpoint_cond_eval PARAMS ((PTR)); +static int breakpoint_cond_eval (PTR); -static void -cleanup_executing_breakpoints PARAMS ((PTR)); +static void cleanup_executing_breakpoints (PTR); -static void -commands_command PARAMS ((char *, int)); +static void commands_command (char *, int); -static void -condition_command PARAMS ((char *, int)); +static void condition_command (char *, int); -static int -get_number_trailer PARAMS ((char **, int)); +static int get_number_trailer (char **, int); -void -set_breakpoint_count PARAMS ((int)); +void set_breakpoint_count (int); #if 0 -static struct breakpoint * - create_temp_exception_breakpoint PARAMS ((CORE_ADDR)); +static struct breakpoint *create_temp_exception_breakpoint (CORE_ADDR); #endif typedef enum @@ -157,10 +127,9 @@ typedef enum } insertion_state_t; -static int -remove_breakpoint PARAMS ((struct breakpoint *, insertion_state_t)); +static int remove_breakpoint (struct breakpoint *, insertion_state_t); -static enum print_stop_action print_it_typical PARAMS ((bpstat)); +static enum print_stop_action print_it_typical (bpstat); static enum print_stop_action print_bp_stop_message (bpstat bs); @@ -171,95 +140,86 @@ typedef struct } args_for_catchpoint_enable; -static int watchpoint_check PARAMS ((PTR)); +static int watchpoint_check (PTR); -static int cover_target_enable_exception_callback PARAMS ((PTR)); +static int cover_target_enable_exception_callback (PTR); -static void maintenance_info_breakpoints PARAMS ((char *, int)); +static void maintenance_info_breakpoints (char *, int); #ifdef GET_LONGJMP_TARGET -static void create_longjmp_breakpoint PARAMS ((char *)); +static void create_longjmp_breakpoint (char *); #endif -static int hw_breakpoint_used_count PARAMS ((void)); +static int hw_breakpoint_used_count (void); -static int hw_watchpoint_used_count PARAMS ((enum bptype, int *)); +static int hw_watchpoint_used_count (enum bptype, int *); -static void hbreak_command PARAMS ((char *, int)); +static void hbreak_command (char *, int); -static void thbreak_command PARAMS ((char *, int)); +static void thbreak_command (char *, int); -static void watch_command_1 PARAMS ((char *, int, int)); +static void watch_command_1 (char *, int, int); -static void rwatch_command PARAMS ((char *, int)); +static void rwatch_command (char *, int); -static void awatch_command PARAMS ((char *, int)); +static void awatch_command (char *, int); -static void do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp)); +static void do_enable_breakpoint (struct breakpoint *, enum bpdisp); -static void solib_load_unload_1 PARAMS ((char *hookname, - int tempflag, - char *dll_pathname, - char *cond_string, - enum bptype bp_kind)); +static void solib_load_unload_1 (char *hookname, + int tempflag, + char *dll_pathname, + char *cond_string, enum bptype bp_kind); -static void create_fork_vfork_event_catchpoint PARAMS ((int tempflag, - char *cond_string, - enum bptype bp_kind)); +static void create_fork_vfork_event_catchpoint (int tempflag, + char *cond_string, + enum bptype bp_kind); -static void break_at_finish_at_depth_command_1 PARAMS ((char *arg, - int flag, - int from_tty)); +static void break_at_finish_at_depth_command_1 (char *arg, + int flag, int from_tty); -static void break_at_finish_command_1 PARAMS ((char *arg, - int flag, - int from_tty)); +static void break_at_finish_command_1 (char *arg, int flag, int from_tty); -static void stop_command PARAMS ((char *arg, int from_tty)); +static void stop_command (char *arg, int from_tty); -static void stopin_command PARAMS ((char *arg, int from_tty)); +static void stopin_command (char *arg, int from_tty); -static void stopat_command PARAMS ((char *arg, int from_tty)); +static void stopat_command (char *arg, int from_tty); -static char *ep_find_event_name_end PARAMS ((char *arg)); +static char *ep_find_event_name_end (char *arg); -static char *ep_parse_optional_if_clause PARAMS ((char **arg)); +static char *ep_parse_optional_if_clause (char **arg); -static char *ep_parse_optional_filename PARAMS ((char **arg)); +static char *ep_parse_optional_filename (char **arg); #if defined(CHILD_INSERT_EXEC_CATCHPOINT) -static void catch_exec_command_1 PARAMS ((char *arg, int tempflag, - int from_tty)); +static void catch_exec_command_1 (char *arg, int tempflag, int from_tty); #endif -static void create_exception_catchpoint - PARAMS ((int tempflag, char *cond_string, - enum exception_event_kind ex_event, - struct symtab_and_line * sal)); +static void create_exception_catchpoint + (int tempflag, char *cond_string, + enum exception_event_kind ex_event, struct symtab_and_line *sal); -static void catch_exception_command_1 - PARAMS ((enum exception_event_kind ex_event, - char *arg, int tempflag, int from_tty)); +static void catch_exception_command_1 + (enum exception_event_kind ex_event, char *arg, int tempflag, int from_tty); -static void tcatch_command PARAMS ((char *arg, int from_tty)); +static void tcatch_command (char *arg, int from_tty); -static void ep_skip_leading_whitespace PARAMS ((char **s)); +static void ep_skip_leading_whitespace (char **s); /* Prototypes for exported functions. */ -static void -awatch_command PARAMS ((char *, int)); +static void awatch_command (char *, int); -static void -do_enable_breakpoint PARAMS ((struct breakpoint *, enum bpdisp)); +static void do_enable_breakpoint (struct breakpoint *, enum bpdisp); /* If FALSE, gdb will not use hardware support for watchpoints, even if such is available. */ static int can_use_hw_watchpoints; -void _initialize_breakpoint PARAMS ((void)); +void _initialize_breakpoint (void); -void set_breakpoint_count PARAMS ((int)); +void set_breakpoint_count (int); extern int addressprint; /* Print machine addresses? */ @@ -1939,7 +1899,7 @@ print_it_typical (bs) struct cleanup *old_chain; struct ui_stream *stb; stb = ui_out_stream_new (uiout); - old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb); + old_chain = make_cleanup_ui_out_stream_delete (stb); #endif /* UI_OUT */ /* bs->breakpoint_at can be NULL if it was a momentary breakpoint which has since been deleted. */ @@ -4458,7 +4418,7 @@ mention (b) struct ui_stream *stb; stb = ui_out_stream_new (uiout); - old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb); + old_chain = make_cleanup_ui_out_stream_delete (stb); #endif /* UI_OUT */ /* FIXME: This is misplaced; mention() is called by things (like hitting a @@ -5752,10 +5712,9 @@ until_break_command (arg, from_tty) breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until); if (!event_loop_p || !target_can_async_p ()) - old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, - breakpoint); + old_chain = make_cleanup_delete_breakpoint (breakpoint); else - old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); /* If we are running asynchronously, and the target supports async execution, we are not waiting for the target to stop, in the call @@ -5786,9 +5745,9 @@ until_break_command (arg, from_tty) sal.pc = prev_frame->pc; breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until); if (!event_loop_p || !target_can_async_p ()) - make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + make_cleanup_delete_breakpoint (breakpoint); else - make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + make_exec_cleanup_delete_breakpoint (breakpoint); } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); @@ -6130,10 +6089,8 @@ typedef enum catch_fork_kind; #if defined(CHILD_INSERT_FORK_CATCHPOINT) || defined(CHILD_INSERT_VFORK_CATCHPOINT) -static void catch_fork_command_1 PARAMS ((catch_fork_kind fork_kind, - char *arg, - int tempflag, - int from_tty)); +static void catch_fork_command_1 (catch_fork_kind fork_kind, + char *arg, int tempflag, int from_tty); static void catch_fork_command_1 (fork_kind, arg, tempflag, from_tty) @@ -7068,6 +7025,24 @@ delete_breakpoint (bpt) free ((PTR) bpt); } +static void +do_delete_breakpoint_cleanup (void *b) +{ + delete_breakpoint (b); +} + +struct cleanup * +make_cleanup_delete_breakpoint (struct breakpoint *b) +{ + return make_cleanup (do_delete_breakpoint_cleanup, b); +} + +struct cleanup * +make_exec_cleanup_delete_breakpoint (struct breakpoint *b) +{ + return make_exec_cleanup (do_delete_breakpoint_cleanup, b); +} + void delete_command (arg, from_tty) char *arg; @@ -7421,7 +7396,7 @@ ignore_command (args, from_tty) static void map_breakpoint_numbers (args, function) char *args; - void (*function) PARAMS ((struct breakpoint *)); + void (*function) (struct breakpoint *); { register char *p = args; char *p1; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 1b4e02aa7b2..c25ab41f8fa 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -306,13 +306,13 @@ typedef struct bpstats *bpstat; /* Interface: */ /* Clear a bpstat so that it says we are not at any breakpoint. Also free any storage that is part of a bpstat. */ -extern void bpstat_clear PARAMS ((bpstat *)); +extern void bpstat_clear (bpstat *); /* Return a copy of a bpstat. Like "bs1 = bs2" but all storage that is part of the bpstat is copied as well. */ -extern bpstat bpstat_copy PARAMS ((bpstat)); +extern bpstat bpstat_copy (bpstat); -extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, int)); +extern bpstat bpstat_stop_status (CORE_ADDR *, int); /* This bpstat_what stuff tells wait_for_inferior what to do with a breakpoint (a challenging task). */ @@ -396,10 +396,10 @@ enum print_stop_action }; /* Tell what to do about this bpstat. */ -struct bpstat_what bpstat_what PARAMS ((bpstat)); +struct bpstat_what bpstat_what (bpstat); /* Find the bpstat associated with a breakpoint. NULL otherwise. */ -bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *)); +bpstat bpstat_find_breakpoint (bpstat, struct breakpoint *); /* Find a step_resume breakpoint associated with this bpstat. (If there are multiple step_resume bp's on the list, this function @@ -410,8 +410,7 @@ bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *)); See wait_for_inferior's use of this function. */ -extern struct breakpoint * - bpstat_find_step_resume_breakpoint PARAMS ((bpstat)); +extern struct breakpoint *bpstat_find_step_resume_breakpoint (bpstat); /* Nonzero if a signal that we got in wait() was due to circumstances explained by the BS. */ @@ -422,36 +421,36 @@ extern struct breakpoint * /* Nonzero if we should step constantly (e.g. watchpoints on machines without hardware support). This isn't related to a specific bpstat, just to things like whether watchpoints are set. */ -extern int bpstat_should_step PARAMS ((void)); +extern int bpstat_should_step (void); /* Nonzero if there are enabled hardware watchpoints. */ -extern int bpstat_have_active_hw_watchpoints PARAMS ((void)); +extern int bpstat_have_active_hw_watchpoints (void); /* Print a message indicating what happened. Returns nonzero to say that only the source line should be printed after this (zero return means print the frame as well as the source line). */ -extern enum print_stop_action bpstat_print PARAMS ((bpstat)); +extern enum print_stop_action bpstat_print (bpstat); /* Return the breakpoint number of the first breakpoint we are stopped at. *BSP upon return is a bpstat which points to the remaining breakpoints stopped at (but which is not guaranteed to be good for anything but further calls to bpstat_num). Return 0 if passed a bpstat which does not indicate any breakpoints. */ -extern int bpstat_num PARAMS ((bpstat *)); +extern int bpstat_num (bpstat *); /* Perform actions associated with having stopped at *BSP. Actually, we just use this for breakpoint commands. Perhaps other actions will go here later, but this is executed at a late time (from the command loop). */ -extern void bpstat_do_actions PARAMS ((bpstat *)); +extern void bpstat_do_actions (bpstat *); /* Modify BS so that the actions will not be performed. */ -extern void bpstat_clear_actions PARAMS ((bpstat)); +extern void bpstat_clear_actions (bpstat); /* Given a bpstat that records zero or more triggered eventpoints, this function returns another bpstat which contains only the catchpoints on that first list, if any. */ -extern void bpstat_get_triggered_catchpoints PARAMS ((bpstat, bpstat *)); +extern void bpstat_get_triggered_catchpoints (bpstat, bpstat *); /* Implementation: */ @@ -515,60 +514,63 @@ enum breakpoint_here /* Forward declarations for prototypes */ struct frame_info; -extern enum breakpoint_here breakpoint_here_p PARAMS ((CORE_ADDR)); +extern enum breakpoint_here breakpoint_here_p (CORE_ADDR); -extern int breakpoint_inserted_here_p PARAMS ((CORE_ADDR)); +extern int breakpoint_inserted_here_p (CORE_ADDR); -extern int frame_in_dummy PARAMS ((struct frame_info *)); +extern int frame_in_dummy (struct frame_info *); -extern int breakpoint_thread_match PARAMS ((CORE_ADDR, int)); +extern int breakpoint_thread_match (CORE_ADDR, int); -extern void until_break_command PARAMS ((char *, int)); +extern void until_break_command (char *, int); -extern void breakpoint_re_set PARAMS ((void)); +extern void breakpoint_re_set (void); -extern void breakpoint_re_set_thread PARAMS ((struct breakpoint *)); +extern void breakpoint_re_set_thread (struct breakpoint *); -extern int ep_is_exception_catchpoint PARAMS ((struct breakpoint *)); +extern int ep_is_exception_catchpoint (struct breakpoint *); extern struct breakpoint *set_momentary_breakpoint - PARAMS ((struct symtab_and_line, struct frame_info *, enum bptype)); + (struct symtab_and_line, struct frame_info *, enum bptype); -extern void set_ignore_count PARAMS ((int, int, int)); +extern void set_ignore_count (int, int, int); -extern void set_default_breakpoint PARAMS ((int, CORE_ADDR, - struct symtab *, int)); +extern void set_default_breakpoint (int, CORE_ADDR, struct symtab *, int); -extern void mark_breakpoints_out PARAMS ((void)); +extern void mark_breakpoints_out (void); -extern void breakpoint_init_inferior PARAMS ((enum inf_context)); +extern void breakpoint_init_inferior (enum inf_context); -extern void delete_breakpoint PARAMS ((struct breakpoint *)); +extern struct cleanup *make_cleanup_delete_breakpoint (struct breakpoint *); -extern void breakpoint_auto_delete PARAMS ((bpstat)); +extern struct cleanup *make_exec_cleanup_delete_breakpoint (struct breakpoint *); -extern void breakpoint_clear_ignore_counts PARAMS ((void)); +extern void delete_breakpoint (struct breakpoint *); -extern void break_command PARAMS ((char *, int)); +extern void breakpoint_auto_delete (bpstat); -extern void hbreak_command_wrapper PARAMS ((char *, int)); -extern void thbreak_command_wrapper PARAMS ((char *, int)); -extern void rbreak_command_wrapper PARAMS ((char *, int)); -extern void watch_command_wrapper PARAMS ((char *, int)); -extern void awatch_command_wrapper PARAMS ((char *, int)); -extern void rwatch_command_wrapper PARAMS ((char *, int)); -extern void tbreak_command PARAMS ((char *, int)); +extern void breakpoint_clear_ignore_counts (void); -extern int insert_breakpoints PARAMS ((void)); +extern void break_command (char *, int); -extern int remove_breakpoints PARAMS ((void)); +extern void hbreak_command_wrapper (char *, int); +extern void thbreak_command_wrapper (char *, int); +extern void rbreak_command_wrapper (char *, int); +extern void watch_command_wrapper (char *, int); +extern void awatch_command_wrapper (char *, int); +extern void rwatch_command_wrapper (char *, int); +extern void tbreak_command (char *, int); + +extern int insert_breakpoints (void); + +extern int remove_breakpoints (void); /* This function can be used to physically insert eventpoints from the specified traced inferior process, without modifying the breakpoint package's state. This can be useful for those targets which support following the processes of a fork() or vfork() system call, when both of the resulting two processes are to be followed. */ -extern int reattach_breakpoints PARAMS ((int)); +extern int reattach_breakpoints (int); /* This function can be used to update the breakpoint package's state after an exec() system call has been executed. @@ -585,7 +587,7 @@ extern int reattach_breakpoints PARAMS ((int)); breakpoint list. - All eventpoints without a symbolic address are removed from the breakpoint list. */ -extern void update_breakpoints_after_exec PARAMS ((void)); +extern void update_breakpoints_after_exec (void); /* This function can be used to physically remove hardware breakpoints and watchpoints from the specified traced inferior process, without @@ -596,14 +598,13 @@ extern void update_breakpoints_after_exec PARAMS ((void)); It is an error to use this function on the process whose id is inferior_pid. */ -extern int detach_breakpoints PARAMS ((int)); +extern int detach_breakpoints (int); -extern void enable_longjmp_breakpoint PARAMS ((void)); +extern void enable_longjmp_breakpoint (void); -extern void disable_longjmp_breakpoint PARAMS ((void)); +extern void disable_longjmp_breakpoint (void); -extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR, - struct frame_info *)); +extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_info *); /* These functions respectively disable or reenable all currently enabled watchpoints. When disabled, the watchpoints are marked call_disabled. When reenabled, they are marked enabled. @@ -625,69 +626,66 @@ extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR, that are unable to unwind through the call dummy frame, watches of stack-based storage may then be deleted, because gdb will believe that their watched storage is out of scope. (Sigh.) */ -extern void -disable_watchpoints_before_interactive_call_start PARAMS ((void)); +extern void disable_watchpoints_before_interactive_call_start (void); -extern void -enable_watchpoints_after_interactive_call_stop PARAMS ((void)); +extern void enable_watchpoints_after_interactive_call_stop (void); -extern void clear_breakpoint_hit_counts PARAMS ((void)); +extern void clear_breakpoint_hit_counts (void); -extern int get_number PARAMS ((char **)); +extern int get_number (char **); -extern int get_number_or_range PARAMS ((char **)); +extern int get_number_or_range (char **); /* The following are for displays, which aren't really breakpoints, but here is as good a place as any for them. */ -extern void disable_current_display PARAMS ((void)); +extern void disable_current_display (void); -extern void do_displays PARAMS ((void)); +extern void do_displays (void); -extern void disable_display PARAMS ((int)); +extern void disable_display (int); -extern void clear_displays PARAMS ((void)); +extern void clear_displays (void); -extern void disable_breakpoint PARAMS ((struct breakpoint *)); +extern void disable_breakpoint (struct breakpoint *); -extern void enable_breakpoint PARAMS ((struct breakpoint *)); +extern void enable_breakpoint (struct breakpoint *); -extern void make_breakpoint_permanent PARAMS ((struct breakpoint *)); +extern void make_breakpoint_permanent (struct breakpoint *); -extern struct breakpoint *create_solib_event_breakpoint PARAMS ((CORE_ADDR)); +extern struct breakpoint *create_solib_event_breakpoint (CORE_ADDR); -extern struct breakpoint *create_thread_event_breakpoint PARAMS ((CORE_ADDR)); +extern struct breakpoint *create_thread_event_breakpoint (CORE_ADDR); -extern void remove_solib_event_breakpoints PARAMS ((void)); +extern void remove_solib_event_breakpoints (void); -extern void remove_thread_event_breakpoints PARAMS ((void)); +extern void remove_thread_event_breakpoints (void); -extern void disable_breakpoints_in_shlibs PARAMS ((int silent)); +extern void disable_breakpoints_in_shlibs (int silent); -extern void re_enable_breakpoints_in_shlibs PARAMS ((void)); +extern void re_enable_breakpoints_in_shlibs (void); -extern void create_solib_load_event_breakpoint PARAMS ((char *, int, - char *, char *)); +extern void create_solib_load_event_breakpoint (char *, int, char *, char *); -extern void create_solib_unload_event_breakpoint PARAMS ((char *, int, - char *, char *)); +extern void create_solib_unload_event_breakpoint (char *, int, + char *, char *); -extern void create_fork_event_catchpoint PARAMS ((int, char *)); +extern void create_fork_event_catchpoint (int, char *); -extern void create_vfork_event_catchpoint PARAMS ((int, char *)); +extern void create_vfork_event_catchpoint (int, char *); -extern void create_exec_event_catchpoint PARAMS ((int, char *)); +extern void create_exec_event_catchpoint (int, char *); /* This function returns TRUE if ep is a catchpoint. */ -extern int ep_is_catchpoint PARAMS ((struct breakpoint *)); +extern int ep_is_catchpoint (struct breakpoint *); /* This function returns TRUE if ep is a catchpoint of a shared library (aka dynamically-linked library) event, such as a library load or unload. */ -extern int ep_is_shlib_catchpoint PARAMS ((struct breakpoint *)); +extern int ep_is_shlib_catchpoint (struct breakpoint *); -extern struct breakpoint *set_breakpoint_sal PARAMS ((struct symtab_and_line)); +extern struct breakpoint *set_breakpoint_sal (struct symtab_and_line); /* Enable breakpoints and delete when hit. Called with ARG == NULL deletes all breakpoints. */ diff --git a/gdb/buildsym.c b/gdb/buildsym.c index dff92936cfd..70105be0157 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -36,7 +36,7 @@ #include "gdb_string.h" #include "expression.h" /* For "enum exp_opcode" used by... */ #include "language.h" /* For "longest_local_hex_string_custom" */ - +#include "bcache.h" /* Ask buildsym.h to define the vars it normally declares `extern'. */ #define EXTERN /**/ @@ -1055,33 +1055,13 @@ push_context (int desc, CORE_ADDR valu) return new; } + /* Compute a small integer hash code for the given name. */ int hashname (char *name) { - register char *p = name; - register int total = p[0]; - register int c; - - c = p[1]; - total += c << 2; - if (c) - { - c = p[2]; - total += c << 4; - if (c) - { - total += p[3] << 6; - } - } - - /* Ensure result is positive. */ - if (total < 0) - { - total += (1000 << 6); - } - return (total % HASHSIZE); + return (hash(name,strlen(name)) % HASHSIZE); } diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 377f92a9fb1..d4291f7b979 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -102,14 +102,11 @@ extern int hp_som_som_object_present; #define YYDEBUG 0 /* Default to no yydebug support */ #endif -int -yyparse PARAMS ((void)); +int yyparse (void); -static int -yylex PARAMS ((void)); +static int yylex (void); -void -yyerror PARAMS ((char *)); +void yyerror (char *); %} @@ -144,8 +141,7 @@ yyerror PARAMS ((char *)); %{ /* YYSTYPE gets defined by %union */ -static int -parse_number PARAMS ((char *, int, int, YYSTYPE *)); +static int parse_number (char *, int, int, YYSTYPE *); %} %type exp exp1 type_exp start variable qualified_name lcurly @@ -1437,8 +1433,6 @@ yylex () if (c == '<') { - if (hp_som_som_object_present) - { /* Scan ahead to get rest of the template specification. Note that we look ahead only when the '<' adjoins non-whitespace characters; for comparison expressions, e.g. "a < b > c", @@ -1448,26 +1442,6 @@ yylex () if (p) namelen = p - tokstart; break; - } - else - { - int i = namelen; - int nesting_level = 1; - while (tokstart[++i]) - { - if (tokstart[i] == '<') - nesting_level++; - else if (tokstart[i] == '>') - { - if (--nesting_level == 0) - break; - } - } - if (tokstart[i] == '>') - namelen = i; - else - break; - } } c = tokstart[++namelen]; } diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 2211acb2e08..10d54e6e640 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -27,7 +27,7 @@ #include "c-lang.h" #include "valprint.h" -extern void _initialize_c_language PARAMS ((void)); +extern void _initialize_c_language (void); static void c_emit_char (int c, struct ui_file * stream, int quoter); /* Print the character C on STREAM as part of the contents of a literal diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 6cae708d3fd..ae28b5702e1 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -25,11 +25,9 @@ #include "value.h" -extern int -c_parse PARAMS ((void)); /* Defined in c-exp.y */ +extern int c_parse (void); /* Defined in c-exp.y */ -extern void -c_error PARAMS ((char *)); /* Defined in c-exp.y */ +extern void c_error (char *); /* Defined in c-exp.y */ /* Defined in c-typeprint.c */ extern void c_print_type (struct type *, char *, struct ui_file *, int, @@ -50,7 +48,7 @@ extern void c_printstr (struct ui_file * stream, char *string, unsigned int length, int width, int force_ellipses); -extern struct type *c_create_fundamental_type PARAMS ((struct objfile *, int)); +extern struct type *c_create_fundamental_type (struct objfile *, int); extern struct type **CONST_PTR (c_builtin_types[]); @@ -77,11 +75,9 @@ extern void cp_print_value_fields (struct type *, struct type *, char *, int, enum val_prettyprint, struct type **, int); -extern int -cp_is_vtbl_ptr_type PARAMS ((struct type *)); +extern int cp_is_vtbl_ptr_type (struct type *); -extern int -cp_is_vtbl_member PARAMS ((struct type *)); +extern int cp_is_vtbl_member (struct type *); #endif /* !defined (C_LANG_H) */ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index ec4b3cf862d..f9dbd033fcb 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -135,8 +135,9 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if we ARE using -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ - print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)), - stream, demangle); + CORE_ADDR addr + = extract_typed_address (valaddr + embedded_offset, type); + print_address_demangle (addr, stream, demangle); break; } elttype = check_typedef (TYPE_TARGET_TYPE (type)); @@ -249,10 +250,10 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, } if (addressprint) { + CORE_ADDR addr + = extract_typed_address (valaddr + embedded_offset, type); fprintf_filtered (stream, "@"); - print_address_numeric - (extract_address (valaddr + embedded_offset, - TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream); + print_address_numeric (addr, 1, stream); if (deref_ref) fputs_filtered (": ", stream); } @@ -295,11 +296,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - print_address_demangle (extract_address ( - valaddr + embedded_offset + - TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8, - TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))), - stream, demangle); + int offset = (embedded_offset + + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8); + struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); + CORE_ADDR addr + = extract_typed_address (valaddr + offset, field_type); + + print_address_demangle (addr, stream, demangle); } else cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format, diff --git a/gdb/call-cmds.h b/gdb/call-cmds.h index 40bf5d2f8ef..c96b7368a69 100644 --- a/gdb/call-cmds.h +++ b/gdb/call-cmds.h @@ -16,14 +16,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void -initialize_all_files PARAMS ((void)); +extern void initialize_all_files (void); -extern void -exec_file_command PARAMS ((char *, int)); +extern void exec_file_command (char *, int); -extern void -core_file_command PARAMS ((char *, int)); +extern void core_file_command (char *, int); -extern void -break_command PARAMS ((char *, int)); +extern void break_command (char *, int); diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c index 78924756ef3..4811f7cde6b 100644 --- a/gdb/ch-exp.c +++ b/gdb/ch-exp.c @@ -141,54 +141,54 @@ enum ch_terminal /* Forward declarations. */ -static void write_lower_upper_value PARAMS ((enum exp_opcode, struct type *)); -static enum ch_terminal match_bitstring_literal PARAMS ((void)); -static enum ch_terminal match_integer_literal PARAMS ((void)); -static enum ch_terminal match_character_literal PARAMS ((void)); -static enum ch_terminal match_string_literal PARAMS ((void)); -static enum ch_terminal match_float_literal PARAMS ((void)); -static enum ch_terminal match_float_literal PARAMS ((void)); -static int decode_integer_literal PARAMS ((LONGEST *, char **)); -static int decode_integer_value PARAMS ((int, char **, LONGEST *)); -static char *match_simple_name_string PARAMS ((void)); -static void growbuf_by_size PARAMS ((int)); -static void parse_untyped_expr PARAMS ((void)); -static void parse_if_expression PARAMS ((void)); -static void parse_else_alternative PARAMS ((void)); -static void parse_then_alternative PARAMS ((void)); -static void parse_expr PARAMS ((void)); -static void parse_operand0 PARAMS ((void)); -static void parse_operand1 PARAMS ((void)); -static void parse_operand2 PARAMS ((void)); -static void parse_operand3 PARAMS ((void)); -static void parse_operand4 PARAMS ((void)); -static void parse_operand5 PARAMS ((void)); -static void parse_operand6 PARAMS ((void)); -static void parse_primval PARAMS ((void)); -static void parse_tuple PARAMS ((struct type *)); -static void parse_opt_element_list PARAMS ((struct type *)); -static void parse_tuple_element PARAMS ((struct type *)); -static void parse_named_record_element PARAMS ((void)); -static void parse_call PARAMS ((void)); -static struct type *parse_mode_or_normal_call PARAMS ((void)); +static void write_lower_upper_value (enum exp_opcode, struct type *); +static enum ch_terminal match_bitstring_literal (void); +static enum ch_terminal match_integer_literal (void); +static enum ch_terminal match_character_literal (void); +static enum ch_terminal match_string_literal (void); +static enum ch_terminal match_float_literal (void); +static enum ch_terminal match_float_literal (void); +static int decode_integer_literal (LONGEST *, char **); +static int decode_integer_value (int, char **, LONGEST *); +static char *match_simple_name_string (void); +static void growbuf_by_size (int); +static void parse_untyped_expr (void); +static void parse_if_expression (void); +static void parse_else_alternative (void); +static void parse_then_alternative (void); +static void parse_expr (void); +static void parse_operand0 (void); +static void parse_operand1 (void); +static void parse_operand2 (void); +static void parse_operand3 (void); +static void parse_operand4 (void); +static void parse_operand5 (void); +static void parse_operand6 (void); +static void parse_primval (void); +static void parse_tuple (struct type *); +static void parse_opt_element_list (struct type *); +static void parse_tuple_element (struct type *); +static void parse_named_record_element (void); +static void parse_call (void); +static struct type *parse_mode_or_normal_call (void); #if 0 -static struct type *parse_mode_call PARAMS ((void)); +static struct type *parse_mode_call (void); #endif -static void parse_unary_call PARAMS ((void)); -static int parse_opt_untyped_expr PARAMS ((void)); -static void parse_case_label PARAMS ((void)); -static int expect PARAMS ((enum ch_terminal, char *)); -static void parse_expr PARAMS ((void)); -static void parse_primval PARAMS ((void)); -static void parse_untyped_expr PARAMS ((void)); -static int parse_opt_untyped_expr PARAMS ((void)); -static void parse_if_expression_body PARAMS ((void)); -static enum ch_terminal ch_lex PARAMS ((void)); -INLINE static enum ch_terminal PEEK_TOKEN PARAMS ((void)); -static enum ch_terminal peek_token_ PARAMS ((int)); -static void forward_token_ PARAMS ((void)); -static void require PARAMS ((enum ch_terminal)); -static int check_token PARAMS ((enum ch_terminal)); +static void parse_unary_call (void); +static int parse_opt_untyped_expr (void); +static void parse_case_label (void); +static int expect (enum ch_terminal, char *); +static void parse_expr (void); +static void parse_primval (void); +static void parse_untyped_expr (void); +static int parse_opt_untyped_expr (void); +static void parse_if_expression_body (void); +static enum ch_terminal ch_lex (void); +INLINE static enum ch_terminal PEEK_TOKEN (void); +static enum ch_terminal peek_token_ (int); +static void forward_token_ (void); +static void require (enum ch_terminal); +static int check_token (enum ch_terminal); #define MAX_LOOK_AHEAD 2 static enum ch_terminal terminal_buffer[MAX_LOOK_AHEAD + 1] = diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c index cf6325755be..44e621e1b64 100644 --- a/gdb/ch-lang.c +++ b/gdb/ch-lang.c @@ -28,22 +28,19 @@ #include "ch-lang.h" #include "valprint.h" -extern void _initialize_chill_language PARAMS ((void)); +extern void _initialize_chill_language (void); static value_ptr - evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside)); +evaluate_subexp_chill (struct type *, struct expression *, int *, + enum noside); -static value_ptr - value_chill_max_min PARAMS ((enum exp_opcode, value_ptr)); +static value_ptr value_chill_max_min (enum exp_opcode, value_ptr); -static value_ptr - value_chill_card PARAMS ((value_ptr)); +static value_ptr value_chill_card (value_ptr); -static value_ptr - value_chill_length PARAMS ((value_ptr)); +static value_ptr value_chill_length (value_ptr); -static struct type * - chill_create_fundamental_type PARAMS ((struct objfile *, int)); +static struct type *chill_create_fundamental_type (struct objfile *, int); static void chill_printstr (struct ui_file * stream, char *string, unsigned int length, int width, diff --git a/gdb/ch-lang.h b/gdb/ch-lang.h index 8df180422b7..666f050e28b 100644 --- a/gdb/ch-lang.h +++ b/gdb/ch-lang.h @@ -21,11 +21,9 @@ /* Forward decls for prototypes */ struct value; -extern int -chill_parse PARAMS ((void)); /* Defined in ch-exp.y */ +extern int chill_parse (void); /* Defined in ch-exp.y */ -extern void -chill_error PARAMS ((char *)); /* Defined in ch-exp.y */ +extern void chill_error (char *); /* Defined in ch-exp.y */ /* Defined in ch-typeprint.c */ extern void chill_print_type (struct type *, char *, struct ui_file *, int, @@ -39,4 +37,4 @@ extern int chill_value_print (struct value *, struct ui_file *, int, enum val_prettyprint); extern LONGEST - type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **)); +type_lower_upper (enum exp_opcode, struct type *, struct type **); diff --git a/gdb/cli-out.c b/gdb/cli-out.c index c7abdbeffca..cfe6a21a9a2 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -88,7 +88,7 @@ static struct ui_out_impl cli_ui_out_impl = /* Prototypes for local functions */ -extern void _initialize_cli_out PARAMS ((void)); +extern void _initialize_cli_out (void); static void field_separator (void); diff --git a/gdb/coff-solib.h b/gdb/coff-solib.h index e1a6758ee7e..3b65da8d8a5 100644 --- a/gdb/coff-solib.h +++ b/gdb/coff-solib.h @@ -27,8 +27,7 @@ struct target_ops; #if 0 #define CLEAR_SOLIB coff_clear_solib -extern void -coff_clear_solib PARAMS ((void)); +extern void coff_clear_solib (void); #endif /* Called to add symbols from a shared library to gdb's symbol table. */ @@ -36,8 +35,7 @@ coff_clear_solib PARAMS ((void)); #define SOLIB_ADD(filename, from_tty, targ) \ coff_solib_add (filename, from_tty, targ) -extern void -coff_solib_add PARAMS ((char *, int, struct target_ops *)); +extern void coff_solib_add (char *, int, struct target_ops *); /* Function to be called when the inferior starts up, to discover the names of shared libraries that are dynamically linked, the base addresses to @@ -46,8 +44,7 @@ coff_solib_add PARAMS ((char *, int, struct target_ops *)); #define SOLIB_CREATE_INFERIOR_HOOK(PID) coff_solib_create_inferior_hook() -extern void -coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */ +extern void coff_solib_create_inferior_hook (void); /* solib.c */ /* Function to be called to remove the connection between debugger and dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK. @@ -185,6 +182,5 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */ #if 0 #define DISABLE_UNSETTABLE_BREAK(addr) coff_solib_address(addr) -extern int -solib_address PARAMS ((CORE_ADDR)); /* solib.c */ +extern int solib_address (CORE_ADDR); /* solib.c */ #endif diff --git a/gdb/coffread.c b/gdb/coffread.c index b3c191b7b35..f64fb9cf509 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -43,7 +43,7 @@ #include "complaints.h" #include "target.h" -extern void _initialize_coffread PARAMS ((void)); +extern void _initialize_coffread (void); struct coff_symfile_info { @@ -176,76 +176,78 @@ struct coff_symbol unsigned int c_type; }; -extern void stabsread_clear_cache PARAMS ((void)); +extern void stabsread_clear_cache (void); -static struct type *coff_read_struct_type PARAMS ((int, int, int)); +static struct type *coff_read_struct_type (int, int, int); -static struct type *decode_base_type PARAMS ((struct coff_symbol *, - unsigned int, - union internal_auxent *)); +static struct type *decode_base_type (struct coff_symbol *, + unsigned int, union internal_auxent *); -static struct type *decode_type PARAMS ((struct coff_symbol *, unsigned int, - union internal_auxent *)); +static struct type *decode_type (struct coff_symbol *, unsigned int, + union internal_auxent *); -static struct type *decode_function_type PARAMS ((struct coff_symbol *, - unsigned int, - union internal_auxent *)); +static struct type *decode_function_type (struct coff_symbol *, + unsigned int, + union internal_auxent *); -static struct type *coff_read_enum_type PARAMS ((int, int, int)); +static struct type *coff_read_enum_type (int, int, int); -static struct symbol *process_coff_symbol PARAMS ((struct coff_symbol *, - union internal_auxent *, - struct objfile *)); +static struct symbol *process_coff_symbol (struct coff_symbol *, + union internal_auxent *, + struct objfile *); -static void patch_opaque_types PARAMS ((struct symtab *)); +static void patch_opaque_types (struct symtab *); -static void patch_type PARAMS ((struct type *, struct type *)); +static void patch_type (struct type *, struct type *); -static void enter_linenos PARAMS ((long, int, int, struct objfile *)); +static void enter_linenos (long, int, int, struct objfile *); -static void free_linetab PARAMS ((void)); +static void free_linetab (void); -static int init_lineno PARAMS ((bfd *, long, int)); +static void free_linetab_cleanup (void *ignore); -static char *getsymname PARAMS ((struct internal_syment *)); +static int init_lineno (bfd *, long, int); -static char *coff_getfilename PARAMS ((union internal_auxent *)); +static char *getsymname (struct internal_syment *); -static void free_stringtab PARAMS ((void)); +static char *coff_getfilename (union internal_auxent *); -static int init_stringtab PARAMS ((bfd *, long)); +static void free_stringtab (void); -static void read_one_sym PARAMS ((struct coff_symbol *, - struct internal_syment *, - union internal_auxent *)); +static void free_stringtab_cleanup (void *ignore); -static void coff_symtab_read PARAMS ((long, unsigned int, struct objfile *)); +static int init_stringtab (bfd *, long); -static void find_linenos PARAMS ((bfd *, sec_ptr, PTR)); +static void read_one_sym (struct coff_symbol *, + struct internal_syment *, union internal_auxent *); -static void coff_symfile_init PARAMS ((struct objfile *)); +static void coff_symtab_read (long, unsigned int, struct objfile *); -static void coff_new_init PARAMS ((struct objfile *)); +static void find_linenos (bfd *, sec_ptr, PTR); -static void coff_symfile_read PARAMS ((struct objfile *, int)); +static void coff_symfile_init (struct objfile *); -static void coff_symfile_finish PARAMS ((struct objfile *)); +static void coff_new_init (struct objfile *); -static void record_minimal_symbol PARAMS ((char *, CORE_ADDR, - enum minimal_symbol_type, - struct objfile *)); +static void coff_symfile_read (struct objfile *, int); -static void coff_end_symtab PARAMS ((struct objfile *)); +static void coff_symfile_finish (struct objfile *); -static void complete_symtab PARAMS ((char *, CORE_ADDR, unsigned int)); +static void record_minimal_symbol (char *, CORE_ADDR, + enum minimal_symbol_type, + struct objfile *); -static void coff_start_symtab PARAMS ((char *)); +static void coff_end_symtab (struct objfile *); -static struct type *coff_alloc_type PARAMS ((int)); +static void complete_symtab (char *, CORE_ADDR, unsigned int); -static struct type **coff_lookup_type PARAMS ((int)); +static void coff_start_symtab (char *); -static void coff_locate_sections PARAMS ((bfd *, asection *, PTR)); +static struct type *coff_alloc_type (int); + +static struct type **coff_lookup_type (int); + +static void coff_locate_sections (bfd *, asection *, PTR); /* We are called once per section from coff_symfile_read. We need to examine each section we are passed, check to see @@ -311,7 +313,7 @@ coff_locate_sections (abfd, sectp, csip) } /* Return the section_offsets* that CS points to. */ -static int cs_to_section PARAMS ((struct coff_symbol *, struct objfile *)); +static int cs_to_section (struct coff_symbol *, struct objfile *); struct find_targ_sec_arg { @@ -319,7 +321,7 @@ struct find_targ_sec_arg asection **resultp; }; -static void find_targ_sec PARAMS ((bfd *, asection *, void *)); +static void find_targ_sec (bfd *, asection *, void *); static void find_targ_sec (abfd, sect, obj) @@ -340,7 +342,7 @@ cs_to_section (cs, objfile) { asection *sect = NULL; struct find_targ_sec_arg args; - int off = SECT_OFF_TEXT; + int off = SECT_OFF_TEXT (objfile); args.targ_index = cs->c_secnum; args.resultp = § @@ -349,18 +351,18 @@ cs_to_section (cs, objfile) { /* This is the section. Figure out what SECT_OFF_* code it is. */ if (bfd_get_section_flags (abfd, sect) & SEC_CODE) - off = SECT_OFF_TEXT; + off = SECT_OFF_TEXT (objfile); else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD) - off = SECT_OFF_DATA; + off = SECT_OFF_DATA (objfile); else - off = SECT_OFF_BSS; + off = SECT_OFF_BSS (objfile); } return off; } /* Return the address of the section of a COFF symbol. */ -static CORE_ADDR cs_section_address PARAMS ((struct coff_symbol *, bfd *)); +static CORE_ADDR cs_section_address (struct coff_symbol *, bfd *); static CORE_ADDR cs_section_address (cs, abfd) @@ -638,7 +640,7 @@ coff_symfile_read (objfile, mainline) temp_sym = (char *) xmalloc (cdata->local_symesz + cdata->local_auxesz); temp_aux = temp_sym + cdata->local_symesz; - back_to = make_cleanup ((make_cleanup_func) free_current_contents, &temp_sym); + back_to = make_cleanup (free_current_contents, &temp_sym); /* We need to know whether this is a PE file, because in PE files, unlike standard COFF files, symbol values are stored as offsets @@ -656,7 +658,7 @@ coff_symfile_read (objfile, mainline) info->max_lineno_offset = 0; bfd_map_over_sections (abfd, find_linenos, (PTR) info); - make_cleanup ((make_cleanup_func) free_linetab, 0); + make_cleanup (free_linetab_cleanup, 0 /*ignore*/); val = init_lineno (abfd, info->min_lineno_offset, info->max_lineno_offset - info->min_lineno_offset); if (val < 0) @@ -664,13 +666,13 @@ coff_symfile_read (objfile, mainline) /* Now read the string table, all at once. */ - make_cleanup ((make_cleanup_func) free_stringtab, 0); + make_cleanup (free_stringtab_cleanup, 0 /*ignore*/); val = init_stringtab (abfd, stringtab_offset); if (val < 0) error ("\"%s\": can't get string table", name); init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ @@ -843,7 +845,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF) { /* Record all functions -- external and static -- in minsyms. */ - tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); record_minimal_symbol (cs->c_name, tmpaddr, mst_text, objfile); fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr; @@ -908,7 +910,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) followed by a later file with no symbols. */ if (in_source_file) complete_symtab (filestring, - cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), main_aux.x_scn.x_scnlen); in_source_file = 0; } @@ -969,10 +971,8 @@ coff_symtab_read (symtab_offset, nsyms, objfile) || cs->c_sclass == C_THUMBEXT) tmpaddr += ANOFFSET (objfile->section_offsets, sec); - switch (sec) + if (sec == SECT_OFF_TEXT (objfile)) { - case SECT_OFF_TEXT: - case SECT_OFF_RODATA: ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC || cs->c_sclass == C_THUMBEXT ? @@ -981,21 +981,23 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (tmpaddr & 1) /* FIXME: delete this line */ SMASH_TEXT_ADDRESS (tmpaddr); #endif - break; - case SECT_OFF_DATA: + } + else + if (sec == SECT_OFF_DATA (objfile)) + { ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ? mst_data : mst_file_data; - break; - case SECT_OFF_BSS: + } + else + if (sec == SECT_OFF_BSS (objfile)) + { ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ? mst_data : mst_file_data; - break; - default: - ms_type = mst_unknown; - break; - } + } + else + ms_type = mst_unknown; } if (cs->c_name[0] != '@' /* Skip tdesc symbols */ ) @@ -1099,11 +1101,11 @@ coff_symtab_read (symtab_offset, nsyms, objfile) of the epilogue. */ cs->c_value + FUNCTION_EPILOGUE_SIZE - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), #else fcn_cs_saved.c_value + fcn_aux_saved.x_sym.x_misc.x_fsize - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), #endif objfile ); @@ -1115,7 +1117,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (STREQ (cs->c_name, ".bb")) { tmpaddr = cs->c_value; - tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); push_context (++depth, tmpaddr); } else if (STREQ (cs->c_name, ".eb")) @@ -1135,7 +1137,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (local_symbols && context_stack_depth > 0) { tmpaddr = - cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); /* Make a block for the local symbols within. */ finish_block (0, &local_symbols, new->old_blocks, new->start_addr, tmpaddr, objfile); @@ -1287,6 +1289,12 @@ free_stringtab () stringtab = NULL; } +static void +free_stringtab_cleanup (void *ignore) +{ + free_stringtab (); +} + static char * getsymname (symbol_entry) struct internal_syment *symbol_entry; @@ -1388,6 +1396,12 @@ free_linetab () linetab = NULL; } +static void +free_linetab_cleanup (void *ignore) +{ + free_linetab (); +} + #if !defined (L_LNNO32) #define L_LNNO32(lp) ((lp)->l_lnno) #endif @@ -1427,7 +1441,7 @@ enter_linenos (file_offset, first_line, last_line, objfile) if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line) record_line (current_subfile, first_line + L_LNNO32 (&lptr), lptr.l_addr.l_paddr - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)); + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))); else break; } @@ -1547,7 +1561,7 @@ process_coff_symbol (cs, aux, objfile) if (ISFCN (cs->c_type)) { - SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); SYMBOL_TYPE (sym) = lookup_function_type (decode_function_type (cs, cs->c_type, aux)); @@ -1577,7 +1591,7 @@ process_coff_symbol (cs, aux, objfile) case C_EXT: SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; - SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_symbol_to_list (sym, &global_symbols); break; @@ -1586,7 +1600,7 @@ process_coff_symbol (cs, aux, objfile) case C_STAT: SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; - SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (within_function) { /* Static symbol of local scope */ diff --git a/gdb/command.c b/gdb/command.c index 737ac771222..02ee4745a8c 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -35,31 +35,33 @@ /* Prototypes for local functions */ -static void undef_cmd_error PARAMS ((char *, char *)); +static void undef_cmd_error (char *, char *); -static void show_user PARAMS ((char *, int)); +static void show_user (char *, int); static void show_user_1 (struct cmd_list_element *, struct ui_file *); -static void make_command PARAMS ((char *, int)); +static void make_command (char *, int); -static void shell_escape PARAMS ((char *, int)); +static void shell_escape (char *, int); -static int parse_binary_operation PARAMS ((char *)); +static int parse_binary_operation (char *); static void print_doc_line (struct ui_file *, char *); -static struct cmd_list_element *find_cmd PARAMS ((char *command, - int len, - struct cmd_list_element * clist, - int ignore_help_classes, - int *nfound)); +static struct cmd_list_element *find_cmd (char *command, + int len, + struct cmd_list_element *clist, + int ignore_help_classes, + int *nfound); static void apropos_cmd_helper (struct ui_file *, struct cmd_list_element *, struct re_pattern_buffer *, char *); +static void help_all (struct ui_file *stream); + void apropos_command (char *, int); -void _initialize_command PARAMS ((void)); +void _initialize_command (void); /* Add element named NAME. CLASS is the top level category into which commands are broken down @@ -82,7 +84,7 @@ struct cmd_list_element * add_cmd (name, class, fun, doc, list) char *name; enum command_class class; - void (*fun) PARAMS ((char *, int)); + void (*fun) (char *, int); char *doc; struct cmd_list_element **list; { @@ -166,7 +168,7 @@ struct cmd_list_element * add_abbrev_cmd (name, class, fun, doc, list) char *name; enum command_class class; - void (*fun) PARAMS ((char *, int)); + void (*fun) (char *, int); char *doc; struct cmd_list_element **list; { @@ -220,7 +222,7 @@ add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname, allow_unknown, list) char *name; enum command_class class; - void (*fun) PARAMS ((char *, int)); + void (*fun) (char *, int); char *doc; struct cmd_list_element **prefixlist; char *prefixname; @@ -241,7 +243,7 @@ add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname, allow_unknown, list) char *name; enum command_class class; - void (*fun) PARAMS ((char *, int)); + void (*fun) (char *, int); char *doc; struct cmd_list_element **prefixlist; char *prefixname; @@ -265,7 +267,7 @@ not_just_help_class_command (args, from_tty) } /* This is an empty "sfunc". */ -static void empty_sfunc PARAMS ((char *, int, struct cmd_list_element *)); +static void empty_sfunc (char *, int, struct cmd_list_element *); static void empty_sfunc (args, from_tty, c) @@ -283,13 +285,12 @@ empty_sfunc (args, from_tty, c) DOC is the documentation string. */ struct cmd_list_element * -add_set_cmd (name, class, var_type, var, doc, list) - char *name; - enum command_class class; - var_types var_type; - char *var; - char *doc; - struct cmd_list_element **list; +add_set_cmd (char *name, + enum command_class class, + var_types var_type, + void *var, + char *doc, + struct cmd_list_element **list) { struct cmd_list_element *c = add_cmd (name, class, NO_FUNCTION, doc, list); @@ -312,13 +313,12 @@ add_set_cmd (name, class, var_type, var, doc, list) DOC is the documentation string. */ struct cmd_list_element * -add_set_enum_cmd (name, class, enumlist, var, doc, list) - char *name; - enum command_class class; - char *enumlist[]; - char *var; - char *doc; - struct cmd_list_element **list; +add_set_enum_cmd (char *name, + enum command_class class, + char *enumlist[], + char **var, + char *doc, + struct cmd_list_element **list) { struct cmd_list_element *c = add_set_cmd (name, class, var_enum, var, doc, list); @@ -510,6 +510,12 @@ help_cmd (command, stream) return; } + if (strcmp (command, "all") == 0) + { + help_all (stream); + return; + } + c = lookup_cmd (&command, cmdlist, "", 0, 0); if (c == 0) @@ -602,6 +608,26 @@ Command name abbreviations are allowed if unambiguous.\n", cmdtype1, cmdtype2); } +static void +help_all (struct ui_file *stream) +{ + struct cmd_list_element *c; + extern struct cmd_list_element *cmdlist; + + for (c = cmdlist; c; c = c->next) + { + if (c->abbrev_flag) + continue; + /* If this is a prefix command, print it's subcommands */ + if (c->prefixlist) + help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 0, stream); + + /* If this is a class name, print all of the commands in the class */ + else if (c->function.cfunc == NULL) + help_cmd_list (cmdlist, c->class, "", 0, stream); + } +} + /* Print only the first line of STR on STREAM. */ static void print_doc_line (stream, str) @@ -1695,7 +1721,7 @@ do_setshow_command (arg, from_tty, c) int quote; stb = ui_out_stream_new (uiout); - old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb); + old_chain = make_cleanup_ui_out_stream_delete (stb); #endif /* UI_OUT */ /* Print doc minus "show" at start. */ diff --git a/gdb/command.h b/gdb/command.h index 3b916d41d93..f6c46e96080 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -33,7 +33,7 @@ enum command_class no_class = -1, class_run = 0, class_vars, class_stack, class_files, class_support, class_info, class_breakpoint, class_trace, class_alias, class_obscure, class_user, class_maintenance, - class_pseudo, class_tui, class_xdb, + class_pseudo, class_tui, class_xdb }; /* Not a set/show command. Note that some commands which begin with @@ -108,12 +108,11 @@ struct cmd_list_element union { /* If type is not_set_cmd, call it like this: */ - void (*cfunc) PARAMS ((char *args, int from_tty)); + void (*cfunc) (char *args, int from_tty); /* If type is cmd_set or show_cmd, first set the variables, and then call this. */ - void (*sfunc) PARAMS ((char *args, int from_tty, - struct cmd_list_element * c)); + void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c); } function; #define NO_FUNCTION ((void (*) PARAMS((char *args, int from_tty))) 0) @@ -186,7 +185,7 @@ struct cmd_list_element returned relative to this position. For example, suppose TEXT is "foo" and we want to complete to "foobar". If WORD is "oo", return "oobar"; if WORD is "baz/foo", return "baz/foobar". */ - char **(*completer) PARAMS ((char *text, char *word)); + char **(*completer) (char *text, char *word); /* Type of "set" or "show" command (or SET_NOT_SET if not "set" or "show"). */ @@ -194,7 +193,7 @@ struct cmd_list_element /* Pointer to variable affected by "set" and "show". Doesn't matter if type is not_set. */ - char *var; + void *var; /* What kind of variable is *VAR? */ var_types var_type; @@ -216,31 +215,39 @@ struct cmd_list_element /* Forward-declarations of the entry-points of command.c. */ -extern struct cmd_list_element * - add_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int), - char *, struct cmd_list_element **)); - -extern struct cmd_list_element * - add_alias_cmd PARAMS ((char *, char *, enum command_class, int, - struct cmd_list_element **)); - -extern struct cmd_list_element * - add_prefix_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int), - char *, struct cmd_list_element **, char *, int, - struct cmd_list_element **)); - -extern struct cmd_list_element * - add_abbrev_prefix_cmd PARAMS ((char *, enum command_class, - void (*fun) (char *, int), char *, - struct cmd_list_element **, char *, int, - struct cmd_list_element **)); - -extern struct cmd_list_element * - lookup_cmd PARAMS ((char **, struct cmd_list_element *, char *, int, int)); - -extern struct cmd_list_element * - lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *, - struct cmd_list_element **, int)); +extern struct cmd_list_element *add_cmd (char *, enum command_class, + void (*fun) (char *, int), char *, + struct cmd_list_element **); + +extern struct cmd_list_element *add_alias_cmd (char *, char *, + enum command_class, int, + struct cmd_list_element **); + +extern struct cmd_list_element *add_prefix_cmd (char *, enum command_class, + void (*fun) (char *, int), + char *, + struct cmd_list_element **, + char *, int, + struct cmd_list_element **); + +extern struct cmd_list_element *add_abbrev_prefix_cmd (char *, + enum command_class, + void (*fun) (char *, + int), + char *, + struct cmd_list_element + **, char *, int, + struct cmd_list_element + **); + +extern struct cmd_list_element *lookup_cmd (char **, + struct cmd_list_element *, char *, + int, int); + +extern struct cmd_list_element *lookup_cmd_1 (char **, + struct cmd_list_element *, + struct cmd_list_element **, + int); extern struct cmd_list_element * deprecate_cmd (struct cmd_list_element *, char * ); @@ -254,27 +261,22 @@ extern int struct cmd_list_element **prefix_cmd, struct cmd_list_element **cmd); -extern struct cmd_list_element * - add_com PARAMS ((char *, enum command_class, void (*fun) (char *, int), - char *)); +extern struct cmd_list_element *add_com (char *, enum command_class, + void (*fun) (char *, int), char *); -extern struct cmd_list_element * - add_com_alias PARAMS ((char *, char *, enum command_class, int)); +extern struct cmd_list_element *add_com_alias (char *, char *, + enum command_class, int); -extern struct cmd_list_element * - add_info PARAMS ((char *, void (*fun) (char *, int), char *)); +extern struct cmd_list_element *add_info (char *, void (*fun) (char *, int), + char *); -extern struct cmd_list_element * - add_info_alias PARAMS ((char *, char *, int)); +extern struct cmd_list_element *add_info_alias (char *, char *, int); -extern char ** - complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *)); +extern char **complete_on_cmdlist (struct cmd_list_element *, char *, char *); -extern char ** - complete_on_enum PARAMS ((char **enumlist, char *, char *)); +extern char **complete_on_enum (char **enumlist, char *, char *); -extern void -delete_cmd PARAMS ((char *, struct cmd_list_element **)); +extern void delete_cmd (char *, struct cmd_list_element **); extern void help_cmd (char *, struct ui_file *); @@ -284,42 +286,42 @@ extern void help_list (struct cmd_list_element *, char *, extern void help_cmd_list (struct cmd_list_element *, enum command_class, char *, int, struct ui_file *); -extern struct cmd_list_element * - add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *, - struct cmd_list_element **)); +extern struct cmd_list_element *add_set_cmd (char *name, enum + command_class class, + var_types var_type, void *var, + char *doc, + struct cmd_list_element **list); -extern struct cmd_list_element * - add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[], - char *var, char *doc, struct cmd_list_element ** c)); +extern struct cmd_list_element *add_set_enum_cmd (char *name, + enum command_class class, + char *enumlist[], + char **var, + char *doc, + struct cmd_list_element **list); -extern struct cmd_list_element * - add_show_from_set PARAMS ((struct cmd_list_element *, - struct cmd_list_element **)); +extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *, + struct cmd_list_element + **); /* Do a "set" or "show" command. ARG is NULL if no argument, or the text of the argument, and FROM_TTY is nonzero if this command is being entered directly by the user (i.e. these are just like any other command). C is the command list element for the command. */ -extern void -do_setshow_command PARAMS ((char *, int, struct cmd_list_element *)); +extern void do_setshow_command (char *, int, struct cmd_list_element *); /* Do a "show" command for each thing on a command list. */ -extern void -cmd_show_list PARAMS ((struct cmd_list_element *, int, char *)); +extern void cmd_show_list (struct cmd_list_element *, int, char *); -extern void -error_no_arg PARAMS ((char *)); +extern void error_no_arg (char *); -extern void -dont_repeat PARAMS ((void)); +extern void dont_repeat (void); /* Used to mark commands that don't do anything. If we just leave the function field NULL, the command is interpreted as a help topic, or as a class of commands. */ -extern void -not_just_help_class_command PARAMS ((char *, int)); +extern void not_just_help_class_command (char *, int); #endif /* !defined (COMMAND_H) */ diff --git a/gdb/complaints.c b/gdb/complaints.c index c22d213d602..ee877fbafae 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -22,7 +22,7 @@ #include "complaints.h" #include "gdbcmd.h" -extern void _initialize_complaints PARAMS ((void)); +extern void _initialize_complaints (void); /* Structure to manage complaints about symbol file contents. */ diff --git a/gdb/complaints.h b/gdb/complaints.h index d65b037c3b5..5671730729c 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -44,11 +44,9 @@ extern struct complaint complaint_root[1]; /* Functions that handle complaints. (in complaints.c) */ -extern void -complain PARAMS ((struct complaint *,...)); +extern void complain (struct complaint *, ...); -extern void -clear_complaints PARAMS ((int, int)); +extern void clear_complaints (int, int); #endif /* !defined (COMPLAINTS_H) */ diff --git a/gdb/config.in b/gdb/config.in index ea43988390f..faf5cd4d10d 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -62,6 +62,15 @@ /* Define if compiling on Solaris 7. */ #undef _MSE_INT_H +/* Define if your struct reg has r_fs. */ +#undef HAVE_STRUCT_REG_R_FS + +/* Define if your struct reg has r_gs. */ +#undef HAVE_STRUCT_REG_R_GS + +/* Define if the prfpregset_t type is broken. */ +#undef PRFPREGSET_T_BROKEN + /* Define if you want to use new multi-fd /proc interface (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */ #undef NEW_PROC_API @@ -100,9 +109,6 @@ to explicitly deallocate that memory when gdb calls exit. */ #undef MMCHECK_FORCE -/* Define if you want to use the full-screen terminal user interface. */ -#undef TUI - /* Define if on solaris uses int instead of size_t, and assorted other type changes. */ #undef PROC_SERVICE_IS_OLD @@ -126,6 +132,9 @@ /* Define if defines the PTRACE_GETXFPREGS request. */ #undef HAVE_PTRACE_GETXFPREGS +/* Define if gnu-regex.c included with GDB should be used. */ +#undef USE_INCLUDED_REGEX + /* Define if you have the __argz_count function. */ #undef HAVE___ARGZ_COUNT @@ -207,6 +216,9 @@ /* Define if you have the header file. */ #undef HAVE_CURSES_H +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + /* Define if you have the header file. */ #undef HAVE_ENDIAN_H @@ -225,6 +237,12 @@ /* Define if you have the header file. */ #undef HAVE_MEMORY_H +/* Define if you have the header file. */ +#undef HAVE_NCURSES_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + /* Define if you have the header file. */ #undef HAVE_NL_TYPES_H @@ -255,9 +273,15 @@ /* Define if you have the header file. */ #undef HAVE_SYS_DEBUGREG_H +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H @@ -273,6 +297,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_SELECT_H +/* Define if you have the header file. */ +#undef HAVE_SYS_USER_H + /* Define if you have the header file. */ #undef HAVE_SYS_WAIT_H diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h index 25a5bea74d0..eef74f35088 100644 --- a/gdb/config/a29k/tm-a29k.h +++ b/gdb/config/a29k/tm-a29k.h @@ -31,7 +31,7 @@ #define TARGET_BYTE_ORDER BIG_ENDIAN /* Floating point uses IEEE representations. */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Recognize our magic number. */ #define BADMAG(x) ((x).f_magic != 0572) @@ -508,7 +508,9 @@ extern CORE_ADDR frame_locals_address (); because registers get renumbered on the a29k without getting saved. */ struct frame_info; -void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lvalp)); +void a29k_get_saved_register (char *raw_buffer, int *optimized, + CORE_ADDR * addrp, struct frame_info *frame, + int regnum, enum lval_type *lvalp); #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) @@ -713,4 +715,4 @@ processor_type; "frame" or "info frame" command. */ #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) -extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); +extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); diff --git a/gdb/config/a29k/tm-vx29k.h b/gdb/config/a29k/tm-vx29k.h index 5d9866f349e..02b2703cc09 100644 --- a/gdb/config/a29k/tm-vx29k.h +++ b/gdb/config/a29k/tm-vx29k.h @@ -177,7 +177,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* VxWorks adjusts the PC after a breakpoint has been hit. */ @@ -207,7 +207,7 @@ extern int get_longjmp_target PARAMS ((CORE_ADDR *)); val = value_cast (builtin_type_int, val); \ } while (0) -extern int vx29k_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int vx29k_frame_chain_valid (CORE_ADDR, struct frame_info *); #define FRAME_CHAIN_VALID(chain, thisframe) vx29k_frame_chain_valid (chain, thisframe) extern CORE_ADDR frame_saved_call_site (); diff --git a/gdb/config/alpha/alpha-osf3.mh b/gdb/config/alpha/alpha-osf3.mh index 6de8bca8e3a..61594a772b4 100644 --- a/gdb/config/alpha/alpha-osf3.mh +++ b/gdb/config/alpha/alpha-osf3.mh @@ -1,5 +1,5 @@ # Host: Little-endian Alpha running OSF/1-3.x and higher using procfs -XDEPFILES= +XDEPFILES= ser-tcp.o ser-pipe.o XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf3.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ diff --git a/gdb/config/alpha/fbsd.mh b/gdb/config/alpha/fbsd.mh new file mode 100644 index 00000000000..9c2b5e580d2 --- /dev/null +++ b/gdb/config/alpha/fbsd.mh @@ -0,0 +1,6 @@ +# Host: FreeBSD/Alpha +XDEPFILES= ser-tcp.o +NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o \ + corelow.o core-regset.o alphabsd-nat.o +XM_FILE= xm-fbsd.h +NAT_FILE= nm-fbsd.h diff --git a/gdb/config/alpha/fbsd.mt b/gdb/config/alpha/fbsd.mt new file mode 100644 index 00000000000..6d33977c07a --- /dev/null +++ b/gdb/config/alpha/fbsd.mt @@ -0,0 +1,3 @@ +# Target: FreeBSD/Alpha +TDEPFILES= alpha-tdep.o +TM_FILE= tm-fbsd.h diff --git a/gdb/config/alpha/nm-fbsd.h b/gdb/config/alpha/nm-fbsd.h new file mode 100644 index 00000000000..59321b999b0 --- /dev/null +++ b/gdb/config/alpha/nm-fbsd.h @@ -0,0 +1,44 @@ +/* Native-dependent definitions for FreeBSD/Alpha. + Copyright (C) 1986, 87, 89, 92, 96, 2000 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 NM_FBSD_H +#define NM_FBSD_H + +/* Type of the third argument to the `ptrace' system call. */ +#define PTRACE_ARG3_TYPE caddr_t + +/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ +#define FETCH_INFERIOR_REGISTERS + +/* We can attach and detach. */ +#define ATTACH_DETACH + +/* The Alpha does not step over a breakpoint. */ +#define CANNOT_STEP_BREAKPOINT + + +/* Shared library support. */ + +#define SVR4_SHARED_LIBS + +#include "solib.h" /* Support for shared libraries. */ +#include "elf/common.h" /* Additional ELF shared library info. */ + +#endif /* NM_FBSD_H */ diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h index 979b8174d33..062d4ff8d86 100644 --- a/gdb/config/alpha/nm-linux.h +++ b/gdb/config/alpha/nm-linux.h @@ -30,8 +30,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* ptrace register ``addresses'' are absolute. */ diff --git a/gdb/config/alpha/nm-osf.h b/gdb/config/alpha/nm-osf.h index df0030a2761..f102fbd645d 100644 --- a/gdb/config/alpha/nm-osf.h +++ b/gdb/config/alpha/nm-osf.h @@ -25,8 +25,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* ptrace register ``addresses'' are absolute. */ diff --git a/gdb/config/alpha/nm-osf2.h b/gdb/config/alpha/nm-osf2.h index dfbff819681..3d9105f1e31 100644 --- a/gdb/config/alpha/nm-osf2.h +++ b/gdb/config/alpha/nm-osf2.h @@ -45,7 +45,7 @@ /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); /* poll() doesn't seem to work properly for /proc in this version of the OS. If we only specify POLLPRI, things hang. It seems to get better when we set diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h index d63dcc1296d..2b3e5ac6b6f 100644 --- a/gdb/config/alpha/tm-alpha.h +++ b/gdb/config/alpha/tm-alpha.h @@ -42,7 +42,7 @@ struct symbol; #define TARGET_PTR_BIT 64 /* Floating point is IEEE compliant */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Number of traps that happen between exec'ing the shell * to run an inferior, and when we finally get to @@ -59,7 +59,7 @@ struct symbol; to reach some "real" code. */ #define SKIP_PROLOGUE(pc) (alpha_skip_prologue(pc, 0)) -extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); +extern CORE_ADDR alpha_skip_prologue (CORE_ADDR addr, int lenient); /* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines @@ -67,8 +67,7 @@ extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); some instructions. */ #define SAVED_PC_AFTER_CALL(frame) alpha_saved_pc_after_call(frame) -extern CORE_ADDR - alpha_saved_pc_after_call PARAMS ((struct frame_info *)); +extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *); /* Are we currently handling a signal ? */ @@ -184,7 +183,7 @@ extern CORE_ADDR #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM, TYPE, FROM, TO) \ alpha_register_convert_to_virtual (REGNUM, TYPE, FROM, TO) extern void -alpha_register_convert_to_virtual PARAMS ((int, struct type *, char *, char *)); +alpha_register_convert_to_virtual (int, struct type *, char *, char *); /* Convert data from virtual format with type TYPE in buffer FROM to raw format for register REGNUM in buffer TO. */ @@ -192,7 +191,7 @@ alpha_register_convert_to_virtual PARAMS ((int, struct type *, char *, char *)); #define REGISTER_CONVERT_TO_RAW(TYPE, REGNUM, FROM, TO) \ alpha_register_convert_to_raw (TYPE, REGNUM, FROM, TO) extern void -alpha_register_convert_to_raw PARAMS ((struct type *, int, char *, char *)); +alpha_register_convert_to_raw (struct type *, int, char *, char *); /* Return the GDB type object for the "standard" data type of data in register N. */ @@ -213,16 +212,14 @@ alpha_register_convert_to_raw PARAMS ((struct type *, int, char *, char *)); #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ alpha_extract_return_value(TYPE, REGBUF, VALBUF) -extern void -alpha_extract_return_value PARAMS ((struct type *, char *, char *)); +extern void alpha_extract_return_value (struct type *, char *, char *); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ #define STORE_RETURN_VALUE(TYPE,VALBUF) \ alpha_store_return_value(TYPE, VALBUF) -extern void -alpha_store_return_value PARAMS ((struct type *, char *)); +extern void alpha_store_return_value (struct type *, char *); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, @@ -247,7 +244,7 @@ alpha_store_return_value PARAMS ((struct type *, char *)); and produces the frame's chain-pointer. */ #define FRAME_CHAIN(thisframe) (CORE_ADDR) alpha_frame_chain (thisframe) -extern CORE_ADDR alpha_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR alpha_frame_chain (struct frame_info *); /* Define other aspects of the stack frame. */ @@ -261,8 +258,7 @@ extern CORE_ADDR alpha_frame_chain PARAMS ((struct frame_info *)); /* Saved Pc. */ #define FRAME_SAVED_PC(FRAME) (alpha_frame_saved_pc(FRAME)) -extern CORE_ADDR - alpha_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *); /* The alpha has two different virtual pointers for arguments and locals. @@ -298,7 +294,7 @@ extern CORE_ADDR ways in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -extern void alpha_find_saved_regs PARAMS ((struct frame_info *)); +extern void alpha_find_saved_regs (struct frame_info *); #define FRAME_INIT_SAVED_REGS(frame_info) \ do { \ @@ -313,19 +309,17 @@ extern void alpha_find_saved_regs PARAMS ((struct frame_info *)); #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) extern CORE_ADDR - alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); +alpha_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); /* Push an empty stack frame, to record the current PC, etc. */ #define PUSH_DUMMY_FRAME alpha_push_dummy_frame() -extern void -alpha_push_dummy_frame PARAMS ((void)); +extern void alpha_push_dummy_frame (void); /* Discard from the stack the innermost frame, restoring all registers. */ #define POP_FRAME alpha_pop_frame() -extern void -alpha_pop_frame PARAMS ((void)); +extern void alpha_pop_frame (void); /* Alpha OSF/1 inhibits execution of code on the stack. But there is no need for a dummy on the alpha. PUSH_ARGUMENTS @@ -346,7 +340,7 @@ alpha_pop_frame PARAMS ((void)); #define CALL_DUMMY_BREAKPOINT_OFFSET (0) -extern CORE_ADDR alpha_call_dummy_address PARAMS ((void)); +extern CORE_ADDR alpha_call_dummy_address (void); #define CALL_DUMMY_ADDRESS() alpha_call_dummy_address() /* Insert the specified number of args and function address @@ -376,7 +370,7 @@ extern CORE_ADDR alpha_call_dummy_address PARAMS ((void)); alpha_extra_func_info_t's off of this. */ #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__" -extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR)); +extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR); /* Specific information about a procedure. This overlays the ALPHA's PDR records, @@ -402,8 +396,7 @@ typedef struct alpha_extra_func_info alpha_extra_func_info_t proc_desc; #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) -extern void -init_extra_frame_info PARAMS ((struct frame_info *)); +extern void init_extra_frame_info (struct frame_info *); #define PRINT_EXTRA_FRAME_INFO(fi) \ { \ @@ -424,7 +417,7 @@ init_extra_frame_info PARAMS ((struct frame_info *)); multiple functions with the same SP that are at different stack levels. */ #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) -extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); +extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); /* This is used by heuristic_proc_start. It should be shot it the head. */ #ifndef VM_MIN_ADDRESS @@ -476,6 +469,7 @@ extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); #define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) \ (alpha_osf_skip_sigtramp_frame (frame, pc)) -extern CORE_ADDR alpha_osf_skip_sigtramp_frame PARAMS ((struct frame_info *, CORE_ADDR)); +extern CORE_ADDR alpha_osf_skip_sigtramp_frame (struct frame_info *, + CORE_ADDR); #endif /* TM_ALPHA_H */ diff --git a/gdb/config/alpha/tm-alphalinux.h b/gdb/config/alpha/tm-alphalinux.h index a2a993e0720..833dbf9b632 100644 --- a/gdb/config/alpha/tm-alphalinux.h +++ b/gdb/config/alpha/tm-alphalinux.h @@ -26,7 +26,7 @@ /* Are we currently handling a signal ? */ -extern long alpha_linux_sigtramp_offset PARAMS ((CORE_ADDR)); +extern long alpha_linux_sigtramp_offset (CORE_ADDR); #undef IN_SIGTRAMP #define IN_SIGTRAMP(pc, name) (alpha_linux_sigtramp_offset (pc) >= 0) diff --git a/gdb/config/alpha/tm-fbsd.h b/gdb/config/alpha/tm-fbsd.h new file mode 100644 index 00000000000..73086e463ec --- /dev/null +++ b/gdb/config/alpha/tm-fbsd.h @@ -0,0 +1,32 @@ +/* Target-dependent definitions for FreeBSD/Alpha. + Copyright (C) 2000 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 TM_FBSD_H +#define TM_FBSD_H + +#include "alpha/tm-alpha.h" + +/* Number of traps that happen between exec'ing the shell to run an + inferior, and when we finally get to the inferior code. The + default is right for FreeBSD. */ + +#undef START_INFERIOR_TRAPS_EXPECTED + +#endif /* TM_FBSD_H */ diff --git a/gdb/config/alpha/xm-fbsd.h b/gdb/config/alpha/xm-fbsd.h new file mode 100644 index 00000000000..f519512f822 --- /dev/null +++ b/gdb/config/alpha/xm-fbsd.h @@ -0,0 +1,26 @@ +/* Host-dependent definitions for FreeBSD/i386. + Copyright (C) 2000 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 XM_FBSD_H +#define XM_FBSD_H + +#define HOST_BYTE_ORDER LITTLE_ENDIAN + +#endif /* XM_FBSD_H */ diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h index 34fabaf4f3a..0eb4e756952 100644 --- a/gdb/config/arc/tm-arc.h +++ b/gdb/config/arc/tm-arc.h @@ -26,7 +26,7 @@ #define TARGET_BYTE_ORDER_SELECTABLE /* We have IEEE floating point, if we have any float at all. */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ @@ -40,7 +40,7 @@ #define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0)) #define SKIP_PROLOGUE_FRAMELESS_P(pc) (arc_skip_prologue (pc, 1)) -extern CORE_ADDR arc_skip_prologue PARAMS ((CORE_ADDR, int)); +extern CORE_ADDR arc_skip_prologue (CORE_ADDR, int); /* Sequence of bytes for breakpoint instruction. ??? The current value is "sr -1,[-1]" and is for the simulator only. @@ -62,7 +62,7 @@ extern CORE_ADDR arc_skip_prologue PARAMS ((CORE_ADDR, int)); /* We don't have a reliable single step facility. ??? We do have a cycle single step facility, but that won't work. */ #define SOFTWARE_SINGLE_STEP_P 1 -extern void arc_software_single_step PARAMS ((unsigned int, int)); +extern void arc_software_single_step (unsigned int, int); #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p) /* FIXME: Need to set STEP_SKIPS_DELAY. */ @@ -277,7 +277,7 @@ extern void arc_software_single_step PARAMS ((unsigned int, int)); #define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame)) struct frame_info; /* in case frame.h not included yet */ -CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *)); +CORE_ADDR arc_frame_saved_pc (struct frame_info *); /* If the argument is on the stack, it will be here. We cache this value in the frame info if we've already looked it up. */ diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh index 46eaecebdb9..98e0e93a0e4 100644 --- a/gdb/config/arm/linux.mh +++ b/gdb/config/arm/linux.mh @@ -5,4 +5,7 @@ XDEPFILES= ser-tcp.o NAT_FILE= nm-linux.h NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \ - core-aout.o arm-linux-nat.o + core-regset.o arm-linux-nat.o linux-thread.o lin-thread.o + +LOADLIBES= -ldl -rdynamic + diff --git a/gdb/config/arm/nm-linux.h b/gdb/config/arm/nm-linux.h index 125d72f67ff..fd459fc5a92 100644 --- a/gdb/config/arm/nm-linux.h +++ b/gdb/config/arm/nm-linux.h @@ -21,6 +21,8 @@ #ifndef NM_ARMLINUX_H #define NM_ARMLINUX_H +#include "nm-linux.h" + /* Return sizeof user struct to callers in less machine dependent routines */ extern int kernel_u_size (void); #define KERNEL_U_SIZE arm_linux_kernel_u_size() @@ -28,19 +30,4 @@ extern int kernel_u_size (void); /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ #define FETCH_INFERIOR_REGISTERS -/* Tell gdb that we can attach and detach other processes. */ -#define ATTACH_DETACH - -extern int arm_register_u_addr (int, int); -#define REGISTER_U_ADDR(addr, blockend, regno) \ - { (addr) = arm_linux_register_u_addr((blockend), (regno)); } - -/* We define this if link.h is available, because with ELF we use SVR4 style - shared libraries. */ - -#ifdef HAVE_LINK_H -#define SVR4_SHARED_LIBS -#include "solib.h" /* Support for shared libraries. */ -#endif - #endif /* NM_ARMLINUX_H */ diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index e64b77633dd..ed8e80c7d58 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -31,7 +31,7 @@ struct value; #define TARGET_BYTE_ORDER_DEFAULT LITTLE_ENDIAN /* IEEE format floating point. */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) #define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \ ? &floatformat_ieee_double_big \ : &floatformat_ieee_double_littlebyte_bigword) diff --git a/gdb/config/arm/tm-embed.h b/gdb/config/arm/tm-embed.h index 5e9375c6f9a..c2a856b758c 100644 --- a/gdb/config/arm/tm-embed.h +++ b/gdb/config/arm/tm-embed.h @@ -50,15 +50,15 @@ /* Functions for dealing with Thumb call thunks. */ #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) arm_in_call_stub (pc, name) #define SKIP_TRAMPOLINE_CODE(pc) arm_skip_stub (pc) -extern int arm_in_call_stub PARAMS ((CORE_ADDR pc, char *name)); -extern CORE_ADDR arm_skip_stub PARAMS ((CORE_ADDR pc)); +extern int arm_in_call_stub (CORE_ADDR pc, char *name); +extern CORE_ADDR arm_skip_stub (CORE_ADDR pc); /* Function to determine whether MEMADDR is in a Thumb function. */ -extern int arm_pc_is_thumb PARAMS ((bfd_vma memaddr)); +extern int arm_pc_is_thumb (bfd_vma memaddr); /* Function to determine whether MEMADDR is in a call dummy called from a Thumb function. */ -extern int arm_pc_is_thumb_dummy PARAMS ((bfd_vma memaddr)); +extern int arm_pc_is_thumb_dummy (bfd_vma memaddr); #undef IN_SIGTRAMP diff --git a/gdb/config/arm/tm-linux.h b/gdb/config/arm/tm-linux.h index af2e809d752..9dcd6668450 100644 --- a/gdb/config/arm/tm-linux.h +++ b/gdb/config/arm/tm-linux.h @@ -118,8 +118,8 @@ extern CORE_ADDR find_solib_trampoline_target (CORE_ADDR pc); need to skip over the dynamic linker call. This function decides when to skip, and where to skip to. See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c. */ -extern CORE_ADDR arm_skip_solib_resolver (CORE_ADDR pc); -#define SKIP_SOLIB_RESOLVER arm_skip_solib_resolver +extern CORE_ADDR arm_linux_skip_solib_resolver (CORE_ADDR pc); +#define SKIP_SOLIB_RESOLVER arm_linux_skip_solib_resolver /* When we call a function in a shared library, and the PLT sends us into the dynamic linker to find the function's real address, we diff --git a/gdb/config/convex/tm-convex.h b/gdb/config/convex/tm-convex.h index f41b72695b2..884719f411f 100644 Binary files a/gdb/config/convex/tm-convex.h and b/gdb/config/convex/tm-convex.h differ diff --git a/gdb/config/d10v/tm-d10v.h b/gdb/config/d10v/tm-d10v.h index a0eb3dcf3e1..44c8c7cd544 100644 --- a/gdb/config/d10v/tm-d10v.h +++ b/gdb/config/d10v/tm-d10v.h @@ -25,7 +25,4 @@ extern int d10v_register_sim_regno (int reg); #define REGISTER_SIM_REGNO(NR) d10v_register_sim_regno((NR)) -extern CORE_ADDR d10v_stack_align (CORE_ADDR size); -#define STACK_ALIGN(SIZE) (d10v_stack_align (SIZE)) - #define NO_EXTRA_ALIGNMENT_NEEDED 1 diff --git a/gdb/config/d30v/tm-d30v.h b/gdb/config/d30v/tm-d30v.h index ac7940fc01b..e0cb8769393 100644 --- a/gdb/config/d30v/tm-d30v.h +++ b/gdb/config/d30v/tm-d30v.h @@ -46,7 +46,7 @@ struct value; /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR d30v_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(ip) (d30v_skip_prologue (ip)) @@ -165,7 +165,7 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR)); #define CANNOT_STORE_REGISTER(regno) ((regno) == R0_REGNUM) -void d30v_do_registers_info PARAMS ((int regnum, int fpregs)); +void d30v_do_registers_info (int regnum, int fpregs); #define DO_REGISTERS_INFO d30v_do_registers_info @@ -206,7 +206,7 @@ void d30v_do_registers_info PARAMS ((int regnum, int fpregs)); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ d30v_init_extra_frame_info(fromleaf, fi) -extern void d30v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info * fi)); +extern void d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi); /* 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 @@ -217,7 +217,7 @@ extern void d30v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info CORE_ADDR d30v_frame_chain (struct frame_info *frame); #define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME) -extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int d30v_frame_chain_valid (CORE_ADDR, struct frame_info *); #define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe) #define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc) #define FRAME_ARGS_ADDRESS(fi) (fi)->frame @@ -253,7 +253,8 @@ void d30v_init_frame_pc (int fromleaf, struct frame_info *prev); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ d30v_frame_find_saved_regs(frame_info, &(frame_saved_regs)) -extern void d30v_frame_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *)); +extern void d30v_frame_find_saved_regs (struct frame_info *, + struct frame_saved_regs *); /* DUMMY FRAMES. Need these to support inferior function calls. They work like this on D30V: @@ -271,7 +272,7 @@ extern void d30v_frame_find_saved_regs PARAMS ((struct frame_info *, struct fram #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #define CALL_DUMMY_BREAKPOINT_OFFSET (0) -extern CORE_ADDR d30v_call_dummy_address PARAMS ((void)); +extern CORE_ADDR d30v_call_dummy_address (void); #define CALL_DUMMY_ADDRESS() d30v_call_dummy_address() #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ @@ -279,12 +280,13 @@ sp = d30v_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p) #define PC_IN_CALL_DUMMY(pc, sp, frame_address) ( pc == IMEM_START + 4 ) -extern CORE_ADDR d30v_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, - int, struct value **, - struct type *, int)); +extern CORE_ADDR d30v_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, + int, struct value **, + struct type *, int); #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) -extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); +extern CORE_ADDR d30v_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); /* Extract from an array REGBUF containing the (raw) register state @@ -293,14 +295,13 @@ extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, i #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ d30v_extract_return_value(TYPE, REGBUF, VALBUF) -extern void -d30v_extract_return_value PARAMS ((struct type *, char *, char *)); +extern void d30v_extract_return_value (struct type *, char *, char *); /* Discard from the stack the innermost frame, restoring all saved registers. */ #define POP_FRAME d30v_pop_frame(); -extern void d30v_pop_frame PARAMS ((void)); +extern void d30v_pop_frame (void); #define REGISTER_SIZE 4 diff --git a/gdb/config/djgpp/README b/gdb/config/djgpp/README index cced23473df..326cfe2a520 100644 --- a/gdb/config/djgpp/README +++ b/gdb/config/djgpp/README @@ -65,21 +65,33 @@ use unzip32.exe available with the rest of DJGPP), and proceed to the section "How to build" below. Source distributions downloaded from one of the GNU FTP sites need -some more work to unpack. First, you MUST use the `djtar' program to -unzip the package. That's because some file names in the official -distributions need to be changed to avoid problems on the various -platforms supported by DJGPP. `djtar' can rename files on the fly -given a file with name mappings; the distribution includes a file -`gdb/config/djgpp/fnchange.lst' with the necessary mappings. So you -need first to retrieve that file, and then invoke `djtar' to unpack -the distribution. Here's how: +some more work to unpack. First, you MUST use the `djunpack' batch +file to unzip the package. That's because some file names in the +official distributions need to be changed to avoid problems on the +various platforms supported by DJGPP. `djunpack' invokes the `djtar' +program (that is part of the basic DJGPP development kit) to rename +these files on the fly given a file with name mappings; the +distribution includes a file `gdb/config/djgpp/fnchange.lst' with the +necessary mappings. So you need first to retrieve that batch file, +and then invoke it to unpack the distribution. Here's how: + djtar -x -p -o gdb-5.0/djunpack.bat gdb-5.0.tar.gz > djunpack.bat + djunpack gdb-5.0.tar.gz - djtar -x -p -o gdb-5.0/gdb/config/djgpp/fnchange.lst gdb-5.0.tar.gz > lst - djtar -x -n lst gdb-5.0.tar.gz +(The name of the distribution archive and the leading directory of the +path to `djunpack.bat' in the distribution will be different for +versions of GDB other than 5.0.) -(The name of the distribution archive and the top-level directory will -be different for versions other than 5.0.) +If the argument to `djunpack.bat' include leading directories, it MUST +be given with the DOS-style backslashes; Unix-style forward slashes +will NOT work. + +If the distribution comes as a .tar.bz2 archive, you need to unpack it +as follows: + + bnzip2 gdb-5.0.tar.bz2 + djtar -x -p -o gdb-5.0/djunpack.bat gdb-5.0.tar > djunpack.bat + djunpack gdb-5.0.tar 3. How to build @@ -128,14 +140,19 @@ After the configure script finishes, run Make: make +If you want to produce the documentation (for example, if you changed +some of the Texinfo sources), type this: + + make info + When Make finishes, you can install the package: - make install INSTALL='/dev/env/DJDIR/bin/ginstall -c' + make -k install prefix='${DJDIR}' INSTALL='ginstall -c' The above doesn't install the docs; for that you will need to say this: - make -k install-info INSTALL='/dev/env/DJDIR/bin/ginstall -c' + make -k install-info prefix='${DJDIR}' INSTALL='ginstall -c' (The -k switch is required, because some unneeded targets that are part of the install process fail; -k lets Make run to completion @@ -151,16 +168,18 @@ script gdb/config/djgpp/djcheck.sh, like this: cd gdb/testsuite sh ../config/djgpp/djcheck.sh -This will run for a while and should not print anything. Any test -that fails to produce the expected output will cause the diffs between -the expected and the actual output be printed, and in addition will -leave behind a file SOMETHING.tst (where SOMETHING is the name of one -of the tests). You should compare each of the *.tst files with the -corresponding *.out file and convince yourself that the differences do -not indicate a real problem. Examples of differences you can -disregard are changes in the copyright blurb printed by GDB, values of -unitialized variables, addresses of global variables like argv[] and -envp[] (which depend on the size of your environment), etc. +This will run for a while and should not print anything, except the +messages "Running tests in DIR", where DIR is one of the +subdirectories of the testsuite. Any test that fails to produce the +expected output will cause the diffs between the expected and the +actual output be printed, and in addition will leave behind a file +SOMETHING.tst (where SOMETHING is the name of the failed test). You +should compare each of the *.tst files with the corresponding *.out +file and convince yourself that the differences do not indicate a real +problem. Examples of differences you can disregard are changes in the +copyright blurb printed by GDB, values of unitialized variables, +addresses of global variables like argv[] and envp[] (which depend on +the size of your environment), etc. Note that djcheck.sh only recurses into those of the subdirectories of the test suite which test features supported by the DJGPP port of GDB. diff --git a/gdb/config/djgpp/config.sed b/gdb/config/djgpp/config.sed index e048cae287e..c53dc026a47 100644 --- a/gdb/config/djgpp/config.sed +++ b/gdb/config/djgpp/config.sed @@ -6,12 +6,13 @@ s|\.gdbinit|gdb.ini|g /ac_given_INSTALL=/,/^CEOF/ { /^s%@prefix@%/a\ s,\\([yp*]\\)\\.tab,\\1_tab,g\ - /^ @rm -f/s,\\$@-\\[0-9\\]\\[0-9\\],&$*.i[1-9] $*[1-9][0-9],\ + /^ @rm -f/s,\\$@-\\[0-9\\]\\[0-9\\],& *.i[1-9] *.i[1-9][0-9],\ s,\\.info\\*,.inf* *.i[1-9] *.i[1-9][0-9],\ s,\\.gdbinit,gdb.ini,g\ /TEXINPUTS=/s,:,';',g\ /VPATH *=/s,:,;,g\ /\\$\\$file-\\[0-9\\]/s,echo,& *.i[1-9] *.i[1-9][0-9],\ + /\\$\\$file-\\[0-9\\]/s,rm -f \\$\\$file,& \\${PACKAGE}.i[1-9] \\${PACKAGE}.i[1-9][0-9],\ s,config\\.h\\.in,config.h-in,g\ s,po2tbl\\.sed\\.in,po2tblsed.in,g } diff --git a/gdb/config/djgpp/djconfig.sh b/gdb/config/djgpp/djconfig.sh index 0c6e8ea007a..32ef352bb3e 100644 --- a/gdb/config/djgpp/djconfig.sh +++ b/gdb/config/djgpp/djconfig.sh @@ -120,7 +120,8 @@ fi # since it relies on file names which will never work on DOS. echo "Running the configure script..." $srcdir/configure --srcdir="$srcdir" --prefix='${DJDIR}' \ - --disable-shared --disable-nls --verbose $* + --disable-shared --disable-nls --verbose --enable-build-warnings=\ +-Wimplicit,-Wcomment,-Wformat,-Wparentheses,-Wpointer-arith $* if test -f ${srcdir}/install- ; then mv ${srcdir}/install- ${srcdir}/install-.sh diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index 58521a604d3..582142bbcac 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -1,179 +1,183 @@ -gdb-0222/gdb/ChangeLog-3.x gdb-0222/gdb/ChangeLog.3-x -gdb-0222/gdb/ChangeLog-9091 gdb-0222/gdb/ChangeLog.9091 -gdb-0222/gdb/ChangeLog-92 gdb-0222/gdb/ChangeLog.92 -gdb-0222/gdb/ChangeLog-93 gdb-0222/gdb/ChangeLog.93 -gdb-0222/gdb/ChangeLog-94 gdb-0222/gdb/ChangeLog.94 -gdb-0222/gdb/ChangeLog-95 gdb-0222/gdb/ChangeLog.95 -gdb-0222/gdb/ChangeLog-96 gdb-0222/gdb/ChangeLog.96 -gdb-0222/gdb/ChangeLog-97 gdb-0222/gdb/ChangeLog.97 -gdb-0222/gdb/ChangeLog-98 gdb-0222/gdb/ChangeLog.98 -gdb-0222/gdb/ChangeLog-99 gdb-0222/gdb/ChangeLog.99 -gdb-0222/gdb/ppc-linux-tdep.c gdb-0222/gdb/ppc-linx-tdep.c -gdb-0222/gdb/remote-adapt.c gdb-0222/gdb/rmt-adapt.c -gdb-0222/gdb/remote-array.c gdb-0222/gdb/rmt-array.c -gdb-0222/gdb/remote-e7000.c gdb-0222/gdb/rmt-e7000.c -gdb-0222/gdb/remote-eb.c gdb-0222/gdb/rmt-eb.c -gdb-0222/gdb/remote-es.c gdb-0222/gdb/rmt-es.c -gdb-0222/gdb/remote-est.c gdb-0222/gdb/rmt-est.c -gdb-0222/gdb/remote-mips.c gdb-0222/gdb/emt-mips.c -gdb-0222/gdb/remote-mm.c gdb-0222/gdb/emt-mm.c -gdb-0222/gdb/remote-nindy.c gdb-0222/gdb/rmt-nindy.c -gdb-0222/gdb/remote-nrom.c gdb-0222/gdb/rmt-nrom.c -gdb-0222/gdb/remote-rdi.c gdb-0222/gdb/rmt-rdi.c -gdb-0222/gdb/remote-rdp.c gdb-0222/gdb/rmt-rdp.c -gdb-0222/gdb/remote-sds.c gdb-0222/gdb/rmt-sds.c -gdb-0222/gdb/remote-sim.c gdb-0222/gdb/rmt-sim.c -gdb-0222/gdb/remote-st.c gdb-0222/gdb/rmt-st.c -gdb-0222/gdb/remote-udi.c gdb-0222/gdb/rmt-udi.c -gdb-0222/gdb/remote-vx.c gdb-0222/gdb/rmt-vx.c -gdb-0222/gdb/remote-vx29k.c gdb-0222/gdb/rmt-vx29k.c -gdb-0222/gdb/remote-vx68.c gdb-0222/gdb/rmt-vx68.c -gdb-0222/gdb/remote-vx960.c gdb-0222/gdb/rmt-vx960.c -gdb-0222/gdb/remote-vxmips.c gdb-0222/gdb/rmt-vxmips.c -gdb-0222/gdb/remote-vxsparc.c gdb-0222/gdb/rmt-vxsparc.c -gdb-0222/gdb/sparclet-rom.c gdb-0222/gdb/splet-rom.c -gdb-0222/gdb/sparclet-stub.c gdb-0222/gdb/splet-stub.c -gdb-0222/gdb/i386-linux-tdep.c gdb-0222/gdb/i386linux-tdep.c -gdb-0222/gdb/arm-linux-tdep.c gdb-0222/gdb/armlin-tdep.c -gdb-0222/gdb/arm-linux-nat.c gdb-0222/gdb/armlin-nat.c -gdb-0222/gdb/config/alpha/alpha-osf1.mh gdb-0222/gdb/config/alpha/alphosf1.mh -gdb-0222/gdb/config/alpha/alpha-osf2.mh gdb-0222/gdb/config/alpha/alphosf2.mh -gdb-0222/gdb/config/alpha/alpha-osf3.mh gdb-0222/gdb/config/alpha/alphosf3.mh -gdb-0222/gdb/config/alpha/tm-alphalinux.h gdb-0222/gdb/config/alpha/tm-alplinux.h -gdb-0222/gdb/config/alpha/xm-alphalinux.h gdb-0222/gdb/config/alpha/xm-alplinux.h -gdb-0222/gdb/config/i386/nm-i386sco4.h gdb-0222/gdb/config/i386/nm-sco4.h -gdb-0222/gdb/config/i386/nm-i386sco5.h gdb-0222/gdb/config/i386/nm-sco5.h -gdb-0222/gdb/config/i386/nm-i386sol2.h gdb-0222/gdb/config/i386/nm-sol2.h -gdb-0222/gdb/config/i386/nm-i386v4.h gdb-0222/gdb/config/i386/nm-v4.h -gdb-0222/gdb/config/i386/nm-i386v42mp.h gdb-0222/gdb/config/i386/nm-v42mp.h -gdb-0222/gdb/config/i386/tm-i386mk.h gdb-0222/gdb/config/i386/tm-mk.h -gdb-0222/gdb/config/i386/tm-i386sol2.h gdb-0222/gdb/config/i386/tm-sol2.h -gdb-0222/gdb/config/i386/tm-i386v4.h gdb-0222/gdb/config/i386/tm-v4.h -gdb-0222/gdb/config/i386/tm-i386v42mp.h gdb-0222/gdb/config/i386/tm-v42mp.h -gdb-0222/gdb/config/i386/xm-i386mach.h gdb-0222/gdb/config/i386/xm-mach.h -gdb-0222/gdb/config/i386/xm-i386mk.h gdb-0222/gdb/config/i386/xm-mk.h -gdb-0222/gdb/config/i386/xm-i386v32.h gdb-0222/gdb/config/i386/xm-v32.h -gdb-0222/gdb/config/i386/xm-i386v4.h gdb-0222/gdb/config/i386/xm-v4.h -gdb-0222/gdb/config/m68k/apollo68v.mh gdb-0222/gdb/config/m68k/apollo-v.mh -gdb-0222/gdb/config/m68k/nm-apollo68v.h gdb-0222/gdb/config/m68k/nm-apolv.h -gdb-0222/gdb/config/m68k/nm-hp300hpux.h gdb-0222/gdb/config/m68k/nm-300ux.h -gdb-0222/gdb/config/m68k/tm-hp300hpux.h gdb-0222/gdb/config/m68k/tm-300ux.h -gdb-0222/gdb/config/m68k/xm-apollo68v.h gdb-0222/gdb/config/m68k/xm-apolv.h -gdb-0222/gdb/config/m68k/xm-hp300hpux.h gdb-0222/gdb/config/m68k/xm-300ux.h -gdb-0222/gdb/config/m88k/tm-delta88v4.h gdb-0222/gdb/config/m88k/tm-d88v4.h -gdb-0222/gdb/config/m88k/xm-delta88v4.h gdb-0222/gdb/config/m88k/xm-d88v4.h -gdb-0222/gdb/config/mips/tm-bigmips64.h gdb-0222/gdb/config/mips/tm-bigm64.h -gdb-0222/gdb/config/mips/tm-embed64.h gdb-0222/gdb/config/mips/tm-emb64.h -gdb-0222/gdb/config/mips/tm-embedl.h gdb-0222/gdb/config/mips/tm-embdl.h -gdb-0222/gdb/config/mips/tm-embedl64.h gdb-0222/gdb/config/mips/tm-embl64.h -gdb-0222/gdb/config/mips/tm-vr4300el.h gdb-0222/gdb/config/mips/tm-v43el.h -gdb-0222/gdb/config/mips/tm-vr4xxxel.h gdb-0222/gdb/config/mips/tm-v4xel.h -gdb-0222/gdb/config/mips/tm-vr5000el.h gdb-0222/gdb/config/mips/tm-vr5kel.h -gdb-0222/gdb/config/pa/nm-hppah11.h gdb-0222/gdb/config/pa/nm-hppa11.h -gdb-0222/gdb/config/powerpc/tm-ppcle-sim.h gdb-0222/gdb/config/powerpc/tm-ppcl-sim.h -gdb-0222/gdb/config/rs6000/nm-rs6000ly.h gdb-0222/gdb/config/rs6000/nm-rs6kly.h -gdb-0222/gdb/config/rs6000/tm-rs6000.h gdb-0222/gdb/config/rs6000/tm-rs6k.h -gdb-0222/gdb/config/rs6000/tm-rs6000ly.h gdb-0222/gdb/config/rs6000/tm-rs6kly.h -gdb-0222/gdb/config/rs6000/xm-rs6000ly.h gdb-0222/gdb/config/rs6000/xm-rs6kly.h -gdb-0222/gdb/config/sparc/tm-sparclet.h gdb-0222/gdb/config/sparc/tm-splet.h -gdb-0222/gdb/config/sparc/tm-sparclite.h gdb-0222/gdb/config/sparc/tm-splite.h -gdb-0222/gdb/config/sparc/tm-sparclynx.h gdb-0222/gdb/config/sparc/tm-splynx.h -gdb-0222/gdb/config/sparc/xm-sparclynx.h gdb-0222/gdb/config/sparc/xm-xplynx.h -gdb-0222/gdb/config/vax/xm-vaxult2.h gdb-0222/gdb/config/vax/xm-vaxut2.h -gdb-0222/gdb/gdbtk/generic/gdbtk-varobj.c gdb-0222/gdb/gdbtk/generic/gdbtk-vobj.c -gdb-0222/gdb/osf-share/cma_stack_int.h gdb-0222/gdb/osf-share/cma_stkint.h -gdb-0222/gdb/testsuite/gdb.base/coremaker2.c gdb-0222/gdb/testsuite/gdb.base/core2maker.c -gdb-0222/gdb/tui/tuiSourceWin.c gdb-0222/gdb/tui/tuiWinSource.c -gdb-0222/gdb/tui/tuiSourceWin.h gdb-0222/gdb/tui/tuiWinSource.h -gdb-0222/bfd/ChangeLog-9193 gdb-0222/bfd/ChangeLog.9193 -gdb-0222/bfd/ChangeLog-9495 gdb-0222/bfd/ChangeLog.9495 -gdb-0222/bfd/ChangeLog-9697 gdb-0222/bfd/ChangeLog.9697 -gdb-0222/bfd/coff-tic80.c gdb-0222/bfd/coff-tc80.c -gdb-0222/sim/mips/dv-tx3904irc.c gdb-0222/sim/mips/dv-tx3irc.c -gdb-0222/sim/mips/dv-tx3904sio.c gdb-0222/sim/mips/dv-tx3sio.c -gdb-0222/sim/mips/dv-tx3904tmr.c gdb-0222/sim/mips/dv-tx3tmr.c -gdb-0222/sim/mn10300/dv-mn103int.c gdb-0222/sim/mn10300/dv-mn1int.c -gdb-0222/sim/mn10300/dv-mn103iop.c gdb-0222/sim/mn10300/dv-mn1iop.c -gdb-0222/sim/mn10300/dv-mn103ser.c gdb-0222/sim/mn10300/dv-mn1ser.c -gdb-0222/sim/mn10300/dv-mn103tim.c gdb-0222/sim/mn10300/dv-mn1tim.c -gdb-0222/sim/ppc/corefile-n.h gdb-0222/sim/ppc/corefle-n.h -gdb-0222/sim/ppc/idecode_branch.h gdb-0222/sim/ppc/idec_branch.h -gdb-0222/sim/ppc/idecode_expression.h gdb-0222/sim/ppc/idec_expression.h -gdb-0222/sim/ppc/idecode_fields.h gdb-0222/sim/ppc/idec_fields.h -gdb-0222/sim/ppc/sim-endian-n.h gdb-0222/sim/ppc/sim-endn.h -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-d.s gdb-0222/sim/testsuite/d10v-elf/t-ld-d.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-i.s gdb-0222/sim/testsuite/d10v-elf/t-ld-i.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-id.s gdb-0222/sim/testsuite/d10v-elf/t-ld-id.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-im.s gdb-0222/sim/testsuite/d10v-elf/t-ld-im.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld-ip.s gdb-0222/sim/testsuite/d10v-elf/t-ld-ip.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-d.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-d.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-i.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-i.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-id.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-id.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-im.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-im.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s gdb-0222/sim/testsuite/d10v-elf/t-ld2-ip.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-d.s gdb-0222/sim/testsuite/d10v-elf/t-st-d.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-i.s gdb-0222/sim/testsuite/d10v-elf/t-st-i.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-id.s gdb-0222/sim/testsuite/d10v-elf/t-st-id.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-im.s gdb-0222/sim/testsuite/d10v-elf/t-st-im.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-ip.s gdb-0222/sim/testsuite/d10v-elf/t-st-ip.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st-is.s gdb-0222/sim/testsuite/d10v-elf/t-st-is.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-d.s gdb-0222/sim/testsuite/d10v-elf/t-st2-d.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-i.s gdb-0222/sim/testsuite/d10v-elf/t-st2-i.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-id.s gdb-0222/sim/testsuite/d10v-elf/t-st2-id.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-im.s gdb-0222/sim/testsuite/d10v-elf/t-st2-im.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-ip.s gdb-0222/sim/testsuite/d10v-elf/t-st2-ip.s -gdb-0222/sim/testsuite/d10v-elf/t-ae-st2w-is.s gdb-0222/sim/testsuite/d10v-elf/t-st2-is.s -gdb-0222/sim/testsuite/d30v-elf/ls-ld4bhu.S gdb-0222/sim/testsuite/d30v-elf/ls-ld4bu.S -gdb-0222/intl/po2tbl.sed.in gdb-0222/intl/po2tblsed.in -gdb-0222/intl/intlh.inst.in gdb-0222/intl/intlh_inst.in -gdb-0222/readline/config.h.in gdb-0222/readline/config.h-in -gdb-0222/readline/config.h.bot gdb-0222/readline/config.h-bot -gdb-0222/gdb/nindy-share/b.out.h gdb-0222/gdb/nindy-share/b_out.h -gdb-0222/gdb/c-exp.tab.c gdb-0222/gdb/c-exp_tab.c -gdb-0222/gdb/jv-exp.tab.c gdb-0222/gdb/jv-exp_tab.c -gdb-0222/gdb/f-exp.tab.c gdb-0222/gdb/f-exp_tab.c -gdb-0222/gdb/m2-exp.tab.c gdb-0222/gdb/m2-exp_tab.c -gdb-0222/gdb/testsuite/gdb.c++ gdb-0222/gdb/testsuite/gdb.cxx -gdb-0222/gdb/testsuite/gdb.c++/Makefile.in gdb-0222/gdb/testsuite/gdb.cxx/Makefile.in -gdb-0222/gdb/testsuite/gdb.c++/ambiguous.cc gdb-0222/gdb/testsuite/gdb.cxx/ambiguous.cc -gdb-0222/gdb/testsuite/gdb.c++/ambiguous.exp gdb-0222/gdb/testsuite/gdb.cxx/ambiguous.exp -gdb-0222/gdb/testsuite/gdb.c++/annota2.cc gdb-0222/gdb/testsuite/gdb.cxx/annota2.cc -gdb-0222/gdb/testsuite/gdb.c++/annota2.exp gdb-0222/gdb/testsuite/gdb.cxx/annota2.exp -gdb-0222/gdb/testsuite/gdb.c++/anon-union.cc gdb-0222/gdb/testsuite/gdb.cxx/anon-union.cc -gdb-0222/gdb/testsuite/gdb.c++/anon-union.exp gdb-0222/gdb/testsuite/gdb.cxx/anon-union.exp -gdb-0222/gdb/testsuite/gdb.c++/classes.exp gdb-0222/gdb/testsuite/gdb.cxx/classes.exp -gdb-0222/gdb/testsuite/gdb.c++/configure gdb-0222/gdb/testsuite/gdb.cxx/configure -gdb-0222/gdb/testsuite/gdb.c++/configure.in gdb-0222/gdb/testsuite/gdb.cxx/configure.in -gdb-0222/gdb/testsuite/gdb.c++/cplusfuncs.cc gdb-0222/gdb/testsuite/gdb.cxx/cplusfuncs.cc -gdb-0222/gdb/testsuite/gdb.c++/cplusfuncs.exp gdb-0222/gdb/testsuite/gdb.cxx/cplusfuncs.exp -gdb-0222/gdb/testsuite/gdb.c++/ctti.exp gdb-0222/gdb/testsuite/gdb.cxx/ctti.exp -gdb-0222/gdb/testsuite/gdb.c++/cttiadd.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd.cc -gdb-0222/gdb/testsuite/gdb.c++/cttiadd1.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd1.cc -gdb-0222/gdb/testsuite/gdb.c++/cttiadd2.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd2.cc -gdb-0222/gdb/testsuite/gdb.c++/cttiadd3.cc gdb-0222/gdb/testsuite/gdb.cxx/cttiadd3.cc -gdb-0222/gdb/testsuite/gdb.c++/demangle.exp gdb-0222/gdb/testsuite/gdb.cxx/demangle.exp -gdb-0222/gdb/testsuite/gdb.c++/derivation.cc gdb-0222/gdb/testsuite/gdb.cxx/derivation.cc -gdb-0222/gdb/testsuite/gdb.c++/derivation.exp gdb-0222/gdb/testsuite/gdb.cxx/derivation.exp -gdb-0222/gdb/testsuite/gdb.c++/inherit.exp gdb-0222/gdb/testsuite/gdb.cxx/inherit.exp -gdb-0222/gdb/testsuite/gdb.c++/local.cc gdb-0222/gdb/testsuite/gdb.cxx/local.cc -gdb-0222/gdb/testsuite/gdb.c++/local.exp gdb-0222/gdb/testsuite/gdb.cxx/local.exp -gdb-0222/gdb/testsuite/gdb.c++/member-ptr.cc gdb-0222/gdb/testsuite/gdb.cxx/member-ptr.cc -gdb-0222/gdb/testsuite/gdb.c++/member-ptr.exp gdb-0222/gdb/testsuite/gdb.cxx/member-ptr.exp -gdb-0222/gdb/testsuite/gdb.c++/method.cc gdb-0222/gdb/testsuite/gdb.cxx/method.cc -gdb-0222/gdb/testsuite/gdb.c++/method.exp gdb-0222/gdb/testsuite/gdb.cxx/method.exp -gdb-0222/gdb/testsuite/gdb.c++/misc.cc gdb-0222/gdb/testsuite/gdb.cxx/misc.cc -gdb-0222/gdb/testsuite/gdb.c++/misc.exp gdb-0222/gdb/testsuite/gdb.cxx/misc.exp -gdb-0222/gdb/testsuite/gdb.c++/overload.cc gdb-0222/gdb/testsuite/gdb.cxx/overload.cc -gdb-0222/gdb/testsuite/gdb.c++/overload.exp gdb-0222/gdb/testsuite/gdb.cxx/overload.exp -gdb-0222/gdb/testsuite/gdb.c++/ovldbreak.cc gdb-0222/gdb/testsuite/gdb.cxx/ovldbreak.cc -gdb-0222/gdb/testsuite/gdb.c++/ovldbreak.exp gdb-0222/gdb/testsuite/gdb.cxx/ovldbreak.exp -gdb-0222/gdb/testsuite/gdb.c++/ref-types.cc gdb-0222/gdb/testsuite/gdb.cxx/ref-types.cc -gdb-0222/gdb/testsuite/gdb.c++/ref-types.exp gdb-0222/gdb/testsuite/gdb.cxx/ref-types.exp -gdb-0222/gdb/testsuite/gdb.c++/templates.cc gdb-0222/gdb/testsuite/gdb.cxx/templates.cc -gdb-0222/gdb/testsuite/gdb.c++/templates.exp gdb-0222/gdb/testsuite/gdb.cxx/templates.exp -gdb-0222/gdb/testsuite/gdb.c++/userdef.cc gdb-0222/gdb/testsuite/gdb.cxx/userdef.cc -gdb-0222/gdb/testsuite/gdb.c++/userdef.exp gdb-0222/gdb/testsuite/gdb.cxx/userdef.exp -gdb-0222/gdb/testsuite/gdb.c++/virtfunc.cc gdb-0222/gdb/testsuite/gdb.cxx/virtfunc.cc -gdb-0222/gdb/testsuite/gdb.c++/virtfunc.exp gdb-0222/gdb/testsuite/gdb.cxx/virtfunc.exp -gdb-0222/gdb/testsuite/.gdbinit gdb-0222/gdb/testsuite/gdb.ini -gdb-0222/sim/ppc/.gdbinit gdb-0222/sim/ppc/gdb.ini +@V@/gdb/ChangeLog-3.x @V@/gdb/ChangeLog.3-x +@V@/gdb/ChangeLog-9091 @V@/gdb/ChangeLog.9091 +@V@/gdb/ChangeLog-92 @V@/gdb/ChangeLog.92 +@V@/gdb/ChangeLog-93 @V@/gdb/ChangeLog.93 +@V@/gdb/ChangeLog-94 @V@/gdb/ChangeLog.94 +@V@/gdb/ChangeLog-95 @V@/gdb/ChangeLog.95 +@V@/gdb/ChangeLog-96 @V@/gdb/ChangeLog.96 +@V@/gdb/ChangeLog-97 @V@/gdb/ChangeLog.97 +@V@/gdb/ChangeLog-98 @V@/gdb/ChangeLog.98 +@V@/gdb/ChangeLog-99 @V@/gdb/ChangeLog.99 +@V@/gdb/ppc-linux-tdep.c @V@/gdb/ppc-linx-tdep.c +@V@/gdb/remote-adapt.c @V@/gdb/rmt-adapt.c +@V@/gdb/remote-array.c @V@/gdb/rmt-array.c +@V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c +@V@/gdb/remote-eb.c @V@/gdb/rmt-eb.c +@V@/gdb/remote-es.c @V@/gdb/rmt-es.c +@V@/gdb/remote-est.c @V@/gdb/rmt-est.c +@V@/gdb/remote-mips.c @V@/gdb/emt-mips.c +@V@/gdb/remote-mm.c @V@/gdb/emt-mm.c +@V@/gdb/remote-nindy.c @V@/gdb/rmt-nindy.c +@V@/gdb/remote-nrom.c @V@/gdb/rmt-nrom.c +@V@/gdb/remote-rdi.c @V@/gdb/rmt-rdi.c +@V@/gdb/remote-rdp.c @V@/gdb/rmt-rdp.c +@V@/gdb/remote-sds.c @V@/gdb/rmt-sds.c +@V@/gdb/remote-sim.c @V@/gdb/rmt-sim.c +@V@/gdb/remote-st.c @V@/gdb/rmt-st.c +@V@/gdb/remote-udi.c @V@/gdb/rmt-udi.c +@V@/gdb/remote-vx.c @V@/gdb/rmt-vx.c +@V@/gdb/remote-vx29k.c @V@/gdb/rmt-vx29k.c +@V@/gdb/remote-vx68.c @V@/gdb/rmt-vx68.c +@V@/gdb/remote-vx960.c @V@/gdb/rmt-vx960.c +@V@/gdb/remote-vxmips.c @V@/gdb/rmt-vxmips.c +@V@/gdb/remote-vxsparc.c @V@/gdb/rmt-vxsparc.c +@V@/gdb/sparclet-rom.c @V@/gdb/splet-rom.c +@V@/gdb/sparclet-stub.c @V@/gdb/splet-stub.c +@V@/gdb/i386-linux-tdep.c @V@/gdb/i386linux-tdep.c +@V@/gdb/arm-linux-tdep.c @V@/gdb/armlin-tdep.c +@V@/gdb/arm-linux-nat.c @V@/gdb/armlin-nat.c +@V@/gdb/ia64-linux-nat.c @V@/gdb/ia64linux-nat.c +@V@/gdb/config/alpha/alpha-osf1.mh @V@/gdb/config/alpha/alphosf1.mh +@V@/gdb/config/alpha/alpha-osf2.mh @V@/gdb/config/alpha/alphosf2.mh +@V@/gdb/config/alpha/alpha-osf3.mh @V@/gdb/config/alpha/alphosf3.mh +@V@/gdb/config/alpha/tm-alphalinux.h @V@/gdb/config/alpha/tm-alplinux.h +@V@/gdb/config/alpha/xm-alphalinux.h @V@/gdb/config/alpha/xm-alplinux.h +@V@/gdb/config/i386/nm-i386sco4.h @V@/gdb/config/i386/nm-sco4.h +@V@/gdb/config/i386/nm-i386sco5.h @V@/gdb/config/i386/nm-sco5.h +@V@/gdb/config/i386/nm-i386sol2.h @V@/gdb/config/i386/nm-sol2.h +@V@/gdb/config/i386/nm-i386v4.h @V@/gdb/config/i386/nm-v4.h +@V@/gdb/config/i386/nm-i386v42mp.h @V@/gdb/config/i386/nm-v42mp.h +@V@/gdb/config/i386/tm-i386mk.h @V@/gdb/config/i386/tm-mk.h +@V@/gdb/config/i386/tm-i386sol2.h @V@/gdb/config/i386/tm-sol2.h +@V@/gdb/config/i386/tm-i386v4.h @V@/gdb/config/i386/tm-v4.h +@V@/gdb/config/i386/tm-i386v42mp.h @V@/gdb/config/i386/tm-v42mp.h +@V@/gdb/config/i386/xm-i386mach.h @V@/gdb/config/i386/xm-mach.h +@V@/gdb/config/i386/xm-i386mk.h @V@/gdb/config/i386/xm-mk.h +@V@/gdb/config/i386/xm-i386v32.h @V@/gdb/config/i386/xm-v32.h +@V@/gdb/config/i386/xm-i386v4.h @V@/gdb/config/i386/xm-v4.h +@V@/gdb/config/m68k/apollo68v.mh @V@/gdb/config/m68k/apollo-v.mh +@V@/gdb/config/m68k/nm-apollo68v.h @V@/gdb/config/m68k/nm-apolv.h +@V@/gdb/config/m68k/nm-hp300hpux.h @V@/gdb/config/m68k/nm-300ux.h +@V@/gdb/config/m68k/tm-hp300hpux.h @V@/gdb/config/m68k/tm-300ux.h +@V@/gdb/config/m68k/xm-apollo68v.h @V@/gdb/config/m68k/xm-apolv.h +@V@/gdb/config/m68k/xm-hp300hpux.h @V@/gdb/config/m68k/xm-300ux.h +@V@/gdb/config/m88k/tm-delta88v4.h @V@/gdb/config/m88k/tm-d88v4.h +@V@/gdb/config/m88k/xm-delta88v4.h @V@/gdb/config/m88k/xm-d88v4.h +@V@/gdb/config/mips/tm-bigmips64.h @V@/gdb/config/mips/tm-bigm64.h +@V@/gdb/config/mips/tm-embed64.h @V@/gdb/config/mips/tm-emb64.h +@V@/gdb/config/mips/tm-embedl.h @V@/gdb/config/mips/tm-embdl.h +@V@/gdb/config/mips/tm-embedl64.h @V@/gdb/config/mips/tm-embl64.h +@V@/gdb/config/mips/tm-vr4300el.h @V@/gdb/config/mips/tm-v43el.h +@V@/gdb/config/mips/tm-vr4xxxel.h @V@/gdb/config/mips/tm-v4xel.h +@V@/gdb/config/mips/tm-vr5000el.h @V@/gdb/config/mips/tm-vr5kel.h +@V@/gdb/config/pa/nm-hppah11.h @V@/gdb/config/pa/nm-hppa11.h +@V@/gdb/config/powerpc/tm-ppcle-sim.h @V@/gdb/config/powerpc/tm-ppcl-sim.h +@V@/gdb/config/rs6000/nm-rs6000ly.h @V@/gdb/config/rs6000/nm-rs6kly.h +@V@/gdb/config/rs6000/tm-rs6000.h @V@/gdb/config/rs6000/tm-rs6k.h +@V@/gdb/config/rs6000/tm-rs6000ly.h @V@/gdb/config/rs6000/tm-rs6kly.h +@V@/gdb/config/rs6000/xm-rs6000ly.h @V@/gdb/config/rs6000/xm-rs6kly.h +@V@/gdb/config/sparc/tm-sparclet.h @V@/gdb/config/sparc/tm-splet.h +@V@/gdb/config/sparc/tm-sparclite.h @V@/gdb/config/sparc/tm-splite.h +@V@/gdb/config/sparc/tm-sparclynx.h @V@/gdb/config/sparc/tm-splynx.h +@V@/gdb/config/sparc/xm-sparclynx.h @V@/gdb/config/sparc/xm-xplynx.h +@V@/gdb/config/vax/xm-vaxult2.h @V@/gdb/config/vax/xm-vaxut2.h +@V@/gdb/gdbtk/generic/gdbtk-varobj.c @V@/gdb/gdbtk/generic/gdbtk-vobj.c +@V@/gdb/osf-share/cma_stack_int.h @V@/gdb/osf-share/cma_stkint.h +@V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c +@V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c +@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h +@V@/bfd/ChangeLog-9193 @V@/bfd/ChangeLog.9193 +@V@/bfd/ChangeLog-9495 @V@/bfd/ChangeLog.9495 +@V@/bfd/ChangeLog-9697 @V@/bfd/ChangeLog.9697 +@V@/bfd/coff-tic80.c @V@/bfd/coff-tc80.c +@V@/bfd/coff-tic54x.c @V@/bfd/coff-tc54x.c +@V@/bfd/elf32-i370.c @V@/bfd/elf32-i7.c +@V@/sim/mips/dv-tx3904irc.c @V@/sim/mips/dv-tx3irc.c +@V@/sim/mips/dv-tx3904sio.c @V@/sim/mips/dv-tx3sio.c +@V@/sim/mips/dv-tx3904tmr.c @V@/sim/mips/dv-tx3tmr.c +@V@/sim/mn10300/dv-mn103int.c @V@/sim/mn10300/dv-mn1int.c +@V@/sim/mn10300/dv-mn103iop.c @V@/sim/mn10300/dv-mn1iop.c +@V@/sim/mn10300/dv-mn103ser.c @V@/sim/mn10300/dv-mn1ser.c +@V@/sim/mn10300/dv-mn103tim.c @V@/sim/mn10300/dv-mn1tim.c +@V@/sim/ppc/corefile-n.h @V@/sim/ppc/corefle-n.h +@V@/sim/ppc/idecode_branch.h @V@/sim/ppc/idec_branch.h +@V@/sim/ppc/idecode_expression.h @V@/sim/ppc/idec_expression.h +@V@/sim/ppc/idecode_fields.h @V@/sim/ppc/idec_fields.h +@V@/sim/ppc/sim-endian-n.h @V@/sim/ppc/sim-endn.h +@V@/sim/testsuite/d10v-elf/t-ae-ld-d.s @V@/sim/testsuite/d10v-elf/t-ld-d.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-i.s @V@/sim/testsuite/d10v-elf/t-ld-i.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-id.s @V@/sim/testsuite/d10v-elf/t-ld-id.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-im.s @V@/sim/testsuite/d10v-elf/t-ld-im.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-ip.s @V@/sim/testsuite/d10v-elf/t-ld-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-d.s @V@/sim/testsuite/d10v-elf/t-ld2-d.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-i.s @V@/sim/testsuite/d10v-elf/t-ld2-i.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-id.s @V@/sim/testsuite/d10v-elf/t-ld2-id.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-im.s @V@/sim/testsuite/d10v-elf/t-ld2-im.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s @V@/sim/testsuite/d10v-elf/t-ld2-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st-d.s @V@/sim/testsuite/d10v-elf/t-st-d.s +@V@/sim/testsuite/d10v-elf/t-ae-st-i.s @V@/sim/testsuite/d10v-elf/t-st-i.s +@V@/sim/testsuite/d10v-elf/t-ae-st-id.s @V@/sim/testsuite/d10v-elf/t-st-id.s +@V@/sim/testsuite/d10v-elf/t-ae-st-im.s @V@/sim/testsuite/d10v-elf/t-st-im.s +@V@/sim/testsuite/d10v-elf/t-ae-st-ip.s @V@/sim/testsuite/d10v-elf/t-st-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st-is.s @V@/sim/testsuite/d10v-elf/t-st-is.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-d.s @V@/sim/testsuite/d10v-elf/t-st2-d.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-i.s @V@/sim/testsuite/d10v-elf/t-st2-i.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-id.s @V@/sim/testsuite/d10v-elf/t-st2-id.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-im.s @V@/sim/testsuite/d10v-elf/t-st2-im.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-ip.s @V@/sim/testsuite/d10v-elf/t-st2-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-is.s @V@/sim/testsuite/d10v-elf/t-st2-is.s +@V@/sim/testsuite/d30v-elf/ls-ld4bhu.S @V@/sim/testsuite/d30v-elf/ls-ld4bu.S +@V@/intl/po2tbl.sed.in @V@/intl/po2tblsed.in +@V@/intl/intlh.inst.in @V@/intl/intlh_inst.in +@V@/readline/config.h.in @V@/readline/config.h-in +@V@/readline/config.h.bot @V@/readline/config.h-bot +@V@/gdb/nindy-share/b.out.h @V@/gdb/nindy-share/b_out.h +@V@/gdb/c-exp.tab.c @V@/gdb/c-exp_tab.c +@V@/gdb/jv-exp.tab.c @V@/gdb/jv-exp_tab.c +@V@/gdb/f-exp.tab.c @V@/gdb/f-exp_tab.c +@V@/gdb/m2-exp.tab.c @V@/gdb/m2-exp_tab.c +@V@/gdb/testsuite/gdb.c++ @V@/gdb/testsuite/gdb.cxx +@V@/gdb/testsuite/gdb.c++/Makefile.in @V@/gdb/testsuite/gdb.cxx/Makefile.in +@V@/gdb/testsuite/gdb.c++/ambiguous.cc @V@/gdb/testsuite/gdb.cxx/ambiguous.cc +@V@/gdb/testsuite/gdb.c++/ambiguous.exp @V@/gdb/testsuite/gdb.cxx/ambiguous.exp +@V@/gdb/testsuite/gdb.c++/annota2.cc @V@/gdb/testsuite/gdb.cxx/annota2.cc +@V@/gdb/testsuite/gdb.c++/annota2.exp @V@/gdb/testsuite/gdb.cxx/annota2.exp +@V@/gdb/testsuite/gdb.c++/anon-union.cc @V@/gdb/testsuite/gdb.cxx/anon-union.cc +@V@/gdb/testsuite/gdb.c++/anon-union.exp @V@/gdb/testsuite/gdb.cxx/anon-union.exp +@V@/gdb/testsuite/gdb.c++/classes.exp @V@/gdb/testsuite/gdb.cxx/classes.exp +@V@/gdb/testsuite/gdb.c++/configure @V@/gdb/testsuite/gdb.cxx/configure +@V@/gdb/testsuite/gdb.c++/configure.in @V@/gdb/testsuite/gdb.cxx/configure.in +@V@/gdb/testsuite/gdb.c++/cplusfuncs.cc @V@/gdb/testsuite/gdb.cxx/cplusfuncs.cc +@V@/gdb/testsuite/gdb.c++/cplusfuncs.exp @V@/gdb/testsuite/gdb.cxx/cplusfuncs.exp +@V@/gdb/testsuite/gdb.c++/ctti.exp @V@/gdb/testsuite/gdb.cxx/ctti.exp +@V@/gdb/testsuite/gdb.c++/cttiadd.cc @V@/gdb/testsuite/gdb.cxx/cttiadd.cc +@V@/gdb/testsuite/gdb.c++/cttiadd1.cc @V@/gdb/testsuite/gdb.cxx/cttiadd1.cc +@V@/gdb/testsuite/gdb.c++/cttiadd2.cc @V@/gdb/testsuite/gdb.cxx/cttiadd2.cc +@V@/gdb/testsuite/gdb.c++/cttiadd3.cc @V@/gdb/testsuite/gdb.cxx/cttiadd3.cc +@V@/gdb/testsuite/gdb.c++/demangle.exp @V@/gdb/testsuite/gdb.cxx/demangle.exp +@V@/gdb/testsuite/gdb.c++/derivation.cc @V@/gdb/testsuite/gdb.cxx/derivation.cc +@V@/gdb/testsuite/gdb.c++/derivation.exp @V@/gdb/testsuite/gdb.cxx/derivation.exp +@V@/gdb/testsuite/gdb.c++/inherit.exp @V@/gdb/testsuite/gdb.cxx/inherit.exp +@V@/gdb/testsuite/gdb.c++/local.cc @V@/gdb/testsuite/gdb.cxx/local.cc +@V@/gdb/testsuite/gdb.c++/local.exp @V@/gdb/testsuite/gdb.cxx/local.exp +@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 +@V@/gdb/testsuite/gdb.c++/method.exp @V@/gdb/testsuite/gdb.cxx/method.exp +@V@/gdb/testsuite/gdb.c++/misc.cc @V@/gdb/testsuite/gdb.cxx/misc.cc +@V@/gdb/testsuite/gdb.c++/misc.exp @V@/gdb/testsuite/gdb.cxx/misc.exp +@V@/gdb/testsuite/gdb.c++/overload.cc @V@/gdb/testsuite/gdb.cxx/overload.cc +@V@/gdb/testsuite/gdb.c++/overload.exp @V@/gdb/testsuite/gdb.cxx/overload.exp +@V@/gdb/testsuite/gdb.c++/ovldbreak.cc @V@/gdb/testsuite/gdb.cxx/ovldbreak.cc +@V@/gdb/testsuite/gdb.c++/ovldbreak.exp @V@/gdb/testsuite/gdb.cxx/ovldbreak.exp +@V@/gdb/testsuite/gdb.c++/ref-types.cc @V@/gdb/testsuite/gdb.cxx/ref-types.cc +@V@/gdb/testsuite/gdb.c++/ref-types.exp @V@/gdb/testsuite/gdb.cxx/ref-types.exp +@V@/gdb/testsuite/gdb.c++/templates.cc @V@/gdb/testsuite/gdb.cxx/templates.cc +@V@/gdb/testsuite/gdb.c++/templates.exp @V@/gdb/testsuite/gdb.cxx/templates.exp +@V@/gdb/testsuite/gdb.c++/userdef.cc @V@/gdb/testsuite/gdb.cxx/userdef.cc +@V@/gdb/testsuite/gdb.c++/userdef.exp @V@/gdb/testsuite/gdb.cxx/userdef.exp +@V@/gdb/testsuite/gdb.c++/virtfunc.cc @V@/gdb/testsuite/gdb.cxx/virtfunc.cc +@V@/gdb/testsuite/gdb.c++/virtfunc.exp @V@/gdb/testsuite/gdb.cxx/virtfunc.exp +@V@/gdb/testsuite/gdb.mi/mi-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi-varcmd.exp +@V@/gdb/testsuite/.gdbinit @V@/gdb/testsuite/gdb.ini +@V@/sim/ppc/.gdbinit @V@/sim/ppc/gdb.ini diff --git a/gdb/config/fr30/tm-fr30.h b/gdb/config/fr30/tm-fr30.h index d289f6e3450..f9136ae499a 100644 --- a/gdb/config/fr30/tm-fr30.h +++ b/gdb/config/fr30/tm-fr30.h @@ -94,7 +94,7 @@ /* Largest value REGISTER_VIRTUAL_SIZE can have. */ #define MAX_REGISTER_VIRTUAL_SIZE FR30_REGSIZE -extern void fr30_pop_frame PARAMS ((void)); +extern void fr30_pop_frame (void); #define POP_FRAME fr30_pop_frame() #define USE_GENERIC_DUMMY_FRAMES 1 @@ -150,22 +150,22 @@ struct value; int frameoffset; \ int framereg; -extern CORE_ADDR fr30_frame_chain PARAMS ((struct frame_info * fi)); +extern CORE_ADDR fr30_frame_chain (struct frame_info *fi); #define FRAME_CHAIN(fi) fr30_frame_chain (fi) -extern CORE_ADDR fr30_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR fr30_frame_saved_pc (struct frame_info *); #define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi)) #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM) -extern CORE_ADDR fr30_skip_prologue PARAMS ((CORE_ADDR pc)); +extern CORE_ADDR fr30_skip_prologue (CORE_ADDR pc); #define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc)) /* Write into appropriate registers a function return value of type TYPE, given in virtual format. VALBUF is in the target byte order; it's typically the VALUE_CONTENTS of some struct value, and those are in the target's byte order. */ -extern void fr30_store_return_value PARAMS ((struct type * type, char *valbuf)); +extern void fr30_store_return_value (struct type *type, char *valbuf); #define STORE_RETURN_VALUE(TYPE,VALBUF) \ (fr30_store_return_value ((TYPE), (VALBUF))) @@ -186,24 +186,23 @@ extern void fr30_store_return_value PARAMS ((struct type * type, char *valbuf)); #define TARGET_FR30 /* IEEE format floating point */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Define other aspects of the stack frame. */ /* An expression that tells us whether the function invocation represented by FI does not have a frame on the stack associated with it. */ -extern int fr30_frameless_function_invocation PARAMS ((struct frame_info * frame)); +extern int fr30_frameless_function_invocation (struct frame_info *frame); #define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI)); -extern void fr30_init_extra_frame_info PARAMS ((struct frame_info * fi)); +extern void fr30_init_extra_frame_info (struct frame_info *fi); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi) #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) extern CORE_ADDR - fr30_push_arguments PARAMS ((int nargs, struct value ** args, CORE_ADDR sp, - int struct_return, - CORE_ADDR struct_addr)); +fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) diff --git a/gdb/config/gould/np1.mh b/gdb/config/gould/np1.mh deleted file mode 100644 index 322f2078ac5..00000000000 --- a/gdb/config/gould/np1.mh +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Host: Gould NP1 -# OBSOLETE XDEPFILES= infptrace.o inftarg.o fork-child.o gould-xdep.o -# OBSOLETE XM_FILE= xm-np1.h diff --git a/gdb/config/gould/np1.mt b/gdb/config/gould/np1.mt deleted file mode 100644 index 4ea2da5ab45..00000000000 --- a/gdb/config/gould/np1.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Gould NP1 -# OBSOLETE TDEPFILES= gould-tdep.o -# OBSOLETE TM_FILE= tm-np1.h diff --git a/gdb/config/gould/pn.mh b/gdb/config/gould/pn.mh deleted file mode 100644 index 9d69f905d8d..00000000000 --- a/gdb/config/gould/pn.mh +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Host: Gould Powernode -# OBSOLETE XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o -# OBSOLETE XM_FILE= xm-pn.h diff --git a/gdb/config/gould/pn.mt b/gdb/config/gould/pn.mt deleted file mode 100644 index 7f73fc9f041..00000000000 --- a/gdb/config/gould/pn.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Gould Powernode -# OBSOLETE TDEPFILES= gould-tdep.o -# OBSOLETE TM_FILE= tm-pn.h diff --git a/gdb/config/gould/tm-np1.h b/gdb/config/gould/tm-np1.h deleted file mode 100644 index 9971c891ca2..00000000000 --- a/gdb/config/gould/tm-np1.h +++ /dev/null @@ -1,490 +0,0 @@ -/* OBSOLETE /* Parameters for targeting on a Gould NP1, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define GOULD_NPL */ -/* OBSOLETE */ -/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */ -/* OBSOLETE */ -/* OBSOLETE /* N_ENTRY appears in libraries on Gould machines. */ -/* OBSOLETE Don't know what 0xa4 is; it's mentioned in stab.h */ -/* OBSOLETE but only in the sdb symbol list. *x/ */ -/* OBSOLETE #define IGNORE_SYMBOL(type) (type == N_ENTRY || type == 0xa4) */ -/* OBSOLETE */ -/* OBSOLETE /* We don't want the extra gnu symbols on the machine; */ -/* OBSOLETE they will interfere with the shared segment symbols. *x/ */ -/* OBSOLETE #define NO_GNU_STABS */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for text-offset and data info (in NPL a.out format). *x/ */ -/* OBSOLETE #define TEXTINFO \ */ -/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr); \ */ -/* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr)\ */ -/* OBSOLETE + exec_aouthdr.a_text */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for number of symbol table entries *x/ */ -/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */ -/* OBSOLETE (coffhdr.f_nsyms) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for file-offset of symbol table (in NPL a.out format). *x/ */ -/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */ -/* OBSOLETE N_SYMOFF (coffhdr) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for file-offset of string table (in NPL a.out format). *x/ */ -/* OBSOLETE #define STRING_TABLE_OFFSET \ */ -/* OBSOLETE (N_STROFF (coffhdr)) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to store the length of the string table data in INTO. *x/ */ -/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */ -/* OBSOLETE { INTO = hdr.a_stsize; } */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to declare variables to hold the file's header data. *x/ */ -/* OBSOLETE #define DECLARE_FILE_HEADERS struct exec hdr; \ */ -/* OBSOLETE FILHDR coffhdr */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */ -/* OBSOLETE NAME is the file name, for error messages. *x/ */ -/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */ -/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */ -/* OBSOLETE if (val < 0) \ */ -/* OBSOLETE perror_with_name (NAME); \ */ -/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */ -/* OBSOLETE if (val < 0) \ */ -/* OBSOLETE perror_with_name (NAME); \ */ -/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */ -/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */ -/* OBSOLETE if (N_BADMAG (hdr)) \ */ -/* OBSOLETE error ("File \"%s\" not in executable format.", NAME); } */ -/* OBSOLETE */ -/* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */ -/* OBSOLETE #define NS32GMAGIC GNP1MAGIC */ -/* OBSOLETE #define NS32SMAGIC GPNMAGIC */ -/* OBSOLETE */ -/* OBSOLETE /* Address of blocks in N_LBRAC and N_RBRAC symbols are absolute addresses, */ -/* OBSOLETE not relative to start of source address. *x/ */ -/* OBSOLETE #define BLOCK_ADDRESS_ABSOLUTE */ -/* OBSOLETE */ -/* OBSOLETE /* Offset from address of function to start of its code. */ -/* OBSOLETE Zero on most machines. *x/ */ -/* OBSOLETE #define FUNCTION_START_OFFSET 8 */ -/* OBSOLETE */ -/* OBSOLETE /* Advance PC across any function entry prologue instructions */ -/* OBSOLETE to reach some "real" code. One NPL we can have one two startup */ -/* OBSOLETE sequences depending on the size of the local stack: */ -/* OBSOLETE */ -/* OBSOLETE Either: */ -/* OBSOLETE "suabr b2, #" */ -/* OBSOLETE of */ -/* OBSOLETE "lil r4, #", "suabr b2, #(r4)" */ -/* OBSOLETE */ -/* OBSOLETE "lwbr b6, #", "stw r1, 8(b2)" */ -/* OBSOLETE Optional "stwbr b3, c(b2)" */ -/* OBSOLETE Optional "trr r2,r7" (Gould first argument register passing) */ -/* OBSOLETE or */ -/* OBSOLETE Optional "stw r2,8(b3)" (Gould first argument register passing) */ -/* OBSOLETE *x/ */ -/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */ -/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0xFA0B0000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xD4820008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0x5582000C) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xd5030008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xD4820008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0x5582000C) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xd5030008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Immediately after a function call, return the saved pc. */ -/* OBSOLETE Can't go through the frames for this because on some machines */ -/* OBSOLETE the new frame is not set up until the new function executes */ -/* OBSOLETE some instructions. True on NPL! Return address is in R1. */ -/* OBSOLETE The true return address is REALLY 4 past that location! *x/ */ -/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */ -/* OBSOLETE (read_register(R1_REGNUM) + 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Address of end of stack space. *x/ */ -/* OBSOLETE #define STACK_END_ADDR 0x7fffc000 */ -/* OBSOLETE */ -/* OBSOLETE /* Stack grows downward. *x/ */ -/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ -/* OBSOLETE */ -/* OBSOLETE /* Sequence of bytes for breakpoint instruction. */ -/* OBSOLETE This is padded out to the size of a machine word. When it was just */ -/* OBSOLETE {0x28, 0x09} it gave problems if hit breakpoint on returning from a */ -/* OBSOLETE function call. *x/ */ -/* OBSOLETE #define BREAKPOINT {0x28, 0x09, 0x0, 0x0} */ -/* OBSOLETE */ -/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */ -/* OBSOLETE This is often the number of bytes in BREAKPOINT */ -/* OBSOLETE but not always. *x/ */ -/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */ -/* OBSOLETE */ -/* OBSOLETE /* Return 1 if P points to an invalid floating point value. *x/ */ -/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */ -/* OBSOLETE */ -/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */ -/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */ -/* OBSOLETE real way to know how big a register is. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_SIZE 4 */ -/* OBSOLETE */ -/* OBSOLETE /* Size of bytes of vector register (NP1 only), 32 elements * sizeof(int) *x/ */ -/* OBSOLETE #define VR_SIZE 128 */ -/* OBSOLETE */ -/* OBSOLETE /* Number of machine registers *x/ */ -/* OBSOLETE #define NUM_REGS 27 */ -/* OBSOLETE #define NUM_GEN_REGS 16 */ -/* OBSOLETE #define NUM_CPU_REGS 4 */ -/* OBSOLETE #define NUM_VECTOR_REGS 7 */ -/* OBSOLETE */ -/* OBSOLETE /* Initializer for an array of names of registers. */ -/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */ -/* OBSOLETE #define REGISTER_NAMES { \ */ -/* OBSOLETE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ */ -/* OBSOLETE "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \ */ -/* OBSOLETE "sp", "ps", "pc", "ve", \ */ -/* OBSOLETE "v1", "v2", "v3", "v4", "v5", "v6", "v7", \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Register numbers of various important registers. */ -/* OBSOLETE Note that some of these values are "real" register numbers, */ -/* OBSOLETE and correspond to the general registers of the machine, */ -/* OBSOLETE and some are "phony" register numbers which are too large */ -/* OBSOLETE to be actual register numbers as far as the user is concerned */ -/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */ -/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */ -/* OBSOLETE #define R2_REGNUM 2 /* Gr2 => return value from function *x/ */ -/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */ -/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */ -/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */ -/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */ -/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */ -/* OBSOLETE #define SP_REGNUM 10 /* Br2 == (sp) *x/ */ -/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */ -/* OBSOLETE #define FP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */ -/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */ -/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */ -/* OBSOLETE #define VE_REGNUM 19 /* Vector end (user setup) register *x/ */ -/* OBSOLETE #define V1_REGNUM 20 /* First vector register *x/ */ -/* OBSOLETE #define V7_REGNUM 26 /* First vector register *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */ -/* OBSOLETE register state, the array `registers'. *x/ */ -/* OBSOLETE #define REGISTER_BYTES \ */ -/* OBSOLETE (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4) */ -/* OBSOLETE */ -/* OBSOLETE /* Index within `registers' of the first byte of the space for */ -/* OBSOLETE register N. *x/ */ -/* OBSOLETE #define REGISTER_BYTE(N) \ */ -/* OBSOLETE (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the actual machine representation */ -/* OBSOLETE for register N. On the NP1, all normal regs are 4 bytes, but */ -/* OBSOLETE the vector registers are VR_SIZE*4 bytes long. *x/ */ -/* OBSOLETE #define REGISTER_RAW_SIZE(N) \ */ -/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the program's representation */ -/* OBSOLETE for register N. On the NP1, all regs are 4 bytes. *x/ */ -/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) \ */ -/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */ -/* OBSOLETE #define MAX_REGISTER_RAW_SIZE VR_SIZE */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */ -/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE VR_SIZE */ -/* OBSOLETE */ -/* OBSOLETE /* Return the GDB type object for the "standard" data type */ -/* OBSOLETE of data in register N. *x/ */ -/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */ -/* OBSOLETE ((N) > VE_REGNUM ? builtin_type_np1_vector : builtin_type_int) */ -/* OBSOLETE extern struct type *builtin_type_np1_vector; */ -/* OBSOLETE */ -/* OBSOLETE /* Store the address of the place in which to copy the structure the */ -/* OBSOLETE subroutine will return. This is called from call_function. */ -/* OBSOLETE */ -/* OBSOLETE On this machine this is a no-op, because gcc isn't used on it */ -/* OBSOLETE yet. So this calling convention is not used. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) push_word(SP + 8, ADDR) */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an arrary REGBUF containing the (raw) register state */ -/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */ -/* OBSOLETE into VALBUF. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ -/* OBSOLETE memcpy (VALBUF, ((int *)(REGBUF)) + 2, TYPE_LENGTH (TYPE)) */ -/* OBSOLETE */ -/* OBSOLETE /* Write into appropriate registers a function return value */ -/* OBSOLETE of type TYPE, given in virtual format. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ -/* OBSOLETE write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF, \ */ -/* OBSOLETE TYPE_LENGTH (TYPE)) */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ -/* OBSOLETE the address in which a function should return its structure value, */ -/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*((int *)(REGBUF) + 2)) */ -/* OBSOLETE */ -/* OBSOLETE /* Both gcc and cc return small structs in registers (i.e. in GDB */ -/* OBSOLETE terminology, small structs don't use the struct return convention). *x/ */ -/* OBSOLETE extern use_struct_convention_fn gould_use_struct_convention; */ -/* OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) gould_use_struct_convention (gcc_p, type) */ -/* OBSOLETE */ -/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */ -/* OBSOLETE (its caller). *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */ -/* OBSOLETE and produces the frame's chain-pointer. */ -/* OBSOLETE */ -/* OBSOLETE However, if FRAME_CHAIN_VALID returns zero, */ -/* OBSOLETE it means the given frame is the outermost one and has no caller. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* In the case of the NPL, the frame's norminal address is Br2 and the */ -/* OBSOLETE previous routines frame is up the stack X bytes, where X is the */ -/* OBSOLETE value stored in the code function header xA(Br1). *x/ */ -/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */ -/* OBSOLETE */ -/* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */ -/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */ -/* OBSOLETE */ -/* OBSOLETE /* Define other aspects of the stack frame on NPL. *x/ */ -/* OBSOLETE #define FRAME_SAVED_PC(FRAME) \ */ -/* OBSOLETE (read_memory_integer ((FRAME)->frame + 8, 4)) */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */ -/* OBSOLETE ((fi)->next ? \ */ -/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */ -/* OBSOLETE read_register (AP_REGNUM)) */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) */ -/* OBSOLETE */ -/* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */ -/* OBSOLETE Can set VAL to -1, meaning no way to tell. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* We can check the stab info to see how */ -/* OBSOLETE many arg we have. No info in stack will tell us *x/ */ -/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */ -/* OBSOLETE */ -/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */ -/* OBSOLETE #define FRAME_ARGS_SKIP 8 */ -/* OBSOLETE */ -/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */ -/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */ -/* OBSOLETE This includes special registers such as pc and fp saved in special */ -/* OBSOLETE ways in the stack frame. sp is even more special: */ -/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */ -/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = framechain (frame_info); \ */ -/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */ -/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */ -/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */ -/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */ -/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */ -/* OBSOLETE #define NEED_TEXT_START_END 1 */ -/* OBSOLETE */ -/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define PUSH_DUMMY_FRAME \ */ -/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */ -/* OBSOLETE register int regnum; \ */ -/* OBSOLETE for (regnum = 0; regnum < FP_REGNUM; regnum++) \ */ -/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */ -/* OBSOLETE sp = push_word (sp, read_register (PS_REGNUM)); \ */ -/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */ -/* OBSOLETE write_register (SP_REGNUM, sp);} */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, */ -/* OBSOLETE restoring all saved registers. *x/ */ -/* OBSOLETE /* FIXME: Should be using {store,extract}_unsigned_integer. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define POP_FRAME \ */ -/* OBSOLETE { CORE_ADDR sp = read_register(SP_REGNUM); \ */ -/* OBSOLETE ULONGEST reg; \ */ -/* OBSOLETE int regnum; \ */ -/* OBSOLETE for(regnum = 0;regnum < FP_REGNUM;regnum++){ \ */ -/* OBSOLETE sp-=REGISTER_SIZE; \ */ -/* OBSOLETE read_memory(sp,®,REGISTER_SIZE); \ */ -/* OBSOLETE write_register(regnum,reg);} \ */ -/* OBSOLETE sp-=REGISTER_SIZE; \ */ -/* OBSOLETE read_memory(sp,®,REGISTER_SIZE); \ */ -/* OBSOLETE write_register(PS_REGNUM,reg); \ */ -/* OBSOLETE sp-=REGISTER_SIZE; \ */ -/* OBSOLETE read_memory(sp,®,REGISTER_SIZE); \ */ -/* OBSOLETE write_register(PC_REGNUM,reg);} */ -/* OBSOLETE */ -/* OBSOLETE /* MJD - Size of dummy frame pushed onto stack by PUSH_DUMMY_FRAME *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define DUMMY_FRAME_SIZE (0x48) */ -/* OBSOLETE */ -/* OBSOLETE /* MJD - The sequence of words in the instructions is */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE subr b2,stack size,0 grab stack space for dummy call */ -/* OBSOLETE labr b3,x0(b2),0 set AP_REGNUM to point at arguments */ -/* OBSOLETE lw r2,x8(b3),0 load r2 with first argument */ -/* OBSOLETE lwbr b1,arguments size(b2),0 load address of function to be called */ -/* OBSOLETE brlnk r1,x8(b1),0 call function */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE labr b2,stack size(b2),0 give back stack */ -/* OBSOLETE break break */ -/* OBSOLETE *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY {0x00000000, \ */ -/* OBSOLETE 0x00000000, \ */ -/* OBSOLETE 0x59000000, \ */ -/* OBSOLETE 0x598a0000, \ */ -/* OBSOLETE 0xb5030008, \ */ -/* OBSOLETE 0x5c820000, \ */ -/* OBSOLETE 0x44810008, \ */ -/* OBSOLETE 0x00000000, \ */ -/* OBSOLETE 0x590a0000, \ */ -/* OBSOLETE 0x28090000 } */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_LENGTH 40 */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_START_OFFSET 8 */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_STACK_ADJUST 8 */ -/* OBSOLETE */ -/* OBSOLETE /* MJD - Fixup CALL_DUMMY for the specific function call. */ -/* OBSOLETE OK heres the problems */ -/* OBSOLETE 1) On a trap there are two copies of the stack pointer, one in SP_REGNUM */ -/* OBSOLETE which is read/write and one in FP_REGNUM which is only read. It seems */ -/* OBSOLETE that when restarting the GOULD NP1 uses FP_REGNUM's value. */ -/* OBSOLETE 2) Loading function address into b1 looks a bit difficult if bigger than */ -/* OBSOLETE 0x0000fffc, infact from what I can tell the compiler sets up table of */ -/* OBSOLETE function address in base3 through which function calls are referenced. */ -/* OBSOLETE */ -/* OBSOLETE OK my solutions */ -/* OBSOLETE Calculate the size of the dummy stack frame and do adjustments of */ -/* OBSOLETE SP_REGNUM in the dummy call. */ -/* OBSOLETE Push function address onto the stack and load it in the dummy call */ -/* OBSOLETE *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, sp, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE { int i;\ */ -/* OBSOLETE int arg_len = 0, total_len;\ */ -/* OBSOLETE old_sp = push_word(old_sp,fun);\ */ -/* OBSOLETE for(i = nargs - 1;i >= 0;i--)\ */ -/* OBSOLETE arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\ */ -/* OBSOLETE if(struct_return)\ */ -/* OBSOLETE arg_len += TYPE_LENGTH(value_type);\ */ -/* OBSOLETE total_len = DUMMY_FRAME_SIZE+CALL_DUMMY_STACK_ADJUST+4+arg_len;\ */ -/* OBSOLETE dummyname[0] += total_len;\ */ -/* OBSOLETE dummyname[2] += total_len;\ */ -/* OBSOLETE dummyname[5] += arg_len+CALL_DUMMY_STACK_ADJUST;\ */ -/* OBSOLETE dummyname[8] += total_len;} */ -/* OBSOLETE */ -/* OBSOLETE /* MJD - So the stack should end up looking like this */ -/* OBSOLETE */ -/* OBSOLETE | Normal stack frame | */ -/* OBSOLETE | from normal program | */ -/* OBSOLETE | flow | */ -/* OBSOLETE +---------------------+ <- Final sp - 0x08 - argument size */ -/* OBSOLETE | | - 0x4 - dummy_frame_size */ -/* OBSOLETE | Pushed dummy frame | */ -/* OBSOLETE | b0-b7, r0-r7 | */ -/* OBSOLETE | pc and ps | */ -/* OBSOLETE | | */ -/* OBSOLETE +---------------------+ */ -/* OBSOLETE | Function address | */ -/* OBSOLETE +---------------------+ <- Final sp - 0x8 - arguments size */ -/* OBSOLETE | | */ -/* OBSOLETE | | */ -/* OBSOLETE | | */ -/* OBSOLETE | Arguments to | */ -/* OBSOLETE | Function | */ -/* OBSOLETE | | */ -/* OBSOLETE | | */ -/* OBSOLETE | | */ -/* OBSOLETE +---------------------+ <- Final sp - 0x8 */ -/* OBSOLETE | Dummy_stack_adjust | */ -/* OBSOLETE +---------------------+ <- Final sp */ -/* OBSOLETE | | */ -/* OBSOLETE | where call will | */ -/* OBSOLETE | build frame | */ -/* OBSOLETE *x/ */ diff --git a/gdb/config/gould/tm-pn.h b/gdb/config/gould/tm-pn.h deleted file mode 100644 index 3c6d174882b..00000000000 --- a/gdb/config/gould/tm-pn.h +++ /dev/null @@ -1,409 +0,0 @@ -/* OBSOLETE /* Parameters for targe of a Gould Powernode, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define GOULD_PN */ -/* OBSOLETE */ -/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */ -/* OBSOLETE */ -/* OBSOLETE /* This code appears in libraries on Gould machines. Ignore it. *x/ */ -/* OBSOLETE #define IGNORE_SYMBOL(type) (type == N_ENTRY) */ -/* OBSOLETE */ -/* OBSOLETE /* We don't want the extra gnu symbols on the machine; */ -/* OBSOLETE they will interfere with the shared segment symbols. *x/ */ -/* OBSOLETE #define NO_GNU_STABS */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for text-offset and data info (in PN a.out format). *x/ */ -/* OBSOLETE #define TEXTINFO \ */ -/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr); \ */ -/* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr) \ */ -/* OBSOLETE + exec_aouthdr.a_text */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for number of symbol table entries (this used to be checked */ -/* OBSOLETE in dbxread.c and caused the last psymtab to use this as the end of */ -/* OBSOLETE text. I'm not sure whether it would still be necessary). *x/ */ -/* OBSOLETE #define END_OF_TEXT_DEFAULT \ */ -/* OBSOLETE (0xffffff) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for number of symbol table entries *x/ */ -/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */ -/* OBSOLETE (coffhdr.f_nsyms) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for file-offset of symbol table (in usual a.out format). *x/ */ -/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */ -/* OBSOLETE N_SYMOFF (coffhdr) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro for file-offset of string table (in usual a.out format). *x/ */ -/* OBSOLETE #define STRING_TABLE_OFFSET \ */ -/* OBSOLETE (N_STROFF (coffhdr) + sizeof(int)) */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to store the length of the string table data in INTO. *x/ */ -/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */ -/* OBSOLETE { INTO = hdr.a_stsize; } */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to declare variables to hold the file's header data. *x/ */ -/* OBSOLETE #define DECLARE_FILE_HEADERS struct old_exec hdr; \ */ -/* OBSOLETE FILHDR coffhdr */ -/* OBSOLETE */ -/* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */ -/* OBSOLETE NAME is the file name, for error messages. *x/ */ -/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */ -/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */ -/* OBSOLETE if (val < 0) \ */ -/* OBSOLETE perror_with_name (NAME); \ */ -/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */ -/* OBSOLETE if (val < 0) \ */ -/* OBSOLETE perror_with_name (NAME); \ */ -/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */ -/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */ -/* OBSOLETE if (N_BADMAG (hdr)) \ */ -/* OBSOLETE error ("File \"%s\" not in executable format.", NAME); } */ -/* OBSOLETE */ -/* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */ -/* OBSOLETE #define NS32GMAGIC GDPMAGIC */ -/* OBSOLETE #define NS32SMAGIC PN_MAGIC */ -/* OBSOLETE */ -/* OBSOLETE /* Offset from address of function to start of its code. */ -/* OBSOLETE Zero on most machines. *x/ */ -/* OBSOLETE #define FUNCTION_START_OFFSET 4 */ -/* OBSOLETE */ -/* OBSOLETE /* Advance PC across any function entry prologue instructions */ -/* OBSOLETE to reach some "real" code. One PN we can have one or two startup */ -/* OBSOLETE sequences depending on the size of the local stack: */ -/* OBSOLETE */ -/* OBSOLETE Either: */ -/* OBSOLETE "suabr b2, #" */ -/* OBSOLETE of */ -/* OBSOLETE "lil r4, #", "suabr b2, #(r4)" */ -/* OBSOLETE */ -/* OBSOLETE "lwbr b6, #", "stw r1, 8(b2)" */ -/* OBSOLETE Optional "stwbr b3, c(b2)" */ -/* OBSOLETE Optional "trr r2,r7" (Gould first argument register passing) */ -/* OBSOLETE or */ -/* OBSOLETE Optional "stw r2,8(b3)" (Gould first argument register passing) */ -/* OBSOLETE *x/ */ -/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */ -/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x580B0000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xD4820008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0x5582000C) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xd5030008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xD4820008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0x5582000C) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 4); \ */ -/* OBSOLETE if (op == 0xd5030008) { \ */ -/* OBSOLETE pc += 4; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } else { \ */ -/* OBSOLETE op = read_memory_integer ((pc), 2); \ */ -/* OBSOLETE if (op == 0x2fa0) { \ */ -/* OBSOLETE pc += 2; \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Immediately after a function call, return the saved pc. */ -/* OBSOLETE Can't go through the frames for this because on some machines */ -/* OBSOLETE the new frame is not set up until the new function executes */ -/* OBSOLETE some instructions. True on PN! Return address is in R1. */ -/* OBSOLETE Note: true return location is 4 bytes past R1! *x/ */ -/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */ -/* OBSOLETE (read_register(R1_REGNUM) + 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Address of end of stack space. *x/ */ -/* OBSOLETE #define STACK_END_ADDR 0x480000 */ -/* OBSOLETE */ -/* OBSOLETE /* Stack grows downward. *x/ */ -/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ -/* OBSOLETE */ -/* OBSOLETE /* Sequence of bytes for breakpoint instruction. *x/ */ -/* OBSOLETE #define BREAKPOINT {0x28, 0x09} */ -/* OBSOLETE */ -/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */ -/* OBSOLETE This is often the number of bytes in BREAKPOINT */ -/* OBSOLETE but not always. *x/ */ -/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */ -/* OBSOLETE */ -/* OBSOLETE /* Return 1 if P points to an invalid floating point value. *x/ */ -/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */ -/* OBSOLETE */ -/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */ -/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */ -/* OBSOLETE real way to know how big a register is. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_SIZE 4 */ -/* OBSOLETE */ -/* OBSOLETE /* Number of machine registers *x/ */ -/* OBSOLETE #define NUM_REGS 19 */ -/* OBSOLETE #define NUM_GEN_REGS 16 */ -/* OBSOLETE #define NUM_CPU_REGS 3 */ -/* OBSOLETE */ -/* OBSOLETE /* Initializer for an array of names of registers. */ -/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */ -/* OBSOLETE #define REGISTER_NAMES { \ */ -/* OBSOLETE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ */ -/* OBSOLETE "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", \ */ -/* OBSOLETE "sp", "ps", "pc", \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Register numbers of various important registers. */ -/* OBSOLETE Note that some of these values are "real" register numbers, */ -/* OBSOLETE and correspond to the general registers of the machine, */ -/* OBSOLETE and some are "phony" register numbers which are too large */ -/* OBSOLETE to be actual register numbers as far as the user is concerned */ -/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */ -/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */ -/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */ -/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */ -/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */ -/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */ -/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */ -/* OBSOLETE #define FP_REGNUM 10 /* Br2 == (sp) *x/ */ -/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */ -/* OBSOLETE #define SP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */ -/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */ -/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */ -/* OBSOLETE register state, the array `registers'. *x/ */ -/* OBSOLETE #define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */ -/* OBSOLETE */ -/* OBSOLETE /* Index within `registers' of the first byte of the space for */ -/* OBSOLETE register N. *x/ */ -/* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the actual machine representation */ -/* OBSOLETE for register N. On the PN, all normal regs are 4 bytes. *x/ */ -/* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the program's representation */ -/* OBSOLETE for register N. On the PN, all regs are 4 bytes. *x/ */ -/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */ -/* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */ -/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (4) */ -/* OBSOLETE */ -/* OBSOLETE /* Return the GDB type object for the "standard" data type */ -/* OBSOLETE of data in register N. *x/ */ -/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) */ -/* OBSOLETE */ -/* OBSOLETE /* Store the address of the place in which to copy the structure the */ -/* OBSOLETE subroutine will return. This is called from call_function. */ -/* OBSOLETE */ -/* OBSOLETE On this machine this is a no-op, because gcc isn't used on it */ -/* OBSOLETE yet. So this calling convention is not used. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an arrary REGBUF containing the (raw) register state */ -/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */ -/* OBSOLETE into VALBUF. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ -/* OBSOLETE memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */ -/* OBSOLETE */ -/* OBSOLETE /* Write into appropriate registers a function return value */ -/* OBSOLETE of type TYPE, given in virtual format. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ -/* OBSOLETE write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ -/* OBSOLETE the address in which a function should return its structure value, */ -/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF)) */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */ -/* OBSOLETE (its caller). *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* FRAME_CHAIN takes a frame's nominal address */ -/* OBSOLETE and produces the frame's chain-pointer. */ -/* OBSOLETE */ -/* OBSOLETE However, if FRAME_CHAIN_VALID returns zero, */ -/* OBSOLETE it means the given frame is the outermost one and has no caller. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* In the case of the NPL, the frame's norminal address is Br2 and the */ -/* OBSOLETE previous routines frame is up the stack X bytes, where X is the */ -/* OBSOLETE value stored in the code function header xA(Br1). *x/ */ -/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */ -/* OBSOLETE */ -/* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */ -/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */ -/* OBSOLETE */ -/* OBSOLETE /* Define other aspects of the stack frame on NPL. *x/ */ -/* OBSOLETE #define FRAME_SAVED_PC(frame) \ */ -/* OBSOLETE (read_memory_integer ((frame)->frame + 8, 4)) */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */ -/* OBSOLETE ((fi)->next ? \ */ -/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */ -/* OBSOLETE read_register (AP_REGNUM)) */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame + 80) */ -/* OBSOLETE */ -/* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */ -/* OBSOLETE Can set VAL to -1, meaning no way to tell. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* We can check the stab info to see how */ -/* OBSOLETE many arg we have. No info in stack will tell us *x/ */ -/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */ -/* OBSOLETE */ -/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */ -/* OBSOLETE #define FRAME_ARGS_SKIP 8 */ -/* OBSOLETE */ -/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */ -/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */ -/* OBSOLETE This includes special registers such as pc and fp saved in special */ -/* OBSOLETE ways in the stack frame. sp is even more special: */ -/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */ -/* OBSOLETE { \ */ -/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */ -/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */ -/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */ -/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */ -/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */ -/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define PUSH_DUMMY_FRAME \ */ -/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */ -/* OBSOLETE register int regnum; \ */ -/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */ -/* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */ -/* OBSOLETE write_register (FP_REGNUM, sp); \ */ -/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */ -/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */ -/* OBSOLETE sp = push_word (sp, read_register (PS_REGNUM)); \ */ -/* OBSOLETE write_register (SP_REGNUM, sp); } */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, */ -/* OBSOLETE restoring all saved registers. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define POP_FRAME \ */ -/* OBSOLETE { register struct frame_info *frame = get_current_frame (); \ */ -/* OBSOLETE register CORE_ADDR fp; \ */ -/* OBSOLETE register int regnum; \ */ -/* OBSOLETE struct frame_saved_regs fsr; \ */ -/* OBSOLETE struct frame_info *fi; \ */ -/* OBSOLETE fp = frame->frame; \ */ -/* OBSOLETE get_frame_saved_regs (frame, &fsr); \ */ -/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */ -/* OBSOLETE if (fsr.regs[regnum]) \ */ -/* OBSOLETE write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ */ -/* OBSOLETE if (fsr.regs[PS_REGNUM]) \ */ -/* OBSOLETE write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \ */ -/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp, 4)); \ */ -/* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \ */ -/* OBSOLETE write_register (SP_REGNUM, fp + 8); \ */ -/* OBSOLETE flush_cached_frames (); \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* This sequence of words is the instructions: */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE suabr b2, # */ -/* OBSOLETE lwbr b6, #con */ -/* OBSOLETE stw r1, 8(b2) - save caller address, do we care? */ -/* OBSOLETE lw r2, 60(b2) - arg1 */ -/* OBSOLETE labr b3, 50(b2) */ -/* OBSOLETE std r4, 30(b2) - save r4-r7 */ -/* OBSOLETE std r6, 38(b2) */ -/* OBSOLETE lwbr b1, # - load function call address */ -/* OBSOLETE brlnk r1, 8(b1) - call function */ -/* OBSOLETE halt */ -/* OBSOLETE halt */ -/* OBSOLETE ld r4, 30(b2) - restore r4-r7 */ -/* OBSOLETE ld r6, 38(b2) */ -/* OBSOLETE */ -/* OBSOLETE Setup our stack frame, load argumemts, call and then restore registers. */ -/* OBSOLETE *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* FIXME: The below defines an m68k CALL_DUMMY, which looks nothing like what */ -/* OBSOLETE is documented above. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, 0x4e4f4e71} */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_LENGTH 28 */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY_START_OFFSET 12 */ -/* OBSOLETE */ -/* OBSOLETE /* Insert the specified number of args and function address */ -/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE { *(int *)((char *) dummyname + 20) = nargs * 4; \ */ -/* OBSOLETE *(int *)((char *) dummyname + 14) = fun; } */ diff --git a/gdb/config/gould/xm-np1.h b/gdb/config/gould/xm-np1.h deleted file mode 100644 index b7af92c8b1e..00000000000 --- a/gdb/config/gould/xm-np1.h +++ /dev/null @@ -1,94 +0,0 @@ -/* OBSOLETE /* Parameters for execution on a Gould NP1, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */ -/* OBSOLETE */ -/* OBSOLETE /* Address of U in kernel space *x/ */ -/* OBSOLETE #define KERNEL_U_ADDR 0x7fffc000 */ -/* OBSOLETE */ -/* OBSOLETE /* This is a piece of magic that is given a register number REGNO */ -/* OBSOLETE and as BLOCKEND the address in the system of the end of the user structure */ -/* OBSOLETE and stores in ADDR the address in the kernel or core dump */ -/* OBSOLETE of that register. *x/ */ -/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */ -/* OBSOLETE addr = blockend + regno * 4; \ */ -/* OBSOLETE if (regno == VE_REGNUM) addr = blockend - 9 * 4; \ */ -/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */ -/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */ -/* OBSOLETE if (regno == FP_REGNUM) addr = blockend - 6 * 4; \ */ -/* OBSOLETE if (regno >= V1_REGNUM) \ */ -/* OBSOLETE addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE; \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Don't try to write the frame pointer. *x/ */ -/* OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) == FP_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * No KDB support, Yet! *x/ */ -/* OBSOLETE /* Interface definitions for kernel debugger KDB. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Map machine fault codes into signal numbers. */ -/* OBSOLETE First subtract 0, divide by 4, then index in a table. */ -/* OBSOLETE Faults for which the entry in this table is 0 */ -/* OBSOLETE are not handled by KDB; the program's own trap handler */ -/* OBSOLETE gets to handle then. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FAULT_CODE_ORIGIN 0 */ -/* OBSOLETE #define FAULT_CODE_UNITS 4 */ -/* OBSOLETE #define FAULT_TABLE \ */ -/* OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ */ -/* OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ */ -/* OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ */ -/* OBSOLETE SIGILL } */ -/* OBSOLETE */ -/* OBSOLETE /* Start running with a stack stretching from BEG to END. */ -/* OBSOLETE BEG and END should be symbols meaningful to the assembler. */ -/* OBSOLETE This is used only for kdb. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define INIT_STACK(beg, end) \ */ -/* OBSOLETE { asm (".globl end"); \ */ -/* OBSOLETE asm ("movel $ end, sp"); \ */ -/* OBSOLETE asm ("clrl fp"); } */ -/* OBSOLETE */ -/* OBSOLETE /* Push the frame pointer register on the stack. *x/ */ -/* OBSOLETE #define PUSH_FRAME_PTR \ */ -/* OBSOLETE asm ("movel fp, -(sp)"); */ -/* OBSOLETE */ -/* OBSOLETE /* Copy the top-of-stack to the frame pointer register. *x/ */ -/* OBSOLETE #define POP_FRAME_PTR \ */ -/* OBSOLETE asm ("movl (sp), fp"); */ -/* OBSOLETE */ -/* OBSOLETE /* After KDB is entered by a fault, push all registers */ -/* OBSOLETE that GDB thinks about (all NUM_REGS of them), */ -/* OBSOLETE so that they appear in order of ascending GDB register number. */ -/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define PUSH_REGISTERS \ */ -/* OBSOLETE { asm ("clrw -(sp)"); \ */ -/* OBSOLETE asm ("pea 10(sp)"); \ */ -/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */ -/* OBSOLETE */ -/* OBSOLETE /* Assuming the registers (including processor status) have been */ -/* OBSOLETE pushed on the stack in order of ascending GDB register number, */ -/* OBSOLETE restore them and return to the address in the saved PC register. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define POP_REGISTERS \ */ -/* OBSOLETE { asm ("subil $8,28(sp)"); \ */ -/* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */ -/* OBSOLETE asm ("rte"); } */ diff --git a/gdb/config/gould/xm-pn.h b/gdb/config/gould/xm-pn.h deleted file mode 100644 index a59588b7958..00000000000 --- a/gdb/config/gould/xm-pn.h +++ /dev/null @@ -1,87 +0,0 @@ -/* OBSOLETE /* Parameters for execution on a Gould PN, for GDB, the GNU debugger. */ -/* OBSOLETE Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */ -/* OBSOLETE */ -/* OBSOLETE /* Address of U in kernel space *x/ */ -/* OBSOLETE #define KERNEL_U_ADDR 0x3fc000 */ -/* OBSOLETE */ -/* OBSOLETE /* This is a piece of magic that is given a register number REGNO */ -/* OBSOLETE and as BLOCKEND the address in the system of the end of the user structure */ -/* OBSOLETE and stores in ADDR the address in the kernel or core dump */ -/* OBSOLETE of that register. *x/ */ -/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */ -/* OBSOLETE addr = blockend + regno * 4; \ */ -/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */ -/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */ -/* OBSOLETE if (regno == SP_REGNUM) addr = blockend - 6 * 4; \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* No KDB support, Yet! *x/ */ -/* OBSOLETE /* Interface definitions for kernel debugger KDB. *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Map machine fault codes into signal numbers. */ -/* OBSOLETE First subtract 0, divide by 4, then index in a table. */ -/* OBSOLETE Faults for which the entry in this table is 0 */ -/* OBSOLETE are not handled by KDB; the program's own trap handler */ -/* OBSOLETE gets to handle then. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define FAULT_CODE_ORIGIN 0 */ -/* OBSOLETE #define FAULT_CODE_UNITS 4 */ -/* OBSOLETE #define FAULT_TABLE \ */ -/* OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ */ -/* OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ */ -/* OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ */ -/* OBSOLETE SIGILL } */ -/* OBSOLETE */ -/* OBSOLETE /* Start running with a stack stretching from BEG to END. */ -/* OBSOLETE BEG and END should be symbols meaningful to the assembler. */ -/* OBSOLETE This is used only for kdb. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define INIT_STACK(beg, end) \ */ -/* OBSOLETE { asm (".globl end"); \ */ -/* OBSOLETE asm ("movel $ end, sp"); \ */ -/* OBSOLETE asm ("clrl fp"); } */ -/* OBSOLETE */ -/* OBSOLETE /* Push the frame pointer register on the stack. *x/ */ -/* OBSOLETE #define PUSH_FRAME_PTR \ */ -/* OBSOLETE asm ("movel fp, -(sp)"); */ -/* OBSOLETE */ -/* OBSOLETE /* Copy the top-of-stack to the frame pointer register. *x/ */ -/* OBSOLETE #define POP_FRAME_PTR \ */ -/* OBSOLETE asm ("movl (sp), fp"); */ -/* OBSOLETE */ -/* OBSOLETE /* After KDB is entered by a fault, push all registers */ -/* OBSOLETE that GDB thinks about (all NUM_REGS of them), */ -/* OBSOLETE so that they appear in order of ascending GDB register number. */ -/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define PUSH_REGISTERS \ */ -/* OBSOLETE { asm ("clrw -(sp)"); \ */ -/* OBSOLETE asm ("pea 10(sp)"); \ */ -/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */ -/* OBSOLETE */ -/* OBSOLETE /* Assuming the registers (including processor status) have been */ -/* OBSOLETE pushed on the stack in order of ascending GDB register number, */ -/* OBSOLETE restore them and return to the address in the saved PC register. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #define POP_REGISTERS \ */ -/* OBSOLETE { asm ("subil $8,28(sp)"); \ */ -/* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */ -/* OBSOLETE asm ("rte"); } */ diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index 44b5e0d3e7a..27a79d7937e 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -50,7 +50,7 @@ extern int h8300smode; extern void h8300_init_extra_frame_info (); -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN #undef TARGET_INT_BIT @@ -159,7 +159,7 @@ extern char **h8300_register_names; /* FIXME: Won't work with both h8/300's. */ -extern void h8300_extract_return_value PARAMS ((struct type *, char *, char *)); +extern void h8300_extract_return_value (struct type *, char *, char *); #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ h8300_extract_return_value (TYPE, (char *)(REGBUF), (char *)(VALBUF)) @@ -168,7 +168,7 @@ extern void h8300_extract_return_value PARAMS ((struct type *, char *, char *)); in d0/d1. */ /* FIXME: Won't work with both h8/300's. */ -extern void h8300_store_return_value PARAMS ((struct type *, char *)); +extern void h8300_store_return_value (struct type *, char *); #define STORE_RETURN_VALUE(TYPE,VALBUF) \ h8300_store_return_value(TYPE, (char *) (VALBUF)) @@ -196,7 +196,7 @@ extern void h8300_store_return_value PARAMS ((struct type *, char *)); it means the given frame is the outermost one and has no caller. */ #define FRAME_CHAIN(FRAME) h8300_frame_chain(FRAME) -CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *)); +CORE_ADDR h8300_frame_chain (struct frame_info *); /* In the case of the H8/300, the frame's nominal address is the address of a 2-byte word containing the calling frame's address. */ @@ -278,12 +278,12 @@ typedef unsigned short INSN_WORD; #define CALL_DUMMY_START_OFFSET (0) #define CALL_DUMMY_BREAKPOINT_OFFSET (0) -extern CORE_ADDR h8300_push_arguments PARAMS ((int nargs, - struct value ** args, - CORE_ADDR sp, - unsigned char struct_return, - CORE_ADDR struct_addr)); -extern CORE_ADDR h8300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR h8300_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + unsigned char struct_return, + CORE_ADDR struct_addr); +extern CORE_ADDR h8300_push_return_address (CORE_ADDR, CORE_ADDR); #define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) #define FIX_CALL_DUMMY(DUMMY, START_SP, FUNADDR, NARGS, ARGS, TYPE, GCCP) diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index eb21a5c6fb1..00eb21826a1 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -22,7 +22,7 @@ #define GDB_TARGET_IS_H8500 -#define IEEE_FLOAT 1 +#define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ @@ -45,7 +45,7 @@ to reach some "real" code. */ #define SKIP_PROLOGUE(ip) (h8500_skip_prologue (ip)) -extern CORE_ADDR h8500_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR h8500_skip_prologue (CORE_ADDR); /* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines @@ -53,7 +53,7 @@ extern CORE_ADDR h8500_skip_prologue PARAMS ((CORE_ADDR)); some instructions. */ #define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call() -extern CORE_ADDR saved_pc_after_call PARAMS ((void)); +extern CORE_ADDR saved_pc_after_call (void); /* Stack grows downward. */ @@ -86,7 +86,7 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((void)); for register N. */ #define REGISTER_RAW_SIZE(N) h8500_register_size(N) -extern int h8500_register_size PARAMS ((int regno)); +extern int h8500_register_size (int regno); #define REGISTER_SIZE 4 @@ -104,7 +104,7 @@ extern int h8500_register_size PARAMS ((int regno)); of data in register N. */ #define REGISTER_VIRTUAL_TYPE(N) h8500_register_virtual_type(N) -extern struct type *h8500_register_virtual_type PARAMS ((int regno)); +extern struct type *h8500_register_virtual_type (int regno); /* Initializer for an array of names of registers. Entries beyond the first NUM_REGS are ignored. */ @@ -207,10 +207,10 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno)); #define FRAME_CHAIN(FRAME) h8500_frame_chain(FRAME) struct frame_info; -extern CORE_ADDR h8500_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR h8500_frame_chain (struct frame_info *); #define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME) -extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame)); +extern CORE_ADDR frame_saved_pc (struct frame_info *frame); #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) @@ -237,26 +237,27 @@ extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame)); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ frame_find_saved_regs(frame_info, &(frame_saved_regs)) struct frame_saved_regs; -extern void frame_find_saved_regs PARAMS ((struct frame_info * frame_info, struct frame_saved_regs * frame_saved_regs)); +extern void frame_find_saved_regs (struct frame_info *frame_info, + struct frame_saved_regs *frame_saved_regs); /* Discard from the stack the innermost frame, restoring all registers. */ #define POP_FRAME { h8500_pop_frame (); } -extern void h8500_pop_frame PARAMS ((void)); +extern void h8500_pop_frame (void); #define SHORT_INT_MAX 32767 #define SHORT_INT_MIN -32768 typedef unsigned short INSN_WORD; -extern CORE_ADDR h8500_addr_bits_remove PARAMS ((CORE_ADDR)); +extern CORE_ADDR h8500_addr_bits_remove (CORE_ADDR); #define ADDR_BITS_REMOVE(addr) h8500_addr_bits_remove (addr) #define read_memory_short(x) (read_memory_integer(x,2) & 0xffff) #define PRINT_REGISTER_HOOK(regno) print_register_hook(regno) -extern void print_register_hook PARAMS ((int)); +extern void print_register_hook (int); extern int minimum_mode; @@ -265,7 +266,7 @@ extern int minimum_mode; /* Fake variables to make it easy to use 24 bit register pointers */ #define IS_TRAPPED_INTERNALVAR h8500_is_trapped_internalvar -extern int h8500_is_trapped_internalvar PARAMS ((char *name)); +extern int h8500_is_trapped_internalvar (char *name); #define VALUE_OF_TRAPPED_INTERNALVAR h8500_value_of_trapped_internalvar extern struct value *h8500_value_of_trapped_internalvar ( /* struct internalvar *var */ ); @@ -273,14 +274,14 @@ extern struct value *h8500_value_of_trapped_internalvar ( /* struct internalvar #define SET_TRAPPED_INTERNALVAR h8500_set_trapped_internalvar extern void h8500_set_trapped_internalvar ( /* struct internalvar *var, value newval, int bitpos, int bitsize, int offset */ ); -extern CORE_ADDR h8500_read_sp PARAMS ((void)); -extern void h8500_write_sp PARAMS ((CORE_ADDR)); +extern CORE_ADDR h8500_read_sp (void); +extern void h8500_write_sp (CORE_ADDR); -extern CORE_ADDR h8500_read_fp PARAMS ((void)); -extern void h8500_write_fp PARAMS ((CORE_ADDR)); +extern CORE_ADDR h8500_read_fp (void); +extern void h8500_write_fp (CORE_ADDR); -extern CORE_ADDR h8500_read_pc PARAMS ((int)); -extern void h8500_write_pc PARAMS ((CORE_ADDR, int)); +extern CORE_ADDR h8500_read_pc (int); +extern void h8500_write_pc (CORE_ADDR, int); #define TARGET_READ_SP() h8500_read_sp() #define TARGET_WRITE_SP(x) h8500_write_sp(x) diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh index 499ed48f45f..243d0a60ad8 100644 --- a/gdb/config/i386/fbsd.mh +++ b/gdb/config/i386/fbsd.mh @@ -1,5 +1,6 @@ # Host: Intel 386 running FreeBSD XDEPFILES= ser-tcp.o -NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o core-aout.o i386b-nat.o -XM_FILE= xm-i386bsd.h +NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o \ + corelow.o core-aout.o core-regset.o i387-nat.o i386bsd-nat.o +XM_FILE= xm-fbsd.h NAT_FILE= nm-fbsd.h diff --git a/gdb/config/i386/fbsd.mt b/gdb/config/i386/fbsd.mt index e644f1c891b..aff2a154b7f 100644 --- a/gdb/config/i386/fbsd.mt +++ b/gdb/config/i386/fbsd.mt @@ -1,3 +1,3 @@ # Target: Intel 386 running FreeBSD -TDEPFILES= i386-tdep.o i387-tdep.o solib.o +TDEPFILES= i386-tdep.o i387-tdep.o TM_FILE= tm-fbsd.h diff --git a/gdb/config/i386/nbsd.mh b/gdb/config/i386/nbsd.mh index 061f1ebe075..aea6a77b347 100644 --- a/gdb/config/i386/nbsd.mh +++ b/gdb/config/i386/nbsd.mh @@ -1,5 +1,6 @@ # Host: Intel 386 running NetBSD XDEPFILES= ser-tcp.o -NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o i386nbsd-nat.o +NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \ + i386nbsd-nat.o solib.o XM_FILE= xm-nbsd.h NAT_FILE= nm-nbsd.h diff --git a/gdb/config/i386/nbsd.mt b/gdb/config/i386/nbsd.mt index f21a3188351..7564b73fe27 100644 --- a/gdb/config/i386/nbsd.mt +++ b/gdb/config/i386/nbsd.mt @@ -1,5 +1,5 @@ # Target: Intel 386 running NetBSD -TDEPFILES= i386-tdep.o i387-tdep.o solib.o +TDEPFILES= i386-tdep.o i387-tdep.o TM_FILE= tm-nbsd.h GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh new file mode 100644 index 00000000000..4c197541468 --- /dev/null +++ b/gdb/config/i386/nbsdelf.mh @@ -0,0 +1,6 @@ +# Host: Intel 386 running NetBSD +XDEPFILES= ser-tcp.o +NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \ + i386nbsd-nat.o solib.o +XM_FILE= xm-nbsd.h +NAT_FILE= nm-nbsdelf.h diff --git a/gdb/config/i386/nbsdelf.mt b/gdb/config/i386/nbsdelf.mt new file mode 100644 index 00000000000..278217332fe --- /dev/null +++ b/gdb/config/i386/nbsdelf.mt @@ -0,0 +1,5 @@ +# Target: Intel 386 running NetBSD +TDEPFILES= i386-tdep.o i387-tdep.o +TM_FILE= tm-nbsdelf.h + +GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/i386/nm-fbsd.h b/gdb/config/i386/nm-fbsd.h index a2d1e3d1da4..7f912e0cf5e 100644 --- a/gdb/config/i386/nm-fbsd.h +++ b/gdb/config/i386/nm-fbsd.h @@ -1,5 +1,5 @@ -/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB. - Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc. +/* Native-dependent definitions for FreeBSD/i386. + Copyright (C) 1986, 87, 89, 92, 96, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -18,11 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef NM_FREEBSD_H -#define NM_FREEBSD_H +#ifndef NM_FBSD_H +#define NM_FBSD_H -/* Be shared lib aware */ -#include "solib.h" +/* Type of the third argument to the `ptrace' system call. */ +#define PTRACE_ARG3_TYPE caddr_t + +/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ +#define FETCH_INFERIOR_REGISTERS + +/* We can attach and detach. */ +#define ATTACH_DETACH + + +/* Support for the user struct. */ + +/* Return the size of the user struct. */ + +#define KERNEL_U_SIZE kernel_u_size () +extern int kernel_u_size (void); /* This is the amount to subtract from u.u_ar0 to get the offset in the core file of the register values. */ @@ -31,14 +45,27 @@ #define KERNEL_U_ADDR USRSTACK #define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = i386_register_u_addr ((blockend),(regno)); + (addr) = register_u_addr ((blockend), (regno)) +extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno); + -extern int -i386_register_u_addr PARAMS ((int, int)); +/* Shared library support. */ -#define PTRACE_ARG3_TYPE char* +/* The FreeBSD uses the same condition to distinguish ELF + from a.out. ELF implies SVR4 shared libraries. */ +#if (defined (FREEBSD_ELF) || defined (__ELF__)) && !defined (FREEBSD_AOUT) +#define SVR4_SHARED_LIBS +#endif + +#include "solib.h" /* Support for shared libraries. */ +#ifdef SVR4_SHARED_LIBS +#include "elf/common.h" /* Additional ELF shared library info. */ +#endif + +#ifndef SVR4_SHARED_LIBS + +/* Make structure definitions match up with those expected in `solib.c'. */ -/* make structure definitions match up with those expected in solib.c */ #define link_object sod #define lo_name sod_name #define lo_library sod_library @@ -91,9 +118,6 @@ i386_register_u_addr PARAMS ((int, int)); #define ld_un d_un #define ld_2 d_sdt -/* Return sizeof user struct to callers in less machine dependent routines */ - -#define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +#endif /* !SVR4_SHARED_LIBS */ -#endif /* NM_FREEBSD_H */ +#endif /* NM_FBSD_H */ diff --git a/gdb/config/i386/nm-i386bsd.h b/gdb/config/i386/nm-i386bsd.h index 41a414c76ba..caa831fd80d 100644 --- a/gdb/config/i386/nm-i386bsd.h +++ b/gdb/config/i386/nm-i386bsd.h @@ -32,8 +32,7 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); -extern int -i386_register_u_addr PARAMS ((int, int)); +extern int i386_register_u_addr (int, int); #define PTRACE_ARG3_TYPE char* diff --git a/gdb/config/i386/nm-i386sco.h b/gdb/config/i386/nm-i386sco.h index 5b56ad6e21b..0bfdf4db226 100644 --- a/gdb/config/i386/nm-i386sco.h +++ b/gdb/config/i386/nm-i386sco.h @@ -33,8 +33,7 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); -extern int -i386_register_u_addr PARAMS ((int, int)); +extern int i386_register_u_addr (int, int); /* When calling functions on SCO, sometimes we get an error writing some of the segment registers. This would appear to be a kernel diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h index 2c4b4d4578e..7c947cf1b54 100644 --- a/gdb/config/i386/nm-i386sol2.h +++ b/gdb/config/i386/nm-i386sol2.h @@ -34,14 +34,24 @@ It will *NOT* be necessary for GDB to step over the watchpoint. */ #define HAVE_CONTINUABLE_WATCHPOINT -extern int procfs_stopped_by_watchpoint PARAMS ((int)); +/* Solaris x86 2.6 and 2.7 targets have a kernel bug when stepping + over an instruction that causes a page fault without triggering + a hardware watchpoint. The kernel properly notices that it shouldn't + stop, because the hardware watchpoint is not triggered, but it forgets + the step request and continues the program normally. + Work around the problem by removing hardware watchpoints if a step is + requested, GDB will check for a hardware watchpoint trigger after the + step anyway. */ +#define CANNOT_STEP_HW_WATCHPOINTS + +extern int procfs_stopped_by_watchpoint (int); #define STOPPED_BY_WATCHPOINT(W) \ procfs_stopped_by_watchpoint(inferior_pid) /* Use these macros for watchpoint insertion/deletion. */ /* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ -extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int)); +extern int procfs_set_watchpoint (int, CORE_ADDR, int, int, int); #define target_insert_watchpoint(ADDR, LEN, TYPE) \ procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 1) #define target_remove_watchpoint(ADDR, LEN, TYPE) \ diff --git a/gdb/config/i386/nm-i386v.h b/gdb/config/i386/nm-i386v.h index 76b526b5015..963c692a05a 100644 --- a/gdb/config/i386/nm-i386v.h +++ b/gdb/config/i386/nm-i386v.h @@ -33,5 +33,4 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); -extern int -i386_register_u_addr PARAMS ((int, int)); +extern int i386_register_u_addr (int, int); diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h index 1095fa0db62..f95c6fe5a79 100644 --- a/gdb/config/i386/nm-linux.h +++ b/gdb/config/i386/nm-linux.h @@ -28,7 +28,7 @@ /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); #define U_REGS_OFFSET 0 @@ -72,11 +72,11 @@ extern int kernel_u_size PARAMS ((void)); #define CANNOT_FETCH_REGISTER(regno) ((regno) >= NUM_GREGS) #define CANNOT_STORE_REGISTER(regno) CANNOT_FETCH_REGISTER (regno) -extern CORE_ADDR - i386_stopped_by_watchpoint PARAMS ((int)); -extern int -i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw)); -extern int -i386_remove_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len)); +/* Override child_resume in `infptrace.c'. */ +#define CHILD_RESUME + +extern CORE_ADDR i386_stopped_by_watchpoint (int); +extern int i386_insert_watchpoint (int pid, CORE_ADDR addr, int len, int rw); +extern int i386_remove_watchpoint (int pid, CORE_ADDR addr, int len); #endif /* #ifndef NM_LINUX_H */ diff --git a/gdb/config/i386/nm-nbsd.h b/gdb/config/i386/nm-nbsd.h index 22a3434bb45..7de72e89458 100644 --- a/gdb/config/i386/nm-nbsd.h +++ b/gdb/config/i386/nm-nbsd.h @@ -22,12 +22,11 @@ #define NM_NBSD_H /* Get generic NetBSD native definitions. */ -#include "nm-nbsd.h" +#include "config/nm-nbsd.h" #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = i386_register_u_addr ((blockend),(regno)); -extern int -i386_register_u_addr PARAMS ((int, int)); +extern int i386_register_u_addr (int, int); #endif /* NM_NBSD_H */ diff --git a/gdb/config/i386/nm-nbsdelf.h b/gdb/config/i386/nm-nbsdelf.h new file mode 100644 index 00000000000..b06c1ec3845 --- /dev/null +++ b/gdb/config/i386/nm-nbsdelf.h @@ -0,0 +1,27 @@ +/* Native-dependent definitions for Intel 386 running NetBSD, for GDB. + Copyright 1986, 1987, 1989, 1992, 1994 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 NM_NBSDELF_H +#define NM_NBSDELF_H + +#define SVR4_SHARED_LIBS +#include "i386/nm-nbsd.h" + +#endif /* NM_NBSDELF_H */ diff --git a/gdb/config/i386/nm-ptx4.h b/gdb/config/i386/nm-ptx4.h index 289ffe06752..99428665179 100644 --- a/gdb/config/i386/nm-ptx4.h +++ b/gdb/config/i386/nm-ptx4.h @@ -39,7 +39,7 @@ #define CHILD_WAIT struct target_waitstatus; -extern int child_wait PARAMS ((int, struct target_waitstatus *)); +extern int child_wait (int, struct target_waitstatus *); /* * ptx does attach as of ptx version 2.1. Prior to that, the interface diff --git a/gdb/config/i386/nm-symmetry.h b/gdb/config/i386/nm-symmetry.h index 781adf2aedd..a672d94304f 100644 --- a/gdb/config/i386/nm-symmetry.h +++ b/gdb/config/i386/nm-symmetry.h @@ -29,7 +29,7 @@ #ifdef _SEQUENT_ #define CHILD_WAIT -extern int child_wait PARAMS ((int, struct target_waitstatus *)); +extern int child_wait (int, struct target_waitstatus *); #endif /* This is the amount to subtract from u.u_ar0 diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h index d726328448b..5ae97bbf872 100644 --- a/gdb/config/i386/tm-cygwin.h +++ b/gdb/config/i386/tm-cygwin.h @@ -24,8 +24,20 @@ #include "i386/tm-i386v.h" +#if 0 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name) #define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0) -extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR pc, char *name)); - -extern char *cygwin_pid_to_str PARAMS ((int pid)); +extern CORE_ADDR skip_trampoline_code (CORE_ADDR pc, char *name); +#endif + +#define SOLIB_ADD(filename, from_tty, targ) child_solib_add(filename, from_tty, targ) +#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid) +#define CLEAR_SOLIB child_clear_solib +#define ADD_SHARED_SYMBOL_FILES dll_symbol_command + +struct target_ops; +char *cygwin_pid_to_str (int pid); +void child_solib_add (char *, int, struct target_ops *); +char *child_solib_loaded_library_pathname(int); +void child_clear_solib (void); +void dll_symbol_command (char *, int); diff --git a/gdb/config/i386/tm-fbsd.h b/gdb/config/i386/tm-fbsd.h index 0e2df32c52b..df278a802fb 100644 --- a/gdb/config/i386/tm-fbsd.h +++ b/gdb/config/i386/tm-fbsd.h @@ -1,5 +1,5 @@ -/* Target macro definitions for i386 running FreeBSD - Copyright (C) 1997 Free Software Foundation, Inc. +/* Target-dependent definitions for FreeBSD/i386. + Copyright (C) 1997, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -18,16 +18,54 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "i386/tm-i386bsd.h" +#ifndef TM_FBSD_H +#define TM_FBSD_H +#define HAVE_I387_REGS +#include "i386/tm-i386.h" -#undef NUM_REGS -#define NUM_REGS 14 +/* FreeBSD uses the old gcc convention for struct returns. */ +#define USE_STRUCT_CONVENTION(gcc_p, type) \ + generic_use_struct_convention (1, type) + -#undef IN_SOLIB_CALL_TRAMPOLINE -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) STREQ (name, "_DYNAMIC") +/* Support for longjmp. */ +/* Details about jmp_buf. It's supposed to be an array of integers. */ -extern i386_float_info (); -#define FLOAT_INFO i386_float_info () +#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */ +#define JB_PC 0 /* Array index of saved PC. */ + +/* Figure out where the longjmp will land. Store the address that + longjmp will jump to in *ADDR, and return non-zero if successful. */ + +extern int get_longjmp_target (CORE_ADDR *addr); +#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr) + + +/* Support for signal handlers. */ + +/* The sigtramp is above the user stack and immediately below + the user area. Using constants here allows for cross debugging. + These are tested for FreeBSD 3.4. */ + +#define SIGTRAMP_START(pc) 0xbfbfdf20 +#define SIGTRAMP_END(pc) 0xbfbfdff0 + +/* Offset to saved PC in sigcontext, from . */ +#define SIGCONTEXT_PC_OFFSET 20 + + +/* Shared library support. */ + +#ifndef SVR4_SHARED_LIBS + +/* Return non-zero if we are in a shared library trampoline code stub. */ + +#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ + (name && !strcmp(name, "_DYNAMIC")) + +#endif /* !SVR4_SHARED_LIBS */ + +#endif /* TM_FBSD_H */ diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index bcb99fced41..918d62afeb1 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -44,7 +44,7 @@ struct type; /* Used for example in valprint.c:print_floating() to enable checking for NaN's */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 @@ -62,7 +62,7 @@ struct type; #define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc)) -extern int i386_skip_prologue PARAMS ((int)); +extern int i386_skip_prologue (int); /* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines the new frame is not @@ -344,7 +344,7 @@ extern void i386_extract_return_value (struct type *type, char *regbuf, : read_memory_integer ((FRAME)->frame + 4, 4)) \ ) -extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) @@ -355,7 +355,7 @@ extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *)); #define FRAME_NUM_ARGS(fi) (i386_frame_num_args(fi)) -extern int i386_frame_num_args PARAMS ((struct frame_info *)); +extern int i386_frame_num_args (struct frame_info *); /* Return number of bytes at start of arglist that are not really args. */ @@ -367,7 +367,7 @@ extern int i386_frame_num_args PARAMS ((struct frame_info *)); ways in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -extern void i386_frame_init_saved_regs PARAMS ((struct frame_info *)); +extern void i386_frame_init_saved_regs (struct frame_info *); #define FRAME_INIT_SAVED_REGS(FI) i386_frame_init_saved_regs (FI) @@ -383,13 +383,13 @@ extern void i386_frame_init_saved_regs PARAMS ((struct frame_info *)); #define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); } -extern void i386_push_dummy_frame PARAMS ((void)); +extern void i386_push_dummy_frame (void); /* Discard from the stack the innermost frame, restoring all registers. */ #define POP_FRAME { i386_pop_frame (); } -extern void i386_pop_frame PARAMS ((void)); +extern void i386_pop_frame (void); /* this is @@ -421,8 +421,8 @@ extern void i386_pop_frame PARAMS ((void)); *((char *)(dummyname) + 4) = ((delta >> 24) & 0xff); \ } -extern void print_387_control_word PARAMS ((unsigned int)); -extern void print_387_status_word PARAMS ((unsigned int)); +extern void print_387_control_word (unsigned int); +extern void print_387_status_word (unsigned int); /* Offset from SP to first arg on stack at first instruction of a function */ diff --git a/gdb/config/i386/tm-i386nw.h b/gdb/config/i386/tm-i386nw.h index d61934ae06f..75dbc5548fe 100644 --- a/gdb/config/i386/tm-i386nw.h +++ b/gdb/config/i386/tm-i386nw.h @@ -41,8 +41,7 @@ we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/i386/tm-i386sol2.h b/gdb/config/i386/tm-i386sol2.h index da231eb8301..28521fc29d6 100644 --- a/gdb/config/i386/tm-i386sol2.h +++ b/gdb/config/i386/tm-i386sol2.h @@ -21,8 +21,17 @@ #ifndef TM_I386SOL2_H #define TM_I386SOL2_H 1 +#define HAVE_I387_REGS #include "i386/tm-i386v4.h" +/* If the current gcc for for this target does not produce correct + debugging information for float parameters, both prototyped and + unprototyped, then define this macro. This forces gdb to always + assume that floats are passed as doubles and then converted in the + callee. */ + +#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) + /* Signal handler frames under Solaris 2 are recognized by a return address of 0xFFFFFFFF, the third parameter on the signal handler stack is a pointer to an ucontext. */ @@ -36,7 +45,7 @@ and for SunPRO 3.0, N_FUN symbols too. */ #define SOFUN_ADDRESS_MAYBE_MISSING -extern char *sunpro_static_transform_name PARAMS ((char *)); +extern char *sunpro_static_transform_name (char *); #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x) #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '.') diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h index 5e7826d231b..9635e991372 100644 --- a/gdb/config/i386/tm-i386v.h +++ b/gdb/config/i386/tm-i386v.h @@ -90,7 +90,6 @@ struct frame_info; struct frame_saved_regs; -extern int -i386_frame_num_args PARAMS ((struct frame_info *)); +extern int i386_frame_num_args (struct frame_info *); #endif /* ifndef TM_I386V_H */ diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h index cdda76d7488..04d90d471dd 100644 --- a/gdb/config/i386/tm-i386v4.h +++ b/gdb/config/i386/tm-i386v4.h @@ -55,8 +55,7 @@ we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) @@ -74,6 +73,6 @@ get_longjmp_target PARAMS ((CORE_ADDR *)); /* Saved Pc. Get it from ucontext if within sigtramp. */ #define sigtramp_saved_pc i386v4_sigtramp_saved_pc -extern CORE_ADDR i386v4_sigtramp_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR i386v4_sigtramp_saved_pc (struct frame_info *); #endif /* ifndef TM_I386V4_H */ diff --git a/gdb/config/i386/tm-nbsd.h b/gdb/config/i386/tm-nbsd.h index 66002ed2c09..a24ac0d69a9 100644 --- a/gdb/config/i386/tm-nbsd.h +++ b/gdb/config/i386/tm-nbsd.h @@ -1,5 +1,5 @@ /* Macro definitions for i386 running under NetBSD. - Copyright 1994 Free Software Foundation, Inc. + Copyright 1994, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -23,8 +23,8 @@ #define HAVE_I387_REGS -#include "i386/tm-i386bsd.h" -#include "tm-nbsd.h" +#include "i386/tm-i386.h" +#include "config/tm-nbsd.h" extern use_struct_convention_fn i386nbsd_use_struct_convention; #define USE_STRUCT_CONVENTION(gcc_p, type) \ @@ -39,9 +39,20 @@ extern use_struct_convention_fn i386nbsd_use_struct_convention; we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +/* Support for signal handlers. */ + +/* The sigtramp is above the user stack and immediately below the + user area. Using constants here allows for cross debugging. */ + +#define SIGTRAMP_START(pc) 0xbfbfdf20 +#define SIGTRAMP_END(pc) 0xbfbfdff0 + +/* Offset to saved PC in sigcontext, from . */ +#define SIGCONTEXT_PC_OFFSET 20 + #endif /* TM_NBSD_H */ diff --git a/gdb/config/i386/tm-nbsdelf.h b/gdb/config/i386/tm-nbsdelf.h new file mode 100644 index 00000000000..4d802c5302d --- /dev/null +++ b/gdb/config/i386/tm-nbsdelf.h @@ -0,0 +1,28 @@ +/* Macro definitions for i386 running under NetBSD. + Copyright 2000 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 TM_NBSDELF_H +#define TM_NBSDELF_H + +#include "i386/tm-nbsd.h" + +#undef USE_STRUCT_CONVENTION + +#endif /* TM_NBSD_H */ diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h index 14491a4dd2c..99abd0b8cd9 100644 --- a/gdb/config/i386/tm-ptx.h +++ b/gdb/config/i386/tm-ptx.h @@ -139,8 +139,7 @@ since it uses host specific ptrace calls. #define REGISTER_U_ADDR(addr, blockend, regno) \ { (addr) = ptx_register_u_addr((blockend), (regno)); } -extern int -ptx_register_u_addr PARAMS ((int, int)); +extern int ptx_register_u_addr (int, int); /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. 10 i*86 registers, 8 i387 diff --git a/gdb/config/i386/tm-sun386.h b/gdb/config/i386/tm-sun386.h index a4ef54cc0e9..d8f41f5fbfb 100644 --- a/gdb/config/i386/tm-sun386.h +++ b/gdb/config/i386/tm-sun386.h @@ -130,8 +130,7 @@ i387_to_double ((FROM), (char *)&val); \ store_floating ((TO), TYPE_LENGTH (TYPE), val); \ } -extern void -i387_to_double PARAMS ((char *, char *)); +extern void i387_to_double (char *, char *); /* Convert data from virtual format with type TYPE in buffer FROM to raw format for register REGNUM in buffer TO. */ @@ -142,8 +141,7 @@ i387_to_double PARAMS ((char *, char *)); double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ double_to_i387((char *)&val, (TO)); \ } -extern void -double_to_i387 PARAMS ((char *, char *)); +extern void double_to_i387 (char *, char *); /* Return the GDB type object for the "standard" data type of data in register N. */ diff --git a/gdb/config/i386/xm-fbsd.h b/gdb/config/i386/xm-fbsd.h new file mode 100644 index 00000000000..ee90c14575f --- /dev/null +++ b/gdb/config/i386/xm-fbsd.h @@ -0,0 +1,28 @@ +/* Host-dependent definitions for FreeBSD/i386. + Copyright (C) 2000 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 XM_FBSD_H +#define XM_FBSD_H + +#define HOST_BYTE_ORDER LITTLE_ENDIAN + +#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext + +#endif /* XM_FBSD_H */ diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index 73bb8dbfff4..1c25118d791 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -40,7 +40,7 @@ /* We have IEEE floating point, if we have any float at all. */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ diff --git a/gdb/config/i960/tm-mon960.h b/gdb/config/i960/tm-mon960.h index 61b937e5c54..adb6e3db6c8 100644 --- a/gdb/config/i960/tm-mon960.h +++ b/gdb/config/i960/tm-mon960.h @@ -55,7 +55,7 @@ struct frame_info; since it differs between Nindy, Mon960 and VxWorks, the currently supported target types. */ -extern int mon960_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *); #define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe) /* Sequence of bytes for breakpoint instruction */ diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h index d57a6974c38..8fc26832f9f 100644 --- a/gdb/config/i960/tm-nindy960.h +++ b/gdb/config/i960/tm-nindy960.h @@ -89,7 +89,7 @@ extern void since it differs between NINDY and VxWorks, the two currently supported targets types. */ -extern int nindy_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *); #define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe) extern int diff --git a/gdb/config/ia64/linux.mt b/gdb/config/ia64/linux.mt index e688b461d77..8e5b91000b6 100644 --- a/gdb/config/ia64/linux.mt +++ b/gdb/config/ia64/linux.mt @@ -1,5 +1,5 @@ # Target: Intel IA-64 running GNU/Linux -TDEPFILES= ia64-tdep.o +TDEPFILES= ia64-tdep.o ia64-linux-tdep.o TM_FILE= tm-linux.h GDBSERVER_DEPFILES= low-linux.o diff --git a/gdb/config/ia64/nm-linux.h b/gdb/config/ia64/nm-linux.h index afb86751a3a..90777251ddd 100644 --- a/gdb/config/ia64/nm-linux.h +++ b/gdb/config/ia64/nm-linux.h @@ -44,4 +44,33 @@ extern int ia64_register_u_addr(int, int); #define PTRACE_ARG3_TYPE long #define PTRACE_XFER_TYPE long +/* Hardware watchpoints */ + +#define TARGET_HAS_HARDWARE_WATCHPOINTS + +#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 + +/* The IA-64 architecture can step over a watch point (without triggering + it again) if the "dd" (data debug fault disable) bit in the processor + status word is set. + + This PSR bit is set in ia64_linux_stopped_by_watchpoint when the + code there has determined that a hardware watchpoint has indeed + been hit. The CPU will then be able to execute one instruction + without triggering a watchpoint. */ +#define HAVE_STEPPABLE_WATCHPOINT 1 + +#define STOPPED_BY_WATCHPOINT(W) \ + ia64_linux_stopped_by_watchpoint (inferior_pid) +extern CORE_ADDR ia64_linux_stopped_by_watchpoint (int); + +#define target_insert_watchpoint(addr, len, type) \ + ia64_linux_insert_watchpoint (inferior_pid, addr, len, type) +extern int ia64_linux_insert_watchpoint (int pid, CORE_ADDR addr, + int len, int rw); + +#define target_remove_watchpoint(addr, len, type) \ + ia64_linux_remove_watchpoint (inferior_pid, addr, len) +extern int ia64_linux_remove_watchpoint (int pid, CORE_ADDR addr, int len); + #endif /* #ifndef NM_LINUX_H */ diff --git a/gdb/config/ia64/tm-linux.h b/gdb/config/ia64/tm-linux.h index 6bae759418d..79a664f2fb2 100644 --- a/gdb/config/ia64/tm-linux.h +++ b/gdb/config/ia64/tm-linux.h @@ -28,4 +28,7 @@ #define TARGET_ELF64 +extern int ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name); +#define IN_SIGTRAMP(pc,func_name) ia64_linux_in_sigtramp (pc, func_name) + #endif /* #ifndef TM_LINUX_H */ diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index a68720a984e..208522f2cea 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -107,15 +107,15 @@ struct value; int using_frame_pointer; -extern void m32r_init_extra_frame_info PARAMS ((struct frame_info * fi)); +extern void m32r_init_extra_frame_info (struct frame_info *fi); /* mvs_check INIT_EXTRA_FRAME_INFO */ #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) m32r_init_extra_frame_info (fi) /* mvs_no_check INIT_FRAME_PC */ #define INIT_FRAME_PC /* Not necessary */ extern void -m32r_frame_find_saved_regs PARAMS ((struct frame_info * fi, - struct frame_saved_regs * regaddr)); +m32r_frame_find_saved_regs (struct frame_info *fi, + struct frame_saved_regs *regaddr); /* Put here the code to store, into a struct frame_saved_regs, the addresses of the saved registers of frame described by FRAME_INFO. @@ -127,15 +127,14 @@ m32r_frame_find_saved_regs PARAMS ((struct frame_info * fi, #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ m32r_frame_find_saved_regs(frame_info, &(frame_saved_regs)) -extern CORE_ADDR m32r_frame_chain PARAMS ((struct frame_info * fi)); +extern CORE_ADDR m32r_frame_chain (struct frame_info *fi); /* mvs_check FRAME_CHAIN */ #define FRAME_CHAIN(fi) m32r_frame_chain (fi) #define FRAME_CHAIN_VALID(fp, frame) generic_file_frame_chain_valid (fp, frame) -extern CORE_ADDR m32r_find_callers_reg PARAMS ((struct frame_info * fi, - int regnum)); -extern CORE_ADDR m32r_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR m32r_find_callers_reg (struct frame_info *fi, int regnum); +extern CORE_ADDR m32r_frame_saved_pc (struct frame_info *); /* mvs_check FRAME_SAVED_PC */ #define FRAME_SAVED_PC(fi) m32r_frame_saved_pc (fi) @@ -152,7 +151,7 @@ extern CORE_ADDR m32r_frame_saved_pc PARAMS ((struct frame_info *)); ((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\ (VALBUF), TYPE_LENGTH (TYPE)); -extern CORE_ADDR m32r_skip_prologue PARAMS ((CORE_ADDR pc)); +extern CORE_ADDR m32r_skip_prologue (CORE_ADDR pc); /* mvs_check SKIP_PROLOGUE */ #define SKIP_PROLOGUE(pc) (m32r_skip_prologue (pc)) @@ -198,19 +197,19 @@ extern use_struct_convention_fn m32r_use_struct_convention; /* target-specific dummy_frame stuff */ -extern struct frame_info *m32r_pop_frame PARAMS ((struct frame_info * frame)); +extern struct frame_info *m32r_pop_frame (struct frame_info *frame); /* mvs_check POP_FRAME */ #define POP_FRAME m32r_pop_frame (get_current_frame ()) /* mvs_no_check STACK_ALIGN */ /* #define STACK_ALIGN(x) ((x + 3) & ~3) */ -extern CORE_ADDR m32r_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); -extern CORE_ADDR m32r_push_arguments PARAMS ((int nargs, - struct value ** args, - CORE_ADDR sp, - unsigned char struct_return, - CORE_ADDR struct_addr)); +extern CORE_ADDR m32r_push_return_address (CORE_ADDR, CORE_ADDR); +extern CORE_ADDR m32r_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + unsigned char struct_return, + CORE_ADDR struct_addr); diff --git a/gdb/config/m68k/nbsd.mh b/gdb/config/m68k/nbsd.mh index a9e39425c99..2d117091ef5 100644 --- a/gdb/config/m68k/nbsd.mh +++ b/gdb/config/m68k/nbsd.mh @@ -1,5 +1,6 @@ # Host: Motorola m68k running NetBSD XDEPFILES= ser-tcp.o -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o m68knbsd-nat.o +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \ + m68knbsd-nat.o solib.o XM_FILE= xm-nbsd.h NAT_FILE= nm-nbsd.h diff --git a/gdb/config/m68k/nbsd.mt b/gdb/config/m68k/nbsd.mt index 1ad2882681f..ab0deaa79dd 100644 --- a/gdb/config/m68k/nbsd.mt +++ b/gdb/config/m68k/nbsd.mt @@ -1,3 +1,3 @@ # Target: Motorola m68k running NetBSD -TDEPFILES= m68k-tdep.o solib.o +TDEPFILES= m68k-tdep.o TM_FILE= tm-nbsd.h diff --git a/gdb/config/m68k/nm-dpx2.h b/gdb/config/m68k/nm-dpx2.h index b24e7c282bc..36389473c95 100644 --- a/gdb/config/m68k/nm-dpx2.h +++ b/gdb/config/m68k/nm-dpx2.h @@ -23,8 +23,7 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = dpx2_register_u_addr ((blockend),(regno)); -extern int -dpx2_register_u_addr PARAMS ((int, int)); +extern int dpx2_register_u_addr (int, int); /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ #define ONE_PROCESS_WRITETEXT diff --git a/gdb/config/m68k/nm-linux.h b/gdb/config/m68k/nm-linux.h index e5846c6d2bf..3f0d2dd5522 100644 --- a/gdb/config/m68k/nm-linux.h +++ b/gdb/config/m68k/nm-linux.h @@ -26,14 +26,13 @@ /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); #define U_REGS_OFFSET 0 #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = m68k_linux_register_u_addr ((blockend),(regno)); -extern int -m68k_linux_register_u_addr PARAMS ((int, int)); +extern int m68k_linux_register_u_addr (int, int); #endif /* #ifndef NM_LINUX_H */ diff --git a/gdb/config/m68k/tm-altos.h b/gdb/config/m68k/tm-altos.h index 4483aa00df1..26a03023949 100644 Binary files a/gdb/config/m68k/tm-altos.h and b/gdb/config/m68k/tm-altos.h differ diff --git a/gdb/config/m68k/tm-cisco.h b/gdb/config/m68k/tm-cisco.h index ae8de6602e5..e27432df395 100644 --- a/gdb/config/m68k/tm-cisco.h +++ b/gdb/config/m68k/tm-cisco.h @@ -48,7 +48,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* BFD handles finding the registers in the core file, so they are at the start of the BFD .reg section. */ diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h index 745bd00dbb0..b4de935bee3 100644 --- a/gdb/config/m68k/tm-delta68.h +++ b/gdb/config/m68k/tm-delta68.h @@ -76,7 +76,7 @@ /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ -extern int delta68_frame_num_args PARAMS ((struct frame_info * fi)); +extern int delta68_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi))) /* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear @@ -93,13 +93,13 @@ extern int delta68_frame_num_args PARAMS ((struct frame_info * fi)); #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\ (*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4)) -extern int delta68_in_sigtramp PARAMS ((CORE_ADDR pc, char * name)); +extern int delta68_in_sigtramp (CORE_ADDR pc, char *name); #define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name) -extern CORE_ADDR delta68_frame_saved_pc PARAMS ((struct frame_info * fi)); +extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi); #undef FRAME_SAVED_PC #define FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi) -extern CORE_ADDR delta68_frame_args_address PARAMS ((struct frame_info * fi)); +extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi); #undef FRAME_ARGS_ADDRESS #define FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi) diff --git a/gdb/config/m68k/tm-es1800.h b/gdb/config/m68k/tm-es1800.h index ad1f2352ee3..b6f1588642a 100644 --- a/gdb/config/m68k/tm-es1800.h +++ b/gdb/config/m68k/tm-es1800.h @@ -57,4 +57,4 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); diff --git a/gdb/config/m68k/tm-isi.h b/gdb/config/m68k/tm-isi.h index 1442d178f5b..f11b823a2a0 100644 --- a/gdb/config/m68k/tm-isi.h +++ b/gdb/config/m68k/tm-isi.h @@ -42,7 +42,7 @@ /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ -extern int isi_frame_num_args PARAMS ((struct frame_info * fi)); +extern int isi_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (isi_frame_num_args ((fi))) /* Put here the code to store, into a struct frame_saved_regs, @@ -122,7 +122,7 @@ retry: \ /* The only reason this is here is the tm-isi.h reference below. It was moved back here from tm-m68k.h. FIXME? */ -extern CORE_ADDR isi_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR isi_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (isi_skip_prologue (pc)) #include "m68k/tm-m68k.h" diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h index ccf4a7ac08e..1d47d468c17 100644 --- a/gdb/config/m68k/tm-linux.h +++ b/gdb/config/m68k/tm-linux.h @@ -104,7 +104,7 @@ ? sigtramp_saved_pc (FRAME) \ : read_memory_integer ((FRAME)->frame + 4, 4))) -extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); #define IN_SIGTRAMP(pc,name) in_sigtramp (pc) -extern int in_sigtramp PARAMS ((CORE_ADDR pc)); +extern int in_sigtramp (CORE_ADDR pc); diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index c3574ee0a9a..38068c66f33 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -20,7 +20,7 @@ /* Generic 68000 stuff, to be included by other tm-*.h files. */ -#define IEEE_FLOAT 1 +#define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ #define TARGET_BYTE_ORDER BIG_ENDIAN @@ -36,7 +36,7 @@ #if !defined(SKIP_PROLOGUE) #define SKIP_PROLOGUE(ip) (m68k_skip_prologue (ip)) #endif -extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip)); +extern CORE_ADDR m68k_skip_prologue (CORE_ADDR ip); /* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines @@ -46,8 +46,9 @@ extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip)); struct frame_info; struct frame_saved_regs; -extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *)); -extern void m68k_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *)); +extern CORE_ADDR m68k_saved_pc_after_call (struct frame_info *); +extern void m68k_find_saved_regs (struct frame_info *, + struct frame_saved_regs *); #define SAVED_PC_AFTER_CALL(frame) \ m68k_saved_pc_after_call(frame) @@ -372,9 +373,9 @@ do \ #define PUSH_DUMMY_FRAME { m68k_push_dummy_frame (); } -extern void m68k_push_dummy_frame PARAMS ((void)); +extern void m68k_push_dummy_frame (void); -extern void m68k_pop_frame PARAMS ((void)); +extern void m68k_pop_frame (void); /* Discard from the stack the innermost frame, restoring all registers. */ diff --git a/gdb/config/m68k/tm-m68kv4.h b/gdb/config/m68k/tm-m68kv4.h index 84ebb0e92db..8f6f15e8535 100644 --- a/gdb/config/m68k/tm-m68kv4.h +++ b/gdb/config/m68k/tm-m68kv4.h @@ -65,7 +65,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* Convert a DWARF register number to a gdb REGNUM. */ #define DWARF_REG_TO_REGNUM(num) ((num) < 16 ? (num) : (num)+FP0_REGNUM-16) diff --git a/gdb/config/m68k/tm-news.h b/gdb/config/m68k/tm-news.h index ff9230b50f1..9d1661ff116 100644 --- a/gdb/config/m68k/tm-news.h +++ b/gdb/config/m68k/tm-news.h @@ -60,7 +60,7 @@ /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ -extern int news_frame_num_args PARAMS ((struct frame_info * fi)); +extern int news_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi))) #include "m68k/tm-m68k.h" diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h index ce88045c7d7..0c8651af4db 100644 --- a/gdb/config/m68k/tm-sun3.h +++ b/gdb/config/m68k/tm-sun3.h @@ -75,7 +75,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* If sun3 pcc says that a parameter is a short, it's a short. */ #define BELIEVE_PCC_PROMOTION_TYPE diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h index 743220ed63e..9ce812d6bce 100644 --- a/gdb/config/m68k/tm-vx68.h +++ b/gdb/config/m68k/tm-vx68.h @@ -77,7 +77,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* Number of registers in a ptrace_getregs call. */ diff --git a/gdb/config/m68k/xm-hp300bsd.h b/gdb/config/m68k/xm-hp300bsd.h index 0da48bcf766..39118014f23 100644 --- a/gdb/config/m68k/xm-hp300bsd.h +++ b/gdb/config/m68k/xm-hp300bsd.h @@ -31,7 +31,7 @@ /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ #define ONE_PROCESS_WRITETEXT -extern char *strdup PARAMS ((const char *)); +extern char *strdup (const char *); /* Interface definitions for kernel debugger KDB. */ diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h index 1acb83e9584..f6a432495ac 100644 --- a/gdb/config/m88k/tm-m88k.h +++ b/gdb/config/m88k/tm-m88k.h @@ -43,7 +43,7 @@ init_extra_frame_info (fromleaf, fi) extern void init_extra_frame_info (); -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* Offset from address of function to start of its code. Zero on most machines. */ @@ -53,7 +53,7 @@ extern void init_extra_frame_info (); /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR m88k_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR m88k_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc)) /* The m88k kernel aligns all instructions on 4-byte boundaries. The @@ -63,7 +63,7 @@ extern CORE_ADDR m88k_skip_prologue PARAMS ((CORE_ADDR)); to realize that those two bits are not really a part of the address of an instruction. Shrug. */ -extern CORE_ADDR m88k_addr_bits_remove PARAMS ((CORE_ADDR)); +extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR); #define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr) /* Immediately after a function call, return the saved pc. @@ -508,8 +508,8 @@ extern CORE_ADDR frame_locals_address (); struct frame_saved_regs; struct frame_info; -void frame_find_saved_regs PARAMS ((struct frame_info * fi, - struct frame_saved_regs * fsr)); +void frame_find_saved_regs (struct frame_info *fi, + struct frame_saved_regs *fsr); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ frame_find_saved_regs (frame_info, &frame_saved_regs) diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h index cea17a08f17..10aebeca2c8 100644 --- a/gdb/config/mcore/tm-mcore.h +++ b/gdb/config/mcore/tm-mcore.h @@ -124,13 +124,13 @@ extern void mcore_pop_frame (struct frame_info *fi); #define SIZEOF_CALL_DUMMY_WORDS 0 #define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP) -extern CORE_ADDR mcore_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR mcore_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) mcore_push_return_address (PC, SP) #define PUSH_DUMMY_FRAME generic_push_dummy_frame () -extern CORE_ADDR mcore_push_arguments PARAMS ((int, struct value **, CORE_ADDR, - unsigned char, CORE_ADDR)); +extern CORE_ADDR mcore_push_arguments (int, struct value **, CORE_ADDR, + unsigned char, CORE_ADDR); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (SP) = mcore_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) @@ -149,7 +149,7 @@ extern use_struct_convention_fn mcore_use_struct_convention; generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) /* Cons up virtual frame pointer for trace */ -extern void mcore_virtual_frame_pointer PARAMS ((CORE_ADDR, long *, long *)); +extern void mcore_virtual_frame_pointer (CORE_ADDR, long *, long *); #define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \ mcore_virtual_frame_pointer ((PC), (REGP), (OFFP)) diff --git a/gdb/config/mips/nm-irix3.h b/gdb/config/mips/nm-irix3.h index ab195fb0cc8..fc38176b838 100644 --- a/gdb/config/mips/nm-irix3.h +++ b/gdb/config/mips/nm-irix3.h @@ -30,7 +30,7 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); /* Is this really true or is this just a leftover from a DECstation config file? */ diff --git a/gdb/config/mips/nm-irix4.h b/gdb/config/mips/nm-irix4.h index af5a417e698..32c1209b34c 100644 --- a/gdb/config/mips/nm-irix4.h +++ b/gdb/config/mips/nm-irix4.h @@ -51,7 +51,7 @@ #define STOPPED_BY_WATCHPOINT(W) \ procfs_stopped_by_watchpoint(inferior_pid) -extern int procfs_stopped_by_watchpoint PARAMS ((int)); +extern int procfs_stopped_by_watchpoint (int); #define HAVE_NONSTEPPABLE_WATCHPOINT @@ -61,6 +61,6 @@ extern int procfs_stopped_by_watchpoint PARAMS ((int)); procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 0) #define target_remove_watchpoint(ADDR, LEN, TYPE) \ procfs_set_watchpoint (inferior_pid, ADDR, 0, 0, 0) -extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int)); +extern int procfs_set_watchpoint (int, CORE_ADDR, int, int, int); #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1 diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h index 4cf53b60a9b..1244538419b 100644 --- a/gdb/config/mips/nm-irix5.h +++ b/gdb/config/mips/nm-irix5.h @@ -32,7 +32,7 @@ #define STOPPED_BY_WATCHPOINT(W) \ procfs_stopped_by_watchpoint(inferior_pid) -extern int procfs_stopped_by_watchpoint PARAMS ((int)); +extern int procfs_stopped_by_watchpoint (int); #define HAVE_NONSTEPPABLE_WATCHPOINT @@ -42,6 +42,6 @@ extern int procfs_stopped_by_watchpoint PARAMS ((int)); procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 0) #define target_remove_watchpoint(ADDR, LEN, TYPE) \ procfs_set_watchpoint (inferior_pid, ADDR, 0, 0, 0) -extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int)); +extern int procfs_set_watchpoint (int, CORE_ADDR, int, int, int); #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1 diff --git a/gdb/config/mips/nm-mips.h b/gdb/config/mips/nm-mips.h index 5b4cfa85c39..c7e434c94fa 100644 --- a/gdb/config/mips/nm-mips.h +++ b/gdb/config/mips/nm-mips.h @@ -30,4 +30,4 @@ This routine returns true on success */ #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern int get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h index 9e0ac8600f1..faaffee294d 100644 --- a/gdb/config/mips/tm-embed.h +++ b/gdb/config/mips/tm-embed.h @@ -33,11 +33,11 @@ #define target_insert_watchpoint(addr, len, type) \ remote_mips_set_watchpoint (addr, len, type) -int remote_mips_set_watchpoint PARAMS ((CORE_ADDR addr, int len, int type)); +int remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type); #define target_remove_watchpoint(addr, len, type) \ remote_mips_remove_watchpoint (addr, len, type) -int remote_mips_remove_watchpoint PARAMS ((CORE_ADDR addr, int len, int type)); +int remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type); /* We need to remove watchpoints when stepping, else we hit them again! */ @@ -48,4 +48,4 @@ int remote_mips_stopped_by_watchpoint (void); #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ remote_mips_can_use_hardware_watchpoint(cnt) -int remote_mips_can_use_hardware_watchpoint PARAMS ((int cnt)); +int remote_mips_can_use_hardware_watchpoint (int cnt); diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h index 7f828c3aa97..19b8dbe5df3 100644 --- a/gdb/config/mips/tm-irix5.h +++ b/gdb/config/mips/tm-irix5.h @@ -1,5 +1,5 @@ /* Target machine description for SGI Iris under Irix 5, for GDB. - Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. + Copyright 1990-1993, 1995, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -18,8 +18,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* If we're being built for n32, enable multi-arch. */ +/* FIXME: cagney/2000-04-04: Testing the _MIPS_SIM_NABI32 and + _MIPS_SIM in a tm-*.h file is simply wrong! Those are + host-dependant macros (provided by /usr/include) and stop any + chance of the target being cross compiled */ +#if 0 && defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32 +/* FIXME: Don't enable multi-arch for IRIX/n32. The test + ``gdb.base/corefile.exp: up in corefile.exp'' fails. */ +#define GDB_MULTI_ARCH 1 +#endif + #include "mips/tm-irix3.h" +/* FIXME: cagney/2000-04-04: Testing the _MIPS_SIM_NABI32 and + _MIPS_SIM in a tm-*.h file is simply wrong! Those are + host-dependant macros (provided by /usr/include) and stop any + chance of the target being cross compiled */ #if defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32 /* * Irix 6 (n32 ABI) has 32-bit GP regs and 64-bit FP regs @@ -46,16 +61,20 @@ #undef MIPS_LAST_ARG_REGNUM #define MIPS_LAST_ARG_REGNUM 11 /* N32 uses R4 through R11 for args */ -#undef MIPS_NUM_ARG_REGS -#define MIPS_NUM_ARG_REGS 8 +/* MIPS_STACK_ARGSIZE -- how many bytes does a pushed function arg take + up on the stack? For the n32 ABI, eight bytes are reserved for each + register. Like MIPS_SAVED_REGSIZE but different. */ +#define MIPS_DEFAULT_STACK_ARGSIZE 8 + +/* N32 does not reserve home space for registers used to carry + parameters. */ +#define MIPS_REGS_HAVE_HOME_P 0 + +/* Force N32 ABI as the default. */ +#define MIPS_DEFAULT_ABI MIPS_ABI_N32 #endif /* N32 */ -/* When calling functions on Irix 5 (or any MIPS SVR4 ABI compliant - platform) $25 must hold the function address. Dest_Reg is a macro - used in CALL_DUMMY in tm-mips.h. */ -#undef Dest_Reg -#define Dest_Reg 25 /* The signal handler trampoline is called _sigtramp. */ #undef IN_SIGTRAMP diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 3b8330fb0e8..9d07e87de59 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -58,7 +58,7 @@ struct value; #endif /* Floating point is IEEE compliant */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* The name of the usual type of MIPS processor that is in the target system. */ @@ -68,7 +68,7 @@ struct value; /* Remove useless bits from an instruction address. */ #define ADDR_BITS_REMOVE(addr) mips_addr_bits_remove(addr) -CORE_ADDR mips_addr_bits_remove PARAMS ((CORE_ADDR addr)); +CORE_ADDR mips_addr_bits_remove (CORE_ADDR addr); /* Remove useless bits from the stack pointer. */ @@ -83,11 +83,11 @@ CORE_ADDR mips_addr_bits_remove PARAMS ((CORE_ADDR addr)); to reach some "real" code. */ #define SKIP_PROLOGUE(pc) (mips_skip_prologue (pc, 0)) -extern CORE_ADDR mips_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); +extern CORE_ADDR mips_skip_prologue (CORE_ADDR addr, int lenient); /* Return non-zero if PC points to an instruction which will cause a step to execute both the instruction at PC and an instruction at PC+4. */ -extern int mips_step_skips_delay PARAMS ((CORE_ADDR)); +extern int mips_step_skips_delay (CORE_ADDR); #define STEP_SKIPS_DELAY_P (1) #define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc)) @@ -100,7 +100,7 @@ extern int mips_step_skips_delay PARAMS ((CORE_ADDR)); /* Are we currently handling a signal */ -extern int in_sigtramp PARAMS ((CORE_ADDR, char *)); +extern int in_sigtramp (CORE_ADDR, char *); #define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name) /* Stack grows downward. */ @@ -150,7 +150,7 @@ extern breakpoint_from_pc_fn mips_breakpoint_from_pc; /* Given the register index, return the name of the corresponding register. */ -extern char *mips_register_name PARAMS ((int regnr)); +extern char *mips_register_name (int regnr); #define REGISTER_NAME(i) mips_register_name (i) /* Initializer for an array of names of registers. @@ -185,10 +185,8 @@ extern char *mips_register_name PARAMS ((int regnr)); #define A0_REGNUM 4 /* Loc of first arg during a subr call */ #if MIPS_EABI #define MIPS_LAST_ARG_REGNUM 11 /* EABI uses R4 through R11 for args */ -#define MIPS_NUM_ARG_REGS 8 #else #define MIPS_LAST_ARG_REGNUM 7 /* old ABI uses R4 through R7 for args */ -#define MIPS_NUM_ARG_REGS 4 #endif #define T9_REGNUM 25 /* Contains address of callee in PIC */ #define SP_REGNUM 29 /* Contains address of top of stack */ @@ -203,10 +201,8 @@ extern char *mips_register_name PARAMS ((int regnr)); #define FPA0_REGNUM (FP0_REGNUM+12) /* First float argument register */ #if MIPS_EABI /* EABI uses F12 through F19 for args */ #define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+19) -#define MIPS_NUM_FP_ARG_REGS 8 #else /* old ABI uses F12 through F15 for args */ #define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+15) -#define MIPS_NUM_FP_ARG_REGS 4 #endif #define FCRCS_REGNUM 70 /* FP control/status */ #define FCRIR_REGNUM 71 /* FP implementation/revision */ @@ -220,7 +216,7 @@ extern char *mips_register_name PARAMS ((int regnr)); of register dumps. */ #define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp) -extern void mips_do_registers_info PARAMS ((int, int)); +extern void mips_do_registers_info (int, int); /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ @@ -236,7 +232,7 @@ extern void mips_do_registers_info PARAMS ((int, int)); register N. NOTE: This indirectly defines the register size transfered by the GDB protocol. */ -extern int mips_register_raw_size PARAMS ((int reg_nr)); +extern int mips_register_raw_size (int reg_nr); #define REGISTER_RAW_SIZE(N) (mips_register_raw_size ((N))) @@ -246,15 +242,17 @@ extern int mips_register_raw_size PARAMS ((int reg_nr)); really 32 bit registers. This is a legacy of the 64 bit MIPS GDB protocol which transfers 64 bits for 32 bit registers. */ -extern int mips_register_convertible PARAMS ((int reg_nr)); +extern int mips_register_convertible (int reg_nr); #define REGISTER_CONVERTIBLE(N) (mips_register_convertible ((N))) -void mips_register_convert_to_virtual PARAMS ((int reg_nr, struct type *virtual_type, char *raw_buf, char *virt_buf)); +void mips_register_convert_to_virtual (int reg_nr, struct type *virtual_type, + char *raw_buf, char *virt_buf); #define REGISTER_CONVERT_TO_VIRTUAL(N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF) \ mips_register_convert_to_virtual (N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF) -void mips_register_convert_to_raw PARAMS ((struct type *virtual_type, int reg_nr, char *virt_buf, char *raw_buf)); +void mips_register_convert_to_raw (struct type *virtual_type, int reg_nr, + char *virt_buf, char *raw_buf); #define REGISTER_CONVERT_TO_RAW(VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF) \ mips_register_convert_to_raw (VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF) @@ -321,15 +319,14 @@ void mips_register_convert_to_raw PARAMS ((struct type *virtual_type, int reg_nr #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ mips_extract_return_value(TYPE, REGBUF, VALBUF) -extern void -mips_extract_return_value PARAMS ((struct type *, char[], char *)); +extern void mips_extract_return_value (struct type *, char[], char *); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ #define STORE_RETURN_VALUE(TYPE,VALBUF) \ mips_store_return_value(TYPE, VALBUF) -extern void mips_store_return_value PARAMS ((struct type *, char *)); +extern void mips_store_return_value (struct type *, char *); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, @@ -353,7 +350,7 @@ extern use_struct_convention_fn mips_use_struct_convention; and produces the frame's chain-pointer. */ #define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe) -extern CORE_ADDR mips_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR mips_frame_chain (struct frame_info *); /* Define other aspects of the stack frame. */ @@ -368,7 +365,7 @@ extern CORE_ADDR mips_frame_chain PARAMS ((struct frame_info *)); /* Saved Pc. */ #define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME)) -extern CORE_ADDR mips_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR mips_frame_saved_pc (struct frame_info *); #define FRAME_ARGS_ADDRESS(fi) (fi)->frame @@ -378,7 +375,7 @@ extern CORE_ADDR mips_frame_saved_pc PARAMS ((struct frame_info *)); Can return -1, meaning no way to tell. */ #define FRAME_NUM_ARGS(fi) (mips_frame_num_args(fi)) -extern int mips_frame_num_args PARAMS ((struct frame_info *)); +extern int mips_frame_num_args (struct frame_info *); /* Return number of bytes at start of arglist that are not really args. */ @@ -396,7 +393,7 @@ extern int mips_frame_num_args PARAMS ((struct frame_info *)); mips_find_saved_regs (frame_info); \ (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \ } while (0) -extern void mips_find_saved_regs PARAMS ((struct frame_info *)); +extern void mips_find_saved_regs (struct frame_info *); /* Things needed for making the inferior call functions. */ @@ -405,22 +402,23 @@ extern void mips_find_saved_regs PARAMS ((struct frame_info *)); function calls. We don't need STACK_ALIGN, PUSH_ARGUMENTS will handle it. */ -extern CORE_ADDR mips_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); +extern CORE_ADDR mips_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) -extern CORE_ADDR mips_push_return_address PARAMS ((CORE_ADDR pc, CORE_ADDR sp)); +extern CORE_ADDR mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp); #define PUSH_RETURN_ADDRESS(PC, SP) (mips_push_return_address ((PC), (SP))) /* Push an empty stack frame, to record the current PC, etc. */ #define PUSH_DUMMY_FRAME mips_push_dummy_frame() -extern void mips_push_dummy_frame PARAMS ((void)); +extern void mips_push_dummy_frame (void); /* Discard from the stack the innermost frame, restoring all registers. */ #define POP_FRAME mips_pop_frame() -extern void mips_pop_frame PARAMS ((void)); +extern void mips_pop_frame (void); #if !GDB_MULTI_ARCH #define CALL_DUMMY { 0 } @@ -430,15 +428,17 @@ extern void mips_pop_frame PARAMS ((void)); #define CALL_DUMMY_BREAKPOINT_OFFSET (0) -/* On Irix, $t9 ($25) contains the address of the callee (used for PIC). - It doesn't hurt to do this on other systems; $t9 will be ignored. */ +/* When calling functions on Irix 5 (or any MIPS SVR4 ABI compliant + platform), $t9 ($25) (Dest_Reg) contains the address of the callee + (used for PIC). It doesn't hurt to do this on other systems; $t9 + will be ignored. */ #define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p) \ write_register(T9_REGNUM, fun) #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ()) -extern CORE_ADDR mips_call_dummy_address PARAMS ((void)); +extern CORE_ADDR mips_call_dummy_address (void); /* There's a mess in stack frame creation. See comments in blockframe.c near reference to INIT_FRAME_PC_FIRST. */ @@ -447,13 +447,13 @@ extern CORE_ADDR mips_call_dummy_address PARAMS ((void)); #define INIT_FRAME_PC_FIRST(fromleaf, prev) \ mips_init_frame_pc_first(fromleaf, prev) -extern void mips_init_frame_pc_first PARAMS ((int, struct frame_info *)); +extern void mips_init_frame_pc_first (int, struct frame_info *); /* Special symbol found in blocks associated with routines. We can hang mips_extra_func_info_t's off of this. */ #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__" -extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR)); +extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR); /* Specific information about a procedure. This overlays the MIPS's PDR records, @@ -468,11 +468,11 @@ typedef struct mips_extra_func_info } *mips_extra_func_info_t; -extern void mips_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info *)); +extern void mips_init_extra_frame_info (int fromleaf, struct frame_info *); #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ mips_init_extra_frame_info(fromleaf, fci) -extern void mips_print_extra_frame_info PARAMS ((struct frame_info * frame)); +extern void mips_print_extra_frame_info (struct frame_info *frame); #define PRINT_EXTRA_FRAME_INFO(fi) \ mips_print_extra_frame_info (fi) @@ -490,7 +490,7 @@ extern void mips_print_extra_frame_info PARAMS ((struct frame_info * frame)); but there is nothing we can do about that). */ #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) -extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); +extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); /* Convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */ @@ -523,20 +523,20 @@ extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); /* These are defined in mdebugread.c and are used in mips-tdep.c */ extern CORE_ADDR sigtramp_address, sigtramp_end; -extern void fixup_sigtramp PARAMS ((void)); +extern void fixup_sigtramp (void); /* Defined in mips-tdep.c and used in remote-mips.c */ -extern char *mips_read_processor_type PARAMS ((void)); +extern char *mips_read_processor_type (void); /* Functions for dealing with MIPS16 call and return stubs. */ #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) mips_in_call_stub (pc, name) #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) mips_in_return_stub (pc, name) #define SKIP_TRAMPOLINE_CODE(pc) mips_skip_stub (pc) #define IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc) -extern int mips_in_call_stub PARAMS ((CORE_ADDR pc, char *name)); -extern int mips_in_return_stub PARAMS ((CORE_ADDR pc, char *name)); -extern CORE_ADDR mips_skip_stub PARAMS ((CORE_ADDR pc)); -extern int mips_ignore_helper PARAMS ((CORE_ADDR pc)); +extern int mips_in_call_stub (CORE_ADDR pc, char *name); +extern int mips_in_return_stub (CORE_ADDR pc, char *name); +extern CORE_ADDR mips_skip_stub (CORE_ADDR pc); +extern int mips_ignore_helper (CORE_ADDR pc); #ifndef TARGET_MIPS #define TARGET_MIPS @@ -587,3 +587,8 @@ typedef unsigned long t_inst; /* Integer big enough to hold an instruction */ /* Command to set the processor type. */ extern void mips_set_processor_type_command (char *, int); + + +/* MIPS sign extends addresses */ +#define POINTER_TO_ADDRESS(TYPE,BUF) (signed_pointer_to_address (TYPE, BUF)) +#define ADDRESS_TO_POINTER(TYPE,BUF,ADDR) (address_to_signed_pointer (TYPE, BUF, ADDR)) diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h index 03fa499d2e7..82b7918f14a 100644 --- a/gdb/config/mips/tm-mipsv4.h +++ b/gdb/config/mips/tm-mipsv4.h @@ -21,12 +21,6 @@ #include "mips/tm-bigmips.h" #include "tm-sysv4.h" -/* When calling functions on a MIPS SVR4 ABI compliant platform - $25 must hold the function address. Dest_Reg is a macro - used in CALL_DUMMY in tm-mips.h. */ -#undef Dest_Reg -#define Dest_Reg 25 - /* The signal handler trampoline is called _sigtramp. */ #undef IN_SIGTRAMP #define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name)) diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index f8843610690..5c26a003fcc 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -99,20 +99,20 @@ struct value; #define EXTRA_FRAME_INFO struct frame_saved_regs fsr; int status; int stack_size; -extern void mn10200_init_extra_frame_info PARAMS ((struct frame_info *)); +extern void mn10200_init_extra_frame_info (struct frame_info *); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10200_init_extra_frame_info (fi) #define INIT_FRAME_PC(x,y) -extern void mn10200_frame_find_saved_regs PARAMS ((struct frame_info *, - struct frame_saved_regs *)); +extern void mn10200_frame_find_saved_regs (struct frame_info *, + struct frame_saved_regs *); #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr -extern CORE_ADDR mn10200_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR mn10200_frame_chain (struct frame_info *); #define FRAME_CHAIN(fi) mn10200_frame_chain (fi) #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) -extern CORE_ADDR mn10200_find_callers_reg PARAMS ((struct frame_info *, int)); -extern CORE_ADDR mn10200_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR mn10200_find_callers_reg (struct frame_info *, int); +extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *); #define FRAME_SAVED_PC(FI) (mn10200_frame_saved_pc (FI)) /* Extract from an array REGBUF containing the (raw) register state @@ -166,7 +166,7 @@ extern CORE_ADDR mn10200_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \ (SP) = mn10200_store_struct_return (STRUCT_ADDR, SP) -extern CORE_ADDR mn10200_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR mn10200_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (mn10200_skip_prologue (pc)) #define FRAME_ARGS_SKIP 0 @@ -175,7 +175,7 @@ extern CORE_ADDR mn10200_skip_prologue PARAMS ((CORE_ADDR)); #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) #define FRAME_NUM_ARGS(fi) (-1) -extern void mn10200_pop_frame PARAMS ((struct frame_info *)); +extern void mn10200_pop_frame (struct frame_info *); #define POP_FRAME mn10200_pop_frame (get_current_frame ()) #define USE_GENERIC_DUMMY_FRAMES 1 @@ -186,14 +186,14 @@ extern void mn10200_pop_frame PARAMS ((struct frame_info *)); #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) #define CALL_DUMMY_ADDRESS() entry_point_address () -extern CORE_ADDR mn10200_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR mn10200_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) mn10200_push_return_address (PC, SP) #define PUSH_DUMMY_FRAME generic_push_dummy_frame () extern CORE_ADDR - mn10200_push_arguments PARAMS ((int, struct value **, CORE_ADDR, - unsigned char, CORE_ADDR)); +mn10200_push_arguments (int, struct value **, CORE_ADDR, + unsigned char, CORE_ADDR); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) diff --git a/gdb/config/mn10300/tm-mn10300.h b/gdb/config/mn10300/tm-mn10300.h index 682df858947..28981ab5144 100644 --- a/gdb/config/mn10300/tm-mn10300.h +++ b/gdb/config/mn10300/tm-mn10300.h @@ -38,7 +38,7 @@ #define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE) -extern char *mn10300_register_name PARAMS ((int regnr)); +extern char *mn10300_register_name (int regnr); #define REGISTER_NAME(i) (mn10300_register_name (i)) #define D2_REGNUM 2 @@ -67,7 +67,7 @@ extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc; #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) -extern CORE_ADDR mn10300_saved_pc_after_call PARAMS ((struct frame_info * frame)); +extern CORE_ADDR mn10300_saved_pc_after_call (struct frame_info *frame); #define SAVED_PC_AFTER_CALL(frame) \ mn10300_saved_pc_after_call (frame) @@ -75,33 +75,34 @@ struct frame_info; struct type; struct value; -extern void mn10300_init_extra_frame_info PARAMS ((struct frame_info *)); +extern void mn10300_init_extra_frame_info (struct frame_info *); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi) #define INIT_FRAME_PC /* Not necessary */ #define FRAME_INIT_SAVED_REGS(fi) /* handled by init_extra_frame_info */ -extern CORE_ADDR mn10300_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR mn10300_frame_chain (struct frame_info *); #define FRAME_CHAIN(fi) mn10300_frame_chain (fi) #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) -extern CORE_ADDR mn10300_find_callers_reg PARAMS ((struct frame_info *, int)); -extern CORE_ADDR mn10300_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR mn10300_find_callers_reg (struct frame_info *, int); +extern CORE_ADDR mn10300_frame_saved_pc (struct frame_info *); #define FRAME_SAVED_PC(FI) (mn10300_frame_saved_pc (FI)) /* 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. */ -extern void mn10300_extract_return_value PARAMS ((struct type * type, char *regbuf, char *valbuf)); +extern void mn10300_extract_return_value (struct type *type, char *regbuf, + char *valbuf); #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ mn10300_extract_return_value (TYPE, REGBUF, VALBUF) -CORE_ADDR mn10300_extract_struct_value_address PARAMS ((char *regbuf)); +CORE_ADDR mn10300_extract_struct_value_address (char *regbuf); #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ mn10300_extract_struct_value_address (REGBUF) -void mn10300_store_return_value PARAMS ((struct type * type, char *valbuf)); +void mn10300_store_return_value (struct type *type, char *valbuf); #define STORE_RETURN_VALUE(TYPE, VALBUF) \ mn10300_store_return_value (TYPE, VALBUF) @@ -110,7 +111,7 @@ extern CORE_ADDR mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); #define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \ (mn10300_store_struct_return (STRUCT_ADDR, SP)) -extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR mn10300_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (mn10300_skip_prologue (pc)) #define FRAME_ARGS_SKIP 0 @@ -119,7 +120,7 @@ extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR)); #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) #define FRAME_NUM_ARGS(fi) (-1) -extern void mn10300_pop_frame PARAMS ((struct frame_info *)); +extern void mn10300_pop_frame (struct frame_info *); #define POP_FRAME mn10300_pop_frame (get_current_frame ()) #define USE_GENERIC_DUMMY_FRAMES 1 @@ -132,15 +133,15 @@ extern void mn10300_pop_frame PARAMS ((struct frame_info *)); #define TARGET_READ_FP() read_sp () -extern CORE_ADDR mn10300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR mn10300_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) mn10300_push_return_address (PC, SP) #define PUSH_DUMMY_FRAME generic_push_dummy_frame () #define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP) extern CORE_ADDR - mn10300_push_arguments PARAMS ((int, struct value **, CORE_ADDR, - unsigned char, CORE_ADDR)); +mn10300_push_arguments (int, struct value **, CORE_ADDR, + unsigned char, CORE_ADDR); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) @@ -158,6 +159,6 @@ extern use_struct_convention_fn mn10300_use_struct_convention; generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) /* Cons up virtual frame pointer for trace */ -extern void mn10300_virtual_frame_pointer PARAMS ((CORE_ADDR, long *, long *)); +extern void mn10300_virtual_frame_pointer (CORE_ADDR, long *, long *); #define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \ mn10300_virtual_frame_pointer ((PC), (REGP), (OFFP)) diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h index 9b225827c54..40aed575c77 100644 --- a/gdb/config/nm-linux.h +++ b/gdb/config/nm-linux.h @@ -38,15 +38,12 @@ struct objfile; /* Hook to look at new objfiles (shared libraries) */ -extern void -linuxthreads_new_objfile PARAMS ((struct objfile *objfile)); +extern void linuxthreads_new_objfile (struct objfile *objfile); /* Method to print a human-readable thread description */ -extern char * -linuxthreads_pid_to_str PARAMS ((int pid)); +extern char *linuxthreads_pid_to_str (int pid); -extern int -linuxthreads_prepare_to_proceed PARAMS ((int step)); +extern int linuxthreads_prepare_to_proceed (int step); #define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1) /* Defined to make stepping-over-breakpoints be thread-atomic. */ @@ -59,3 +56,8 @@ linuxthreads_prepare_to_proceed PARAMS ((int step)); #define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) #define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) +/* Use elf_gregset_t and elf_fpregset_t, rather than + gregset_t and fpregset_t. */ + +#define GDB_GREGSET_T elf_gregset_t +#define GDB_FPREGSET_T elf_fpregset_t diff --git a/gdb/config/nm-lynx.h b/gdb/config/nm-lynx.h index 88974b180b3..4a6f6e40c0d 100644 --- a/gdb/config/nm-lynx.h +++ b/gdb/config/nm-lynx.h @@ -70,7 +70,7 @@ #include "target.h" -extern int child_wait PARAMS ((int pid, struct target_waitstatus * status)); +extern int child_wait (int pid, struct target_waitstatus *status); /* Lynx needs a special definition of this so that we can print out the pid and thread number seperatly. */ @@ -78,6 +78,6 @@ extern int child_wait PARAMS ((int pid, struct target_waitstatus * status)); /* override child_pid_to_str in inftarg.c */ #define CHILD_PID_TO_STR -extern char *lynx_pid_to_str PARAMS ((int pid)); +extern char *lynx_pid_to_str (int pid); #endif /* NM_LYNX_H */ diff --git a/gdb/config/ns32k/nbsd.mh b/gdb/config/ns32k/nbsd.mh index aae025b56fc..30fb192e54e 100644 --- a/gdb/config/ns32k/nbsd.mh +++ b/gdb/config/ns32k/nbsd.mh @@ -1,5 +1,6 @@ # Host: PC532 running NetBSD XDEPFILES= ser-tcp.o +NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \ + ns32knbsd-nat.o solib.o XM_FILE= xm-nbsd.h NAT_FILE= nm-nbsd.h -NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o ns32knbsd-nat.o diff --git a/gdb/config/ns32k/nbsd.mt b/gdb/config/ns32k/nbsd.mt index 512132a757f..14d37f9a40f 100644 --- a/gdb/config/ns32k/nbsd.mt +++ b/gdb/config/ns32k/nbsd.mt @@ -1,3 +1,3 @@ # Target: PC532 running NetBSD -TDEPFILES= ns32k-tdep.o solib.o +TDEPFILES= ns32k-tdep.o TM_FILE= tm-nbsd.h diff --git a/gdb/config/ns32k/nm-nbsd.h b/gdb/config/ns32k/nm-nbsd.h index e4aa02e2533..613b5695afc 100644 --- a/gdb/config/ns32k/nm-nbsd.h +++ b/gdb/config/ns32k/nm-nbsd.h @@ -31,7 +31,6 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ (addr) = ns32k_register_u_addr ((blockend),(regno)); -extern int -ns32k_register_u_addr PARAMS ((int, int)); +extern int ns32k_register_u_addr (int, int); #endif /* NM_NBSD_H */ diff --git a/gdb/config/ns32k/tm-merlin.h b/gdb/config/ns32k/tm-merlin.h index 5fa06b8078c..ff74d08d0f3 100644 --- a/gdb/config/ns32k/tm-merlin.h +++ b/gdb/config/ns32k/tm-merlin.h @@ -28,7 +28,7 @@ /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR merlin_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (merlin_skip_prologue (pc)) /* Immediately after a function call, return the saved pc. @@ -193,7 +193,7 @@ extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR)); /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ -extern int merlin_frame_num_args PARAMS ((struct frame_info * fi)); +extern int merlin_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (merlin_frame_num_args ((fi))) /* Return number of bytes at start of arglist that are not really args. */ diff --git a/gdb/config/ns32k/tm-umax.h b/gdb/config/ns32k/tm-umax.h index 392d3285cf0..db8c978177a 100644 --- a/gdb/config/ns32k/tm-umax.h +++ b/gdb/config/ns32k/tm-umax.h @@ -34,7 +34,7 @@ /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR umax_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR umax_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (umax_skip_prologue (pc)) /* Immediately after a function call, return the saved pc. @@ -232,7 +232,7 @@ extern CORE_ADDR ns32k_get_enter_addr (); ways in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -extern int umax_frame_num_args PARAMS ((struct frame_info * fi)); +extern int umax_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (umax_frame_num_args ((fi))) /* Things needed for making the inferior call functions. */ diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index c7466ca40de..1af0ec963dd 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -70,7 +70,7 @@ /* While this is for use by threaded programs, it doesn't appear * to hurt non-threaded ones. This is used in infrun.c: */ #define PREPARE_TO_PROCEED(select_it) hppa_prepare_to_proceed() -extern int hppa_prepare_to_proceed PARAMS ((void)); +extern int hppa_prepare_to_proceed (void); /* In infptrace.c or infttrace.c: */ #define CHILD_PID_TO_EXEC_FILE @@ -93,10 +93,10 @@ extern int hppa_prepare_to_proceed PARAMS ((void)); #define CHILD_PID_TO_STR #define REQUIRE_ATTACH(pid) hppa_require_attach(pid) -extern int hppa_require_attach PARAMS ((int)); +extern int hppa_require_attach (int); #define REQUIRE_DETACH(pid,signal) hppa_require_detach(pid,signal) -extern int hppa_require_detach PARAMS ((int, int)); +extern int hppa_require_detach (int, int); /* So we can cleanly use code in infptrace.c. */ #define PT_KILL PT_EXIT @@ -210,11 +210,11 @@ extern int hppa_require_detach PARAMS ((int, int)); */ #define TARGET_ENABLE_HW_WATCHPOINTS(pid) \ hppa_enable_page_protection_events (pid) -extern void hppa_enable_page_protection_events PARAMS ((int)); +extern void hppa_enable_page_protection_events (int); #define TARGET_DISABLE_HW_WATCHPOINTS(pid) \ hppa_disable_page_protection_events (pid) -extern void hppa_disable_page_protection_events PARAMS ((int)); +extern void hppa_disable_page_protection_events (int); /* Use these macros for watchpoint insertion/deletion. */ #define target_insert_watchpoint(addr, len, type) \ @@ -228,11 +228,11 @@ extern void hppa_disable_page_protection_events PARAMS ((int)); * the string. Code is in hppah-nat.c. */ -extern char *child_pid_to_str PARAMS ((pid_t)); +extern char *child_pid_to_str (pid_t); #define target_tid_to_str( pid ) \ hppa_tid_to_str( pid ) -extern char *hppa_tid_to_str PARAMS ((pid_t)); +extern char *hppa_tid_to_str (pid_t); /* For this, ID can be either a process or thread ID, and the function will describe it appropriately, returning the description as a printable @@ -243,7 +243,7 @@ extern char *hppa_tid_to_str PARAMS ((pid_t)); */ #define target_pid_or_tid_to_str(ID) \ hppa_pid_or_tid_to_str (ID) -extern char *hppa_pid_or_tid_to_str PARAMS ((pid_t)); +extern char *hppa_pid_or_tid_to_str (pid_t); /* This is used when handling events caused by a call to vfork(). On ptrace- based HP-UXs, when you resume the vforked child, the parent automagically @@ -261,7 +261,7 @@ extern char *hppa_pid_or_tid_to_str PARAMS ((pid_t)); */ #define ENSURE_VFORKING_PARENT_REMAINS_STOPPED(PID) \ hppa_ensure_vforking_parent_remains_stopped (PID) -extern void hppa_ensure_vforking_parent_remains_stopped PARAMS ((int)); +extern void hppa_ensure_vforking_parent_remains_stopped (int); /* This is used when handling events caused by a call to vfork(). @@ -275,7 +275,7 @@ extern void hppa_ensure_vforking_parent_remains_stopped PARAMS ((int)); */ #define RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK() \ hppa_resume_execd_vforking_child_to_get_parent_vfork () -extern int hppa_resume_execd_vforking_child_to_get_parent_vfork PARAMS ((void)); +extern int hppa_resume_execd_vforking_child_to_get_parent_vfork (void); #define HPUXHPPA diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 9307fa56721..2dbb74bee38 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -53,7 +53,7 @@ struct inferior_status; /* Watch out for NaNs */ -#define IEEE_FLOAT +#define IEEE_FLOAT (1) /* On the PA, any pass-by-value structure > 8 bytes is actually passed via a pointer regardless of its type or the compiler @@ -70,24 +70,24 @@ struct inferior_status; /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR hppa_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR hppa_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc)) /* If PC is in some function-call trampoline code, return the PC where the function itself actually starts. If not, return NULL. */ #define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, NULL) -extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *)); +extern CORE_ADDR skip_trampoline_code (CORE_ADDR, char *); /* Return non-zero if we are in an appropriate trampoline. */ #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ in_solib_call_trampoline (pc, name) -extern int in_solib_call_trampoline PARAMS ((CORE_ADDR, char *)); +extern int in_solib_call_trampoline (CORE_ADDR, char *); #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \ in_solib_return_trampoline (pc, name) -extern int in_solib_return_trampoline PARAMS ((CORE_ADDR, char *)); +extern int in_solib_return_trampoline (CORE_ADDR, char *); /* Immediately after a function call, return the saved pc. Can't go through the frames for this because on some machines @@ -96,7 +96,7 @@ extern int in_solib_return_trampoline PARAMS ((CORE_ADDR, char *)); #undef SAVED_PC_AFTER_CALL #define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call (frame) -extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *)); +extern CORE_ADDR saved_pc_after_call (struct frame_info *); /* Stack grows upward */ #define INNER_THAN(lhs,rhs) ((lhs) > (rhs)) @@ -258,7 +258,7 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *)); of register dumps. */ #define DO_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp) -extern void pa_do_registers_info PARAMS ((int, int)); +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) @@ -403,7 +403,7 @@ extern use_struct_convention_fn hppa_use_struct_convention; ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM) #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) init_extra_frame_info (fromleaf, frame) -extern void init_extra_frame_info PARAMS ((int, struct frame_info *)); +extern void init_extra_frame_info (int, struct frame_info *); /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ @@ -423,9 +423,9 @@ extern void init_extra_frame_info PARAMS ((int, struct frame_info *)); address (previous FP). */ #define FRAME_CHAIN(thisframe) frame_chain (thisframe) -extern CORE_ADDR frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR frame_chain (struct frame_info *); -extern int hppa_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *); #define FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe) #define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) @@ -437,9 +437,9 @@ extern int hppa_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); does not, FRAMELESS is set to 1, else 0. */ #define FRAMELESS_FUNCTION_INVOCATION(FI) \ (frameless_function_invocation (FI)) -extern int frameless_function_invocation PARAMS ((struct frame_info *)); +extern int frameless_function_invocation (struct frame_info *); -extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info * frame)); +extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame); #define FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME) #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) @@ -459,8 +459,7 @@ extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info * frame)); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ hppa_frame_find_saved_regs (frame_info, &frame_saved_regs) extern void -hppa_frame_find_saved_regs PARAMS ((struct frame_info *, - struct frame_saved_regs *)); +hppa_frame_find_saved_regs (struct frame_info *, struct frame_saved_regs *); /* Things needed for making the inferior call functions. */ @@ -468,12 +467,12 @@ hppa_frame_find_saved_regs PARAMS ((struct frame_info *, /* Push an empty stack frame, to record the current PC, etc. */ #define PUSH_DUMMY_FRAME push_dummy_frame (inf_status) -extern void push_dummy_frame PARAMS ((struct inferior_status *)); +extern void push_dummy_frame (struct inferior_status *); /* Discard from the stack the innermost frame, restoring all saved registers. */ #define POP_FRAME hppa_pop_frame () -extern void hppa_pop_frame PARAMS ((void)); +extern void hppa_pop_frame (void); #define INSTRUCTION_SIZE 4 @@ -619,14 +618,13 @@ extern void hppa_pop_frame PARAMS ((void)); #define FIX_CALL_DUMMY hppa_fix_call_dummy extern CORE_ADDR - hppa_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, int, - struct value **, struct type *, int)); +hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int, + struct value **, struct type *, int); #define 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 PARAMS ((int, struct value **, CORE_ADDR, int, - CORE_ADDR)); +hppa_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); /* The low two bits of the PC on the PA contain the privilege level. Some genius implementing a (non-GCC) compiler apparently decided this means @@ -760,26 +758,25 @@ typedef struct obj_private_struct obj_private_data_t; #if 0 -extern void target_write_pc -PARAMS ((CORE_ADDR, int)) - extern CORE_ADDR target_read_pc PARAMS ((int)); - extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *)); +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 #define TARGET_READ_PC(pid) target_read_pc (pid) - extern CORE_ADDR target_read_pc PARAMS ((int)); +extern CORE_ADDR target_read_pc (int); #define TARGET_WRITE_PC(v,pid) target_write_pc (v,pid) - extern void target_write_pc PARAMS ((CORE_ADDR, int)); +extern void target_write_pc (CORE_ADDR, int); #define TARGET_READ_FP() target_read_fp (inferior_pid) - extern CORE_ADDR target_read_fp PARAMS ((int)); +extern CORE_ADDR target_read_fp (int); /* 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) - extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR)); +extern int hpread_adjust_stack_address (CORE_ADDR); /* If the current gcc for for this target does not produce correct debugging information for float parameters, both prototyped and unprototyped, then diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 7f30c664f32..71654779c37 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -140,7 +140,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ of variables on the stack. Ugh. jimb: why? */ #define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR) -extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR)); +extern int hpread_adjust_stack_address (CORE_ADDR); /* jimb: omitted dynamic linking stuff here */ diff --git a/gdb/config/pa/xm-hppah.h b/gdb/config/pa/xm-hppah.h index 1542d327035..913b70ab371 100644 --- a/gdb/config/pa/xm-hppah.h +++ b/gdb/config/pa/xm-hppah.h @@ -40,11 +40,8 @@ #define MALLOC_INCOMPATIBLE -extern void * - malloc PARAMS ((size_t)); +extern void *malloc (size_t); -extern void * - realloc PARAMS ((void *, size_t)); +extern void *realloc (void *, size_t); -extern void -free PARAMS ((void *)); +extern void free (void *); diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh new file mode 100644 index 00000000000..e79f84a734e --- /dev/null +++ b/gdb/config/powerpc/nbsd.mh @@ -0,0 +1,5 @@ +# Host: PowerPC, running NetBSD +XDEPFILES= ser-tcp.o +NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o solib.o ppcnbsd-nat.o +XM_FILE= xm-nbsd.h +NAT_FILE= nm-nbsd.h diff --git a/gdb/config/powerpc/nbsd.mt b/gdb/config/powerpc/nbsd.mt new file mode 100644 index 00000000000..2173f650087 --- /dev/null +++ b/gdb/config/powerpc/nbsd.mt @@ -0,0 +1,5 @@ +# Target: PowerPC, running NetBSD +TDEPFILES= rs6000-tdep.o +TM_FILE= tm-nbsd.h + +GDBSERVER_DEPFILES= low-nbsd.o diff --git a/gdb/config/powerpc/nm-linux.h b/gdb/config/powerpc/nm-linux.h index 78b78b9dba7..0ef531ce154 100644 --- a/gdb/config/powerpc/nm-linux.h +++ b/gdb/config/powerpc/nm-linux.h @@ -18,12 +18,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef NM_LINUX_H + +#include "nm-linux.h" + #define NM_LINUX_H /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); /* Tell gdb that we can attach and detach other processes */ #define ATTACH_DETACH @@ -48,16 +51,13 @@ extern int kernel_u_size PARAMS ((void)); struct objfile; #endif -extern void -linuxthreads_new_objfile PARAMS ((struct objfile *objfile)); +extern void linuxthreads_new_objfile (struct objfile *objfile); #define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE) -extern char * -linuxthreads_pid_to_str PARAMS ((int pid)); +extern char *linuxthreads_pid_to_str (int pid); #define target_pid_to_str(PID) linuxthreads_pid_to_str (PID) -extern int -linuxthreads_prepare_to_proceed PARAMS ((int step)); +extern int linuxthreads_prepare_to_proceed (int step); #define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1) diff --git a/gdb/config/powerpc/nm-nbsd.h b/gdb/config/powerpc/nm-nbsd.h new file mode 100644 index 00000000000..a07e14fc28b --- /dev/null +++ b/gdb/config/powerpc/nm-nbsd.h @@ -0,0 +1,29 @@ +/* Native-dependent definitions for PowerPC running NetBSD ELF, for GDB. + Copyright (C) 2000, 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 NM_NBSD_H +#define NM_NBSD_H + +#define SVR4_SHARED_LIBS + +/* Get generic NetBSD native definitions. */ +#include "nm-nbsd.h" + +#endif diff --git a/gdb/config/powerpc/tm-linux.h b/gdb/config/powerpc/tm-linux.h index 43fa60ffd44..b1abb0ee8b7 100644 --- a/gdb/config/powerpc/tm-linux.h +++ b/gdb/config/powerpc/tm-linux.h @@ -75,7 +75,8 @@ CORE_ADDR ppc_linux_frame_chain (struct frame_info *); #undef FRAME_CHAIN #define FRAME_CHAIN(thisframe) ppc_linux_frame_chain (thisframe) -CORE_ADDR ppc_sysv_abi_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); +CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); #undef PUSH_ARGUMENTS #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (ppc_sysv_abi_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) diff --git a/gdb/config/powerpc/tm-nbsd.h b/gdb/config/powerpc/tm-nbsd.h new file mode 100644 index 00000000000..ae3418f4fdb --- /dev/null +++ b/gdb/config/powerpc/tm-nbsd.h @@ -0,0 +1,27 @@ +/* Macro definitions for PowerPC running under NetBSD. + Copyright 2000 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 TM_NBSD_H +#define TM_NBSD_H + +#include "powerpc/tm-ppc-eabi.h" +#include "tm-nbsd.h" + +#endif /* TM_NBSD_H */ diff --git a/gdb/config/powerpc/tm-ppc-eabi.h b/gdb/config/powerpc/tm-ppc-eabi.h index 5b85be8dcd9..2e333a8b031 100644 --- a/gdb/config/powerpc/tm-ppc-eabi.h +++ b/gdb/config/powerpc/tm-ppc-eabi.h @@ -54,9 +54,9 @@ /* target-specific dummy_frame stuff */ -extern struct frame_info *rs6000_pop_frame PARAMS ((struct frame_info * frame)); +extern struct frame_info *rs6000_pop_frame (struct frame_info *frame); -extern CORE_ADDR ppc_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR ppc_push_return_address (CORE_ADDR, CORE_ADDR); #undef PUSH_DUMMY_FRAME #define PUSH_DUMMY_FRAME generic_push_dummy_frame () diff --git a/gdb/config/powerpc/tm-solaris.h b/gdb/config/powerpc/tm-solaris.h index 67ddb5296bb..9d717756eba 100644 --- a/gdb/config/powerpc/tm-solaris.h +++ b/gdb/config/powerpc/tm-solaris.h @@ -54,8 +54,7 @@ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) #endif /* 0 */ @@ -65,7 +64,7 @@ get_longjmp_target PARAMS ((CORE_ADDR *)); #define SOFUN_ADDRESS_MAYBE_MISSING #if 0 -extern char *sunpro_static_transform_name PARAMS ((char *)); +extern char *sunpro_static_transform_name (char *); #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x) #endif diff --git a/gdb/config/powerpc/xm-aix.h b/gdb/config/powerpc/xm-aix.h index c5a5ca969d4..aeb2995c2db 100644 --- a/gdb/config/powerpc/xm-aix.h +++ b/gdb/config/powerpc/xm-aix.h @@ -22,7 +22,7 @@ #include "xm-aix4.h" /* This doesn't seem to be declared in any header file I can find. */ -char *termdef PARAMS ((int, int)); +char *termdef (int, int); /* UINT_MAX is defined in as a decimal constant (4294967295) which is too large to fit in a signed int when it is parsed by the diff --git a/gdb/config/powerpc/xm-nbsd.h b/gdb/config/powerpc/xm-nbsd.h new file mode 100644 index 00000000000..36ae321659a --- /dev/null +++ b/gdb/config/powerpc/xm-nbsd.h @@ -0,0 +1,22 @@ +/* Parameters for execution on a PowerPC running NetBSD, for GDB. + Copyright 2000 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. */ + +/* Get generic NetBSD host definitions. */ +#include "xm-nbsd.h" diff --git a/gdb/config/rs6000/nm-rs6000.h b/gdb/config/rs6000/nm-rs6000.h index 52a98f0da20..3d237bcbe98 100644 --- a/gdb/config/rs6000/nm-rs6000.h +++ b/gdb/config/rs6000/nm-rs6000.h @@ -49,11 +49,11 @@ /* Core file. */ \ xcoff_relocate_core (c); -extern void xcoff_relocate_symtab PARAMS ((unsigned int)); +extern void xcoff_relocate_symtab (unsigned int); struct target_ops; -extern void xcoff_relocate_core PARAMS ((struct target_ops *)); +extern void xcoff_relocate_core (struct target_ops *); /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h index 3b3e190541c..5bba7782116 100644 --- a/gdb/config/rs6000/tm-rs6000.h +++ b/gdb/config/rs6000/tm-rs6000.h @@ -32,7 +32,7 @@ struct value; /* Load segment of a given pc value. */ #define PC_LOAD_SEGMENT(PC) pc_load_segment_name(PC) -extern char *pc_load_segment_name PARAMS ((CORE_ADDR)); +extern char *pc_load_segment_name (CORE_ADDR); /* AIX cc seems to get this right. */ @@ -100,17 +100,17 @@ struct rs6000_framedata /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR rs6000_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR rs6000_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (rs6000_skip_prologue (pc)) -extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR, struct rs6000_framedata *)); +extern CORE_ADDR skip_prologue (CORE_ADDR, struct rs6000_framedata *); /* If PC is in some function-call trampoline code, return the PC where the function itself actually starts. If not, return NULL. */ #define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc) -extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR)); +extern CORE_ADDR skip_trampoline_code (CORE_ADDR); /* Number of trap signals we need to skip over, once the inferior process starts running. */ @@ -136,7 +136,7 @@ extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR)); once, when we are closing the current symbol table in end_symtab(). */ #define PROCESS_LINENUMBER_HOOK() aix_process_linenos () -extern void aix_process_linenos PARAMS ((void)); +extern void aix_process_linenos (void); /* Immediately after a function call, return the saved pc. Can't go through the frames for this because on some machines @@ -160,7 +160,8 @@ extern void aix_process_linenos PARAMS ((void)); #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ (rs6000_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) -extern CORE_ADDR rs6000_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); +extern CORE_ADDR rs6000_push_arguments (int, struct value **, CORE_ADDR, int, + CORE_ADDR); /* BREAKPOINT_FROM_PC uses the program counter value to determine the breakpoint that should be used */ @@ -334,7 +335,7 @@ extern CORE_ADDR rs6000_struct_return_address; #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ extract_return_value(TYPE,REGBUF,VALBUF) -extern void extract_return_value PARAMS ((struct type *, char[], char *)); +extern void extract_return_value (struct type *, char[], char *); /* Write into appropriate registers a function return value of type TYPE, given in virtual format. */ @@ -372,7 +373,7 @@ extern void extract_return_value PARAMS ((struct type *, char[], char *)); is the address of a 4-byte word containing the calling frame's address. */ #define FRAME_CHAIN(thisframe) rs6000_frame_chain (thisframe) -CORE_ADDR rs6000_frame_chain PARAMS ((struct frame_info *)); +CORE_ADDR rs6000_frame_chain (struct frame_info *); /* Define other aspects of the stack frame. */ @@ -410,7 +411,7 @@ extern void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *); extern unsigned long rs6000_frame_saved_pc (struct frame_info *); -extern CORE_ADDR rs6000_frame_args_address PARAMS ((struct frame_info *)); +extern CORE_ADDR rs6000_frame_args_address (struct frame_info *); #define FRAME_ARGS_ADDRESS(FI) rs6000_frame_args_address (FI) #define FRAME_LOCALS_ADDRESS(FI) FRAME_ARGS_ADDRESS(FI) @@ -437,7 +438,7 @@ extern CORE_ADDR rs6000_frame_args_address PARAMS ((struct frame_info *)); not sure if it will be needed. The following macro takes care of gpr's and fpr's only. */ -extern void rs6000_frame_init_saved_regs PARAMS ((struct frame_info *)); +extern void rs6000_frame_init_saved_regs (struct frame_info *); #define FRAME_INIT_SAVED_REGS(FI) rs6000_frame_init_saved_regs (FI) /* Things needed for making the inferior call functions. */ @@ -446,13 +447,13 @@ extern void rs6000_frame_init_saved_regs PARAMS ((struct frame_info *)); /* Change these names into rs6k_{push, pop}_frame(). FIXMEmgo. */ #define PUSH_DUMMY_FRAME push_dummy_frame () -extern void push_dummy_frame PARAMS ((void)); +extern void push_dummy_frame (void); /* Discard from the stack the innermost frame, restoring all saved registers. */ #define POP_FRAME pop_frame () -extern void pop_frame PARAMS ((void)); +extern void pop_frame (void); /* This sequence of words is the instructions: @@ -505,14 +506,13 @@ extern void pop_frame PARAMS ((void)); #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ rs6000_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p) -extern void rs6000_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, - int, struct value **, - struct type *, int)); +extern void rs6000_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, + int, struct value **, struct type *, int); /* Hook in rs6000-tdep.c for determining the TOC address when calling functions in the inferior. */ extern -CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR)); +CORE_ADDR (*find_toc_address_hook) (CORE_ADDR); /* xcoffread.c provides a function to determine the TOC offset for a given object file. @@ -520,7 +520,7 @@ CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR)); TOC address when calling functions in the inferior. */ struct objfile; -extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *)); +extern CORE_ADDR get_toc_offset (struct objfile *); /* Usually a function pointer's representation is simply the address of the function. On the RS/6000 however, a function pointer is @@ -538,7 +538,7 @@ extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *)); #define CONVERT_FROM_FUNC_PTR_ADDR(ADDR) \ (is_magic_function_pointer (ADDR) ? read_memory_integer (ADDR, 4) : (ADDR)) - extern int is_magic_function_pointer PARAMS ((CORE_ADDR)); +extern int is_magic_function_pointer (CORE_ADDR); /* Flag for machine-specific stuff in shared files. FIXME */ #define IBM6000_TARGET @@ -546,7 +546,7 @@ extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *)); /* RS6000/AIX does not support PT_STEP. Has to be simulated. */ #define SOFTWARE_SINGLE_STEP_P 1 - extern void rs6000_software_single_step PARAMS ((unsigned int, int)); +extern void rs6000_software_single_step (unsigned int, int); #define SOFTWARE_SINGLE_STEP(sig,bp_p) rs6000_software_single_step (sig, bp_p) /* If the current gcc for for this target does not produce correct debugging diff --git a/gdb/config/rs6000/xm-rs6000.h b/gdb/config/rs6000/xm-rs6000.h index 9efeaa6f7f5..24a9e501cd8 100644 --- a/gdb/config/rs6000/xm-rs6000.h +++ b/gdb/config/rs6000/xm-rs6000.h @@ -68,15 +68,15 @@ #define SETPGRP_ARGS 1 /* AIX doesn't have strdup, so we need to declare it for libiberty */ -extern char *strdup PARAMS ((char *)); +extern char *strdup (char *); /* Signal handler for SIGWINCH `window size changed'. */ #define SIGWINCH_HANDLER aix_resizewindow -extern void aix_resizewindow PARAMS ((int)); +extern void aix_resizewindow (int); /* This doesn't seem to be declared in any header file I can find. */ -char *termdef PARAMS ((int, int)); +char *termdef (int, int); /* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */ diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h index a3367131180..ca6d9e50029 100644 --- a/gdb/config/sh/tm-sh.h +++ b/gdb/config/sh/tm-sh.h @@ -27,7 +27,7 @@ struct type; #define GDB_TARGET_IS_SH -#define IEEE_FLOAT 1 +#define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ @@ -42,7 +42,7 @@ struct type; /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR sh_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(ip) (sh_skip_prologue (ip)) /* Immediately after a function call, return the saved pc. @@ -101,8 +101,10 @@ extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR)); of data in register N. */ #define REGISTER_VIRTUAL_TYPE(N) \ - ((((N) >= FP0_REGNUM && (N) <= FP15_REGNUM) \ - || (N) == FPUL_REGNUM) \ + (((((N) >= FP0_REGNUM && (N) <= FP15_REGNUM) \ + || (N) == FPUL_REGNUM) \ + && TARGET_ARCHITECTURE->mach != bfd_mach_sh_dsp \ + && TARGET_ARCHITECTURE->mach != bfd_mach_sh3_dsp) \ ? builtin_type_float : builtin_type_int) /* Initializer for an array of names of registers. @@ -135,12 +137,27 @@ extern char **sh_register_names; #define SR_REGNUM 22 #define FPUL_REGNUM 23 #define FPSCR_REGNUM 24 +#define DSR_REGNUM 24 #define FP0_REGNUM 25 #define FP15_REGNUM 40 +#define A0G_REGNUM 25 +#define A0_REGNUM 26 +#define A1G_REGNUM 27 +#define A1_REGNUM 28 +#define M0_REGNUM 29 +#define M1_REGNUM 30 +#define X0_REGNUM 31 +#define X1_REGNUM 32 +#define Y0_REGNUM 33 +#define Y1_REGNUM 34 +#define MOD_REGNUM 40 #define SSR_REGNUM 41 #define SPC_REGNUM 42 #define R0B0_REGNUM 43 #define R0B1_REGNUM 51 +#define RS_REGNUM 43 +#define RE_REGNUM 44 +#define R0B_REGNUM 51 #define NUM_REALREGS 59 @@ -159,7 +176,7 @@ extern use_struct_convention_fn sh_use_struct_convention; a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ -extern void sh_extract_return_value PARAMS ((struct type *, void *, void *)); +extern void sh_extract_return_value (struct type *, void *, void *); #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ sh_extract_return_value (TYPE, REGBUF, VALBUF) @@ -190,7 +207,7 @@ extern void sh_extract_return_value PARAMS ((struct type *, void *, void *)); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ sh_init_extra_frame_info(fromleaf, fi) -extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *)); +extern void sh_init_extra_frame_info (int, struct frame_info *); /* 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 @@ -214,8 +231,8 @@ extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *)); #define FRAME_ARGS_SKIP 0 -extern void sh_frame_find_saved_regs PARAMS ((struct frame_info * fi, - struct frame_saved_regs * fsr)); +extern void sh_frame_find_saved_regs (struct frame_info *fi, + struct frame_saved_regs *fsr); /* Put here the code to store, into a struct frame_saved_regs, the addresses of the saved registers of frame described by FRAME_INFO. @@ -228,11 +245,11 @@ extern void sh_frame_find_saved_regs PARAMS ((struct frame_info * fi, typedef unsigned short INSN_WORD; -extern CORE_ADDR sh_push_arguments PARAMS ((int nargs, - struct value ** args, - CORE_ADDR sp, - unsigned char struct_return, - CORE_ADDR struct_addr)); +extern CORE_ADDR sh_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + unsigned char struct_return, + CORE_ADDR struct_addr); #define USE_GENERIC_DUMMY_FRAMES 1 #define CALL_DUMMY {0} @@ -242,11 +259,11 @@ extern CORE_ADDR sh_push_arguments PARAMS ((int nargs, #define FIX_CALL_DUMMY(DUMMY, STARTADDR, FUNADDR, NARGS, ARGS, TYPE, GCCP) #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #define CALL_DUMMY_ADDRESS() entry_point_address () -extern CORE_ADDR sh_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR sh_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) sh_push_return_address (PC, SP) -extern CORE_ADDR sh_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR sh_frame_chain (struct frame_info *); #define FRAME_CHAIN(FRAME) sh_frame_chain(FRAME) #define PUSH_DUMMY_FRAME generic_push_dummy_frame () #define FRAME_CHAIN_VALID(FP, FRAME) generic_file_frame_chain_valid (FP, FRAME) @@ -262,7 +279,7 @@ extern CORE_ADDR sh_frame_chain PARAMS ((struct frame_info *)); /* Discard from the stack the innermost frame, restoring all saved registers. */ -extern void sh_pop_frame PARAMS ((void)); +extern void sh_pop_frame (void); #define POP_FRAME sh_pop_frame(); #define NOP {0x20, 0x0b} diff --git a/gdb/config/sh/tm-wince.h b/gdb/config/sh/tm-wince.h index 16816141d35..88e2a6fefc6 100644 --- a/gdb/config/sh/tm-wince.h +++ b/gdb/config/sh/tm-wince.h @@ -1,5 +1,5 @@ /* Target-specific definition for Window CE - Copyright 2000 Free Software Foundation, Inc. + Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/config/sparc/nm-linux.h b/gdb/config/sparc/nm-linux.h index 1b798237202..781b97f1de9 100644 --- a/gdb/config/sparc/nm-linux.h +++ b/gdb/config/sparc/nm-linux.h @@ -1,5 +1,5 @@ /* Macro definitions for running gdb on a Sparc running Linux. - Copyright (C) 1989, 1992, 1996, 1998 Free Software Foundation, Inc. + Copyright (C) 1989, 1992, 1996, 1998, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include +#include "nm-linux.h" #include "solib.h" #define FETCH_INFERIOR_REGISTERS @@ -26,4 +27,4 @@ /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); diff --git a/gdb/config/sparc/nm-sun4os4.h b/gdb/config/sparc/nm-sun4os4.h index dcd20fb0fe9..f883c95c500 100644 --- a/gdb/config/sparc/nm-sun4os4.h +++ b/gdb/config/sparc/nm-sun4os4.h @@ -33,4 +33,4 @@ /* Return sizeof user struct to callers in less machine dependent routines */ #define KERNEL_U_SIZE kernel_u_size() -extern int kernel_u_size PARAMS ((void)); +extern int kernel_u_size (void); diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h index 9d5dd1deec3..2107075ea32 100644 --- a/gdb/config/sparc/nm-sun4sol2.h +++ b/gdb/config/sparc/nm-sun4sol2.h @@ -30,6 +30,13 @@ #define PRSVADDR_BROKEN +/* gdb wants to use the prgregset_t interface rather than + the gregset_t interface, partly because that's what's + used in core-sol2.c */ + +#define GDB_GREGSET_T prgregset_t +#define GDB_FPREGSET_T prfpregset_t + #ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints */ #define TARGET_HAS_HARDWARE_WATCHPOINTS @@ -44,14 +51,14 @@ It will *NOT* be necessary for GDB to step over the watchpoint. */ #define HAVE_CONTINUABLE_WATCHPOINT -extern int procfs_stopped_by_watchpoint PARAMS ((int)); +extern int procfs_stopped_by_watchpoint (int); #define STOPPED_BY_WATCHPOINT(W) \ procfs_stopped_by_watchpoint(inferior_pid) /* Use these macros for watchpoint insertion/deletion. */ /* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ -extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int)); +extern int procfs_set_watchpoint (int, CORE_ADDR, int, int, int); #define target_insert_watchpoint(ADDR, LEN, TYPE) \ procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 1) #define target_remove_watchpoint(ADDR, LEN, TYPE) \ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index dbdf510906d..099add3c412 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -22,9 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define GDB_TARGET_IS_SPARC64 +#define GDB_MULTI_ARCH 2 -struct value; +#ifndef GDB_TARGET_IS_SPARC64 +#define GDB_TARGET_IS_SPARC64 1 +#endif + +#include "sparc/tm-sparc.h" /* Eeeew. Ok, we have to assume (for now) that the processor really is in sparc64 mode. While this is the same instruction sequence as @@ -70,6 +74,57 @@ struct value; nop */ +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. + */ + +#ifndef DO_CALL_DUMMY_ON_STACK + +/* + * These defines will suffice for the AT_ENTRY_POINT call dummy method. + */ + +#undef CALL_DUMMY +#define CALL_DUMMY {0} +#undef CALL_DUMMY_LENGTH +#define 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 CALL_DUMMY_BREAKPOINT_OFFSET_P +#define CALL_DUMMY_BREAKPOINT_OFFSET_P 1 +#undef CALL_DUMMY_LOCATION +#define CALL_DUMMY_LOCATION AT_ENTRY_POINT +#undef CALL_DUMMY_STACK_ADJUST +#define CALL_DUMMY_STACK_ADJUST 128 +#undef SIZEOF_CALL_DUMMY_WORDS +#define 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 PUSH_RETURN_ADDRESS +#define 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, CORE_ADDR sp); + +#undef STORE_STRUCT_RETURN +#define STORE_STRUCT_RETURN(ADDR, SP) \ + sparc_at_entry_store_struct_return (ADDR, SP) +extern void +sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); + + +#else +/* + * Old call dummy method, with CALL_DUMMY on the stack. + */ + +#undef CALL_DUMMY #define CALL_DUMMY { 0x9de3bec0fd3fa7f7LL, 0xf93fa7eff53fa7e7LL,\ 0xf13fa7dfed3fa7d7LL, 0xe93fa7cfe53fa7c7LL,\ 0xe13fa7bfdd3fa7b7LL, 0xd93fa7afd53fa7a7LL,\ @@ -86,17 +141,80 @@ struct value; /* 128 is to reserve space to write the %i/%l registers that will be restored when we resume. */ +#undef CALL_DUMMY_STACK_ADJUST #define CALL_DUMMY_STACK_ADJUST 128 +/* Size of the call dummy in bytes. */ +#undef CALL_DUMMY_LENGTH #define CALL_DUMMY_LENGTH 192 +/* Offset within CALL_DUMMY of the 'call' instruction. */ +#undef CALL_DUMMY_START_OFFSET #define 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)) +/* 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)) -#include "sparc/tm-sparc.h" +/* Let's GDB know that it can make a call_dummy breakpoint. */ +#undef CALL_DUMMY_BREAKPOINT_OFFSET_P +#define CALL_DUMMY_BREAKPOINT_OFFSET_P 1 + +/* Call dummy will be located on the stack. */ +#undef CALL_DUMMY_LOCATION +#define CALL_DUMMY_LOCATION ON_STACK + +/* Insert the function address into the call dummy. */ +#undef FIX_CALL_DUMMY +#define 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 PUSH_RETURN_ADDRESS +#undef CALL_DUMMY_ADDRESS +#undef STORE_STRUCT_RETURN + +#endif + +/* Does the specified function use the "struct returning" convention + or the "value returning" convention? The "value returning" convention + almost invariably returns the entire value in registers. The + "struct returning" convention often returns the entire value in + memory, and passes a pointer (out of or into the function) saying + where the value (is or should go). + + Since this sometimes depends on whether it was compiled with GCC, + this is also an argument. This is used in call_function to build a + stack, and in value_being_returned to print return values. + + On Sparc64, we only pass pointers to structs if they're larger then + 32 bytes. Otherwise they're stored in %o0-%o3 (floating-point + values go into %fp0-%fp3). */ + +#undef USE_STRUCT_CONVENTION +#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 32) + +CORE_ADDR sparc64_push_arguments (int, + struct value **, CORE_ADDR, int, CORE_ADDR); +#undef PUSH_ARGUMENTS +#define PUSH_ARGUMENTS(A,B,C,D,E) \ + (sparc64_push_arguments ((A), (B), (C), (D), (E))) + +/* Store the address of the place in which to copy the structure the + subroutine will return. This is called from call_function. */ +/* FIXME: V9 uses %o0 for this. */ + +#undef STORE_STRUCT_RETURN +#define STORE_STRUCT_RETURN(ADDR, SP) \ + { target_write_memory ((SP)+(16*8), (char *)&(ADDR), 8); } /* Stack must be aligned on 128-bit boundaries when synthesizing function calls. */ @@ -104,11 +222,6 @@ struct value; #undef STACK_ALIGN #define STACK_ALIGN(ADDR) (((ADDR) + 15 ) & -16) -/* Number of machine registers. */ - -#undef NUM_REGS -#define NUM_REGS 125 - /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ /* Some of these registers are only accessible from priviledged mode. @@ -148,6 +261,24 @@ struct value; "icc", "xcc", "fcc0", "fcc1", "fcc2", "fcc3" \ } +#undef REG_STRUCT_HAS_ADDR +#define REG_STRUCT_HAS_ADDR(gcc_p,type) (TYPE_LENGTH (type) > 32) + +extern CORE_ADDR sparc64_read_sp (); +extern CORE_ADDR sparc64_read_fp (); +extern void sparc64_write_sp (CORE_ADDR); +extern void sparc64_write_fp (CORE_ADDR); + +#define TARGET_READ_SP() (sparc64_read_sp ()) +#define TARGET_READ_FP() (sparc64_read_fp ()) +#define TARGET_WRITE_SP(X) (sparc64_write_sp (X)) +#define TARGET_WRITE_FP(X) (sparc64_write_fp (X)) + +#undef EXTRACT_RETURN_VALUE +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + sp64_extract_return_value(TYPE, REGBUF, VALBUF, 0) +extern void sp64_extract_return_value (struct type *, char[], char *, int); + /* Register numbers of various important registers. Note that some of these values are "real" register numbers, and correspond to the general registers of the machine, @@ -155,7 +286,8 @@ struct value; to be actual register numbers as far as the user is concerned but do serve to get the desired values when passed to read_register. */ -#if 0 /* defined in tm-sparc.h, replicated for doc purposes */ +#if 0 /* defined in tm-sparc.h, replicated + for doc purposes */ #define G0_REGNUM 0 /* %g0 */ #define G1_REGNUM 1 /* %g1 */ #define O0_REGNUM 8 /* %o0 */ @@ -172,7 +304,7 @@ struct value; #define FP0_REGNUM 32 /* Floating point register 0 */ #endif -#define FP_MAX_REGNUM 80 /* 1 + last fp reg number */ +/*#define FP_MAX_REGNUM 80*/ /* 1 + last fp reg number */ /* #undef v8 misc. regs */ @@ -187,7 +319,8 @@ struct value; /* v9 misc. and priv. regs */ -#define C0_REGNUM FP_MAX_REGNUM /* Start of control registers */ +#define C0_REGNUM 80 /* Start of control registers */ + #define PC_REGNUM (C0_REGNUM + 0) /* Current PC */ #define NPC_REGNUM (C0_REGNUM + 1) /* Next PC */ #define CCR_REGNUM (C0_REGNUM + 2) /* Condition Code Register (%xcc,%icc) */ @@ -220,6 +353,11 @@ struct value; #define FCC2_REGNUM (C0_REGNUM + 43) /* fp cc reg 2 */ #define FCC3_REGNUM (C0_REGNUM + 44) /* fp cc reg 3 */ +/* Number of machine registers. */ + +#undef NUM_REGS +#define NUM_REGS 125 + /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. Some of the registers aren't 64 bits, but it's a lot simpler just to assume @@ -291,40 +429,12 @@ struct value; #undef TARGET_LONG_LONG_BIT #define TARGET_LONG_LONG_BIT 64 -/* Does the specified function use the "struct returning" convention - or the "value returning" convention? The "value returning" convention - almost invariably returns the entire value in registers. The - "struct returning" convention often returns the entire value in - memory, and passes a pointer (out of or into the function) saying - where the value (is or should go). - - Since this sometimes depends on whether it was compiled with GCC, - this is also an argument. This is used in call_function to build a - stack, and in value_being_returned to print return values. - - On Sparc64, we only pass pointers to structs if they're larger then - 32 bytes. Otherwise they're stored in %o0-%o3 (floating-point - values go into %fp0-%fp3). */ - - -#undef USE_STRUCT_CONVENTION -#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 32) - -#undef REG_STRUCT_HAS_ADDR -#define REG_STRUCT_HAS_ADDR(gcc_p,type) (TYPE_LENGTH (type) > 32) - -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. */ -/* FIXME: V9 uses %o0 for this. */ - -#undef STORE_STRUCT_RETURN -#define STORE_STRUCT_RETURN(ADDR, SP) \ - { target_write_memory ((SP)+(16*8), (char *)&(ADDR), 8); } - /* Return number of bytes at start of arglist that are not really args. */ #undef FRAME_ARGS_SKIP #define FRAME_ARGS_SKIP 136 + +#endif /* GDB_MULTI_ARCH */ /* Offsets into jmp_buf. FIXME: This was borrowed from the v8 stuff and will probably have to change @@ -342,36 +452,17 @@ struct value; #define JB_O0 7 #define JB_WBCNT 8 -/* Figure out where the longjmp will land. We expect that we have just entered - longjmp and haven't yet setup the stack frame, so the args are still in the - output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we - extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. - This routine returns true on success */ +/* Figure out where the longjmp will land. We expect that we have + just entered longjmp and haven't yet setup the stack frame, so the + args are still in the output regs. %o0 (O0_REGNUM) points at the + jmp_buf structure from which we extract the pc (JB_PC) that we will + land at. The pc is copied into ADDR. This routine returns true on + success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern CORE_ADDR sparc64_read_sp (); -extern CORE_ADDR sparc64_read_fp (); -extern void sparc64_write_sp PARAMS ((CORE_ADDR)); -extern void sparc64_write_fp PARAMS ((CORE_ADDR)); - -#define TARGET_READ_SP() (sparc64_read_sp ()) -#define TARGET_READ_FP() (sparc64_read_fp ()) -#define TARGET_WRITE_SP(X) (sparc64_write_sp (X)) -#define TARGET_WRITE_FP(X) (sparc64_write_fp (X)) - #undef TM_PRINT_INSN_MACH #define TM_PRINT_INSN_MACH bfd_mach_sparc_v9a -CORE_ADDR sp64_push_arguments PARAMS ((int, struct value **, CORE_ADDR, unsigned char, CORE_ADDR)); -#undef PUSH_ARGUMENTS -#define PUSH_ARGUMENTS(A,B,C,D,E) (sp64_push_arguments ((A), (B), (C), (D), (E))) - -#undef EXTRACT_RETURN_VALUE -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - sparc64_extract_return_value(TYPE, REGBUF, VALBUF, 0) -extern void -sparc64_extract_return_value PARAMS ((struct type *, char[], char *, int)); diff --git a/gdb/config/sparc/tm-sp64sim.h b/gdb/config/sparc/tm-sp64sim.h index 8d83db1eebf..f4e63e29fff 100644 --- a/gdb/config/sparc/tm-sp64sim.h +++ b/gdb/config/sparc/tm-sp64sim.h @@ -45,7 +45,6 @@ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 5419ecb88e2..49587478822 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -21,103 +21,148 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -struct frame_info; struct type; struct value; +struct frame_info; -#define TARGET_BYTE_ORDER BIG_ENDIAN - -/* Floating point is IEEE compatible. */ -#define IEEE_FLOAT - -/* If an argument is declared "register", Sun cc will keep it in a register, - never saving it onto the stack. So we better not believe the "p" symbol - descriptor stab. */ - -#define USE_REGISTER_NOT_ARG - -/* When passing a structure to a function, Sun cc passes the address - not the structure itself. It (under SunOS4) creates two symbols, - which we need to combine to a LOC_REGPARM. Gcc version two (as of - 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart enough to - distinguish between Sun cc, gcc version 1 and gcc version 2. */ - -#define REG_STRUCT_HAS_ADDR(gcc_p,type) (gcc_p != 1) - -/* Sun /bin/cc gets this right as of SunOS 4.1.x. We need to define - BELIEVE_PCC_PROMOTION to get this right now that the code which - detects gcc2_compiled. is broken. This loses for SunOS 4.0.x and - earlier. */ +/* + * The following enums are purely for the convenience of the GDB + * developer, when debugging GDB. + */ -#define BELIEVE_PCC_PROMOTION 1 +enum { /* Sparc general registers, for all sparc versions. */ + G0_REGNUM, G1_REGNUM, G2_REGNUM, G3_REGNUM, + G4_REGNUM, G5_REGNUM, G6_REGNUM, G7_REGNUM, + O0_REGNUM, O1_REGNUM, O2_REGNUM, O3_REGNUM, + O4_REGNUM, O5_REGNUM, O6_REGNUM, O7_REGNUM, + L0_REGNUM, L1_REGNUM, L2_REGNUM, L3_REGNUM, + L4_REGNUM, L5_REGNUM, L6_REGNUM, L7_REGNUM, + I0_REGNUM, I1_REGNUM, I2_REGNUM, I3_REGNUM, + I4_REGNUM, I5_REGNUM, I6_REGNUM, I7_REGNUM, + FP0_REGNUM /* Floating point register 0 */ +}; + +enum { /* Sparc general registers, alternate names. */ + R0_REGNUM, R1_REGNUM, R2_REGNUM, R3_REGNUM, + R4_REGNUM, R5_REGNUM, R6_REGNUM, R7_REGNUM, + R8_REGNUM, R9_REGNUM, R10_REGNUM, R11_REGNUM, + R12_REGNUM, R13_REGNUM, R14_REGNUM, R15_REGNUM, + R16_REGNUM, R17_REGNUM, R18_REGNUM, R19_REGNUM, + R20_REGNUM, R21_REGNUM, R22_REGNUM, R23_REGNUM, + R24_REGNUM, R25_REGNUM, R26_REGNUM, R27_REGNUM, + R28_REGNUM, R29_REGNUM, R30_REGNUM, R31_REGNUM +}; + +enum { /* Sparc32 control registers. */ + PS_REGNUM = 65, /* PC, NPC, and Y are omitted because */ + WIM_REGNUM = 66, /* they have different values depending on */ + TBR_REGNUM = 67, /* 32-bit / 64-bit mode. */ + FPS_REGNUM = 70, + CPS_REGNUM = 71 +}; + +/* v9 misc. and priv. regs */ + +/* Note: specifying values explicitly for documentation purposes. */ +enum { /* Sparc64 control registers, excluding Y, PC, and NPC. */ + CCR_REGNUM = 82, /* Condition Code Register (%xcc,%icc) */ + FSR_REGNUM = 83, /* Floating Point State */ + FPRS_REGNUM = 84, /* Floating Point Registers State */ + ASI_REGNUM = 86, /* Alternate Space Identifier */ + VER_REGNUM = 87, /* Version register */ + TICK_REGNUM = 88, /* Tick register */ + PIL_REGNUM = 89, /* Processor Interrupt Level */ + PSTATE_REGNUM = 90, /* Processor State */ + TSTATE_REGNUM = 91, /* Trap State */ + TBA_REGNUM = 92, /* Trap Base Address */ + TL_REGNUM = 93, /* Trap Level */ + TT_REGNUM = 94, /* Trap Type */ + TPC_REGNUM = 95, /* Trap pc */ + TNPC_REGNUM = 96, /* Trap npc */ + WSTATE_REGNUM = 97, /* Window State */ + CWP_REGNUM = 98, /* Current Window Pointer */ + CANSAVE_REGNUM = 99, /* Savable Windows */ + CANRESTORE_REGNUM = 100, /* Restorable Windows */ + CLEANWIN_REGNUM = 101, /* Clean Windows */ + OTHERWIN_REGNUM = 102, /* Other Windows */ + ASR16_REGNUM = 103, /* Ancillary State Registers */ + ASR17_REGNUM = 104, + ASR18_REGNUM = 105, + ASR19_REGNUM = 106, + ASR20_REGNUM = 107, + ASR21_REGNUM = 108, + ASR22_REGNUM = 109, + ASR23_REGNUM = 110, + ASR24_REGNUM = 111, + ASR25_REGNUM = 112, + ASR26_REGNUM = 113, + ASR27_REGNUM = 114, + ASR28_REGNUM = 115, + ASR29_REGNUM = 116, + ASR30_REGNUM = 117, + ASR31_REGNUM = 118, + ICC_REGNUM = 119, /* 32 bit condition codes */ + XCC_REGNUM = 120, /* 64 bit condition codes */ + FCC0_REGNUM = 121, /* fp cc reg 0 */ + FCC1_REGNUM = 122, /* fp cc reg 1 */ + FCC2_REGNUM = 123, /* fp cc reg 2 */ + FCC3_REGNUM = 124 /* fp cc reg 3 */ +}; -/* For acc, there's no need to correct LBRAC entries by guessing how - they should work. In fact, this is harmful because the LBRAC - entries now all appear at the end of the function, not intermixed - with the SLINE entries. n_opt_found detects acc for Solaris binaries; - function_stab_type detects acc for SunOS4 binaries. +/* + * Make sparc target multi-archable: April 2000 + */ - For binary from SunOS4 /bin/cc, need to correct LBRAC's. +#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0) + +/* Multi-arch definition of TARGET_IS_SPARC64, TARGET_ELF64 */ +#undef GDB_TARGET_IS_SPARC64 +#define GDB_TARGET_IS_SPARC64 \ + (sparc_intreg_size () == 8) +#undef TARGET_ELF64 +#define TARGET_ELF64 \ + (sparc_intreg_size () == 8) +extern int sparc_intreg_size (void); +#else + +/* Non-multi-arch: if it isn't defined, define it to zero. */ +#ifndef GDB_TARGET_IS_SPARC64 +#define GDB_TARGET_IS_SPARC64 0 +#endif +#ifndef TARGET_ELF64 +#define TARGET_ELF64 0 +#endif +#endif - For gcc, like acc, don't correct. */ +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH + */ -#define SUN_FIXED_LBRAC_BUG \ - (n_opt_found \ - || function_stab_type == N_STSYM \ - || function_stab_type == N_GSYM \ - || processing_gcc_compilation) +/* Initializer for an array of names of registers. + There should be NUM_REGS strings in this initializer. */ -/* Do variables in the debug stabs occur after the N_LBRAC or before it? - acc: after, gcc: before, SunOS4 /bin/cc: before. */ +#define REGISTER_NAMES \ +{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ + "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \ + "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \ + "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \ + \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ + \ + "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" \ +} -#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) \ - (!(gcc_p) \ - && (n_opt_found \ - || function_stab_type == N_STSYM \ - || function_stab_type == N_GSYM)) +#define TARGET_BYTE_ORDER BIG_ENDIAN /* Offset from address of function to start of its code. Zero on most machines. */ #define FUNCTION_START_OFFSET 0 -/* Advance PC across any function entry prologue instructions - to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances - the PC past some of the prologue, but stops as soon as it - knows that the function has a frame. Its result is equal - to its input PC if the function is frameless, unequal otherwise. */ - -#define SKIP_PROLOGUE(pc) (sparc_skip_prologue (pc, 0)) -#define SKIP_PROLOGUE_FRAMELESS_P(pc) (sparc_skip_prologue (pc, 1)) -extern CORE_ADDR sparc_skip_prologue PARAMS ((CORE_ADDR, int)); - -/* Immediately after a function call, return the saved pc. - Can't go through the frames for this because on some machines - the new frame is not set up until the new function executes - some instructions. */ - -/* On the Sun 4 under SunOS, the compile will leave a fake insn which - encodes the structure size being returned. If we detect such - a fake insn, step past it. */ - -#define PC_ADJUST(pc) sparc_pc_adjust(pc) -extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR)); - -#define SAVED_PC_AFTER_CALL(frame) PC_ADJUST (read_register (RP_REGNUM)) - -/* Stack grows downward. */ - -#define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) - -/* Stack must be aligned on 64-bit boundaries when synthesizing - function calls. */ - -#define STACK_ALIGN(ADDR) (((ADDR) + 7) & -8) - -/* Sequence of bytes for breakpoint instruction (ta 1). */ - -#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01} - /* Amount PC must be decremented by after a breakpoint. This is often the number of bytes in BREAKPOINT but not always. */ @@ -134,91 +179,48 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR)); #define NUM_REGS 72 -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ - -#define REGISTER_NAMES \ -{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ - "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \ - "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \ - "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \ - \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ - \ - "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" } - -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -#define G0_REGNUM 0 /* %g0 */ -#define G1_REGNUM 1 /* %g1 */ -#define O0_REGNUM 8 /* %o0 */ #define SP_REGNUM 14 /* Contains address of top of stack, \ which is also the bottom of the frame. */ -#define RP_REGNUM 15 /* Contains return address value, *before* \ - any windows get switched. */ -#define O7_REGNUM 15 /* Last local reg not saved on stack frame */ -#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 I7_REGNUM 31 /* Last local reg saved on stack frame */ + #define FP0_REGNUM 32 /* Floating point register 0 */ + #define Y_REGNUM 64 /* Temp register for multiplication, etc. */ -#define PS_REGNUM 65 /* Contains processor status */ -#define PS_FLAG_CARRY 0x100000 /* Carry bit in PS */ -#define WIM_REGNUM 66 /* Window Invalid Mask (not really supported) */ -#define TBR_REGNUM 67 /* Trap Base Register (not really supported) */ + #define PC_REGNUM 68 /* Contains program counter */ + #define NPC_REGNUM 69 /* Contains next PC */ -#define FPS_REGNUM 70 /* Floating point status register */ -#define CPS_REGNUM 71 /* Coprocessor status register */ + /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. On the sparc, `registers' contains the ins and locals, even though they are saved on the stack rather than with the other registers, and this causes hair - and confusion in places like pop_frame. It might be - better to remove the ins and locals from `registers', make sure - that get_saved_register can get them from the stack (even in the + and confusion in places like pop_frame. It might be better to + remove the ins and locals from `registers', make sure that + get_saved_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. */ + 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. */ #define REGISTER_BYTES (32*4+32*4+8*4) /* Index within `registers' of the first byte of the space for register N. */ -/* ?? */ -#define REGISTER_BYTE(N) ((N)*4) - -/* We need to override GET_SAVED_REGISTER so that we can deal with the way - outs change into ins in different frames. HAVE_REGISTER_WINDOWS can't - deal with this case and also handle flat frames at the same time. */ -struct frame_info; -void sparc_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lvalp)); -#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ - sparc_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) +#define REGISTER_BYTE(N) ((N)*4) -/* Number of bytes of storage in the actual machine representation - for register N. */ +/* Number of bytes of storage in the actual machine representation for + register N. */ -/* On the SPARC, all regs are 4 bytes. */ +/* On the SPARC, all regs are 4 bytes (except Sparc64, where they're 8). */ #define REGISTER_RAW_SIZE(N) (4) /* Number of bytes of storage in the program's representation for register N. */ -/* On the SPARC, all regs are 4 bytes. */ +/* On the SPARC, all regs are 4 bytes (except Sparc64, where they're 8). */ #define REGISTER_VIRTUAL_SIZE(N) (4) @@ -234,48 +236,186 @@ void sparc_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_AD of data in register N. */ #define REGISTER_VIRTUAL_TYPE(N) \ - ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \ - builtin_type_int) + ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \ + builtin_type_int) -/* Writing to %g0 is a noop (not an error or exception or anything like - that, however). */ +/* Sun /bin/cc gets this right as of SunOS 4.1.x. We need to define + BELIEVE_PCC_PROMOTION to get this right now that the code which + detects gcc2_compiled. is broken. This loses for SunOS 4.0.x and + earlier. */ -#define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM) +#define BELIEVE_PCC_PROMOTION 1 -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function_by_hand. - The ultimate mystery is, tho, what is the value "16"? */ +/* Advance PC across any function entry prologue instructions + to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances + the PC past some of the prologue, but stops as soon as it + knows that the function has a frame. Its result is equal + to its input PC if the function is frameless, unequal otherwise. */ -#define STORE_STRUCT_RETURN(ADDR, SP) \ - { char val[4]; \ - store_unsigned_integer (val, 4, (ADDR)); \ - write_memory ((SP)+(16*4), val, 4); } +#define SKIP_PROLOGUE(PC) sparc_skip_prologue (PC, 0) -/* 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. */ +/* Immediately after a function call, return the saved pc. + Can't go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. */ + +#define SAVED_PC_AFTER_CALL(FRAME) PC_ADJUST (read_register (RP_REGNUM)) + +/* Stack grows downward. */ + +#define INNER_THAN(LHS,RHS) ((LHS) < (RHS)) -#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ - sparc_extract_return_value(TYPE, REGBUF, VALBUF) -extern void -sparc_extract_return_value PARAMS ((struct type *, char[], char *)); +/* Write into appropriate registers a function return value of type + TYPE, given in virtual format. */ -/* Write into appropriate registers a function return value - of type TYPE, given in virtual format. */ -#define STORE_RETURN_VALUE(TYPE,VALBUF) \ - sparc_store_return_value(TYPE, VALBUF) -extern void sparc_store_return_value PARAMS ((struct type *, char *)); +#define STORE_RETURN_VALUE(TYPE, VALBUF) \ + sparc_store_return_value (TYPE, VALBUF) +extern void sparc_store_return_value (struct type *, char *); /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, as a CORE_ADDR (or an expression that can be used as one). */ #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (sparc_extract_struct_value_address (REGBUF)) + sparc_extract_struct_value_address (REGBUF) -extern CORE_ADDR - sparc_extract_struct_value_address PARAMS ((char[REGISTER_BYTES])); - +extern CORE_ADDR sparc_extract_struct_value_address (char *); + +/* If the current gcc for for this target does not produce correct + debugging information for float parameters, both prototyped and + unprototyped, then define this macro. This forces gdb to always + assume that floats are passed as doubles and then converted in the + callee. */ + +#define COERCE_FLOAT_TO_DOUBLE(FORMAL, ACTUAL) (1) + +/* Stack must be aligned on 64-bit boundaries when synthesizing + function calls (128-bit for sparc64). */ + +#define STACK_ALIGN(ADDR) sparc32_stack_align (ADDR) +extern CORE_ADDR sparc32_stack_align (CORE_ADDR addr); + +/* Floating point is IEEE compatible. */ +#define IEEE_FLOAT (1) + +/* The Sparc returns long doubles on the stack. */ + +#define RETURN_VALUE_ON_STACK(TYPE) \ + (TYPE_CODE(TYPE) == TYPE_CODE_FLT \ + && TYPE_LENGTH(TYPE) > 8) + +/* When passing a structure to a function, Sun cc passes the address + not the structure itself. It (under SunOS4) creates two symbols, + which we need to combine to a LOC_REGPARM. Gcc version two (as of + 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart enough to + distinguish between Sun cc, gcc version 1 and gcc version 2. */ + +#define REG_STRUCT_HAS_ADDR(GCC_P, TYPE) \ + sparc_reg_struct_has_addr (GCC_P, TYPE) +extern int sparc_reg_struct_has_addr (int, struct type *); + +#endif /* GDB_MULTI_ARCH */ + +#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0) +/* + * The following defines should ONLY appear for MULTI_ARCH. + */ + +/* Multi-arch the nPC and Y registers. */ +#define Y_REGNUM (sparc_y_regnum ()) +extern int sparc_npc_regnum (void); +extern int sparc_y_regnum (void); + +#endif /* GDB_MULTI_ARCH */ + +/* On the Sun 4 under SunOS, the compile will leave a fake insn which + encodes the structure size being returned. If we detect such + a fake insn, step past it. */ + +#define PC_ADJUST(PC) sparc_pc_adjust (PC) +extern CORE_ADDR sparc_pc_adjust (CORE_ADDR); + +/* Advance PC across any function entry prologue instructions to reach + some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances the PC past + some of the prologue, but stops as soon as it knows that the + function has a frame. Its result is equal to its input PC if the + function is frameless, unequal otherwise. */ + +#define SKIP_PROLOGUE_FRAMELESS_P(PC) sparc_skip_prologue (PC, 1) +extern CORE_ADDR sparc_skip_prologue (CORE_ADDR, int); + +/* If an argument is declared "register", Sun cc will keep it in a register, + never saving it onto the stack. So we better not believe the "p" symbol + descriptor stab. */ + +#define USE_REGISTER_NOT_ARG + +/* For acc, there's no need to correct LBRAC entries by guessing how + they should work. In fact, this is harmful because the LBRAC + entries now all appear at the end of the function, not intermixed + with the SLINE entries. n_opt_found detects acc for Solaris binaries; + function_stab_type detects acc for SunOS4 binaries. + + For binary from SunOS4 /bin/cc, need to correct LBRAC's. + + For gcc, like acc, don't correct. */ + +#define SUN_FIXED_LBRAC_BUG \ + (n_opt_found \ + || function_stab_type == N_STSYM \ + || function_stab_type == N_GSYM \ + || processing_gcc_compilation) + +/* Do variables in the debug stabs occur after the N_LBRAC or before it? + acc: after, gcc: before, SunOS4 /bin/cc: before. */ + +#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) \ + (!(gcc_p) \ + && (n_opt_found \ + || function_stab_type == N_STSYM \ + || function_stab_type == N_GSYM)) + +/* Sequence of bytes for breakpoint instruction (ta 1). */ + +#define BREAKPOINT {0x91, 0xd0, 0x20, 0x01} + +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ + +#define G0_REGNUM 0 /* %g0 */ +#define G1_REGNUM 1 /* %g1 */ +#define O0_REGNUM 8 /* %o0 */ +#define RP_REGNUM 15 /* Contains return address value, *before* \ + any windows get switched. */ +#define O7_REGNUM 15 /* Last local reg not saved on stack frame */ +#define L0_REGNUM 16 /* First local reg that's saved on stack frame + rather than in machine registers */ +#define I0_REGNUM 24 /* %i0 */ +#define I7_REGNUM 31 /* Last local reg saved on stack frame */ +#define PS_REGNUM 65 /* Contains processor status */ +#define PS_FLAG_CARRY 0x100000 /* Carry bit in PS */ +#define WIM_REGNUM 66 /* Window Invalid Mask (not really supported) */ +#define TBR_REGNUM 67 /* Trap Base Register (not really supported) */ +#define FPS_REGNUM 70 /* Floating point status register */ +#define CPS_REGNUM 71 /* Coprocessor status register */ + +/* Writing to %g0 is a noop (not an error or exception or anything like + that, however). */ + +#define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM) + +/* + * FRAME_CHAIN and FRAME_INFO definitions, collected here for convenience. + */ + +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. + */ /* Describe the pointer in each stack frame to the previous stack frame (its caller). */ @@ -310,88 +450,102 @@ extern CORE_ADDR GCC 2.6 and later can generate ``flat register window'' code that makes frames by explicitly saving those registers that need to be - saved. %i7 is used as the frame pointer, and the frame is laid out so - that flat and non-flat calls can be intermixed freely within a - program. Unfortunately for GDB, this means it must detect and record - the flatness of frames. + saved. %i7 is used as the frame pointer, and the frame is laid out + so that flat and non-flat calls can be intermixed freely within a + program. Unfortunately for GDB, this means it must detect and + record the flatness of frames. Since the prologue in a flat frame also tells us where fp and pc have been stashed (the frame is of variable size, so their location is not fixed), it's convenient to record them in the frame info. */ -#define EXTRA_FRAME_INFO \ - CORE_ADDR bottom; \ - int in_prologue; \ - int flat; \ +#define EXTRA_FRAME_INFO \ + CORE_ADDR bottom; \ + int in_prologue; \ + int flat; \ /* Following fields only relevant for flat frames. */ \ - CORE_ADDR pc_addr; \ - CORE_ADDR fp_addr; \ + CORE_ADDR pc_addr; \ + CORE_ADDR fp_addr; \ /* Add this to ->frame to get the value of the stack pointer at the */ \ /* time of the register saves. */ \ int sp_offset; -#define FRAME_INIT_SAVED_REGS(fp) /*no-op */ - -#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \ - sparc_init_extra_frame_info (fromleaf, fci) -extern void sparc_init_extra_frame_info PARAMS ((int, struct frame_info *)); +/* We need to override GET_SAVED_REGISTER so that we can deal with the way + outs change into ins in different frames. HAVE_REGISTER_WINDOWS can't + deal with this case and also handle flat frames at the same time. */ -#define PRINT_EXTRA_FRAME_INFO(fi) \ - { \ - if ((fi) && (fi)->flat) \ - printf_filtered (" flat, pc saved at 0x%s, fp saved at 0x%s\n", \ - paddr_nz ((fi)->pc_addr), paddr_nz ((fi)->fp_addr)); \ - } +void sparc_get_saved_register (char *raw_buffer, + int *optimized, + CORE_ADDR * addrp, + struct frame_info *frame, + int regnum, enum lval_type *lvalp); -#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe)) -extern CORE_ADDR sparc_frame_chain PARAMS ((struct frame_info *)); +#define GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \ + sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \ + FRAME, REGNUM, LVAL) -/* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */ +#define FRAME_INIT_SAVED_REGS(FP) /*no-op */ -#define INIT_FRAME_PC(fromleaf, prev) /* nothing */ -#define INIT_FRAME_PC_FIRST(fromleaf, prev) \ - (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \ - (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ()); +#define INIT_EXTRA_FRAME_INFO(FROMLEAF, FCI) \ + sparc_init_extra_frame_info (FROMLEAF, FCI) +extern void sparc_init_extra_frame_info (int, struct frame_info *); -/* Define other aspects of the stack frame. */ +#define FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME)) +extern CORE_ADDR sparc_frame_chain (struct frame_info *); /* 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. */ -#define FRAMELESS_FUNCTION_INVOCATION(FI) \ - (frameless_look_for_prologue(FI)) -/* The location of I0 w.r.t SP. This is actually dependent on how the system's - window overflow/underflow routines are written. Most vendors save the L regs - followed by the I regs (at the higher address). Some vendors get it wrong. - */ - -#define FRAME_SAVED_L0 0 -#define FRAME_SAVED_I0 (8 * REGISTER_RAW_SIZE (L0_REGNUM)) +#define FRAMELESS_FUNCTION_INVOCATION(FI) \ + frameless_look_for_prologue (FI) /* Where is the PC for a specific frame */ #define FRAME_SAVED_PC(FRAME) sparc_frame_saved_pc (FRAME) -extern CORE_ADDR sparc_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *); /* If the argument is on the stack, it will be here. */ -#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) - -#define FRAME_STRUCT_ARGS_ADDRESS(fi) ((fi)->frame) +#define FRAME_ARGS_ADDRESS(FI) ((FI)->frame) -#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) +#define FRAME_LOCALS_ADDRESS(FI) ((FI)->frame) /* Set VAL to the number of args passed to frame described by FI. Can set VAL to -1, meaning no way to tell. */ /* We can't tell how many args there are now that the C compiler delays popping them. */ -#define FRAME_NUM_ARGS(fi) (-1) +#define FRAME_NUM_ARGS(FI) (-1) /* Return number of bytes at start of arglist that are not really args. */ #define FRAME_ARGS_SKIP 68 - + +#endif /* GDB_MULTI_ARCH */ + +#define PRINT_EXTRA_FRAME_INFO(FI) \ + sparc_print_extra_frame_info (FI) +extern void sparc_print_extra_frame_info (struct frame_info *); + +/* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */ + +#define INIT_FRAME_PC(FROMLEAF, PREV) /* nothing */ +#define INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \ + (PREV)->pc = ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \ + (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ()); + +/* Define other aspects of the stack frame. */ + +/* The location of I0 w.r.t SP. This is actually dependent on how the + system's window overflow/underflow routines are written. Most + vendors save the L regs followed by the I regs (at the higher + address). Some vendors get it wrong. */ + +#define FRAME_SAVED_L0 0 +#define FRAME_SAVED_I0 (8 * REGISTER_RAW_SIZE (L0_REGNUM)) + +#define FRAME_STRUCT_ARGS_ADDRESS(FI) ((FI)->frame) + /* Things needed for making the inferior call functions. */ /* * First of all, let me give my opinion of what the DUMMY_FRAME @@ -455,20 +609,13 @@ extern CORE_ADDR sparc_frame_saved_pc PARAMS ((struct frame_info *)); * CALL_DUMMY, as directed by call_function). */ -/* Push an empty stack frame, to record the current PC, etc. */ - -#define PUSH_DUMMY_FRAME sparc_push_dummy_frame () -#define POP_FRAME sparc_pop_frame () - -void sparc_push_dummy_frame PARAMS ((void)), sparc_pop_frame PARAMS ((void)); - #ifndef CALL_DUMMY /* This sequence of words is the instructions - 0: bc 10 00 01 mov %g1, %fp - 4: 9d e3 80 00 save %sp, %g0, %sp - 8: bc 10 00 02 mov %g2, %fp - c: be 10 00 03 mov %g3, %i7 + 00: bc 10 00 01 mov %g1, %fp + 04: 9d e3 80 00 save %sp, %g0, %sp + 08: bc 10 00 02 mov %g2, %fp + 0c: be 10 00 03 mov %g3, %i7 10: da 03 a0 58 ld [ %sp + 0x58 ], %o5 14: d8 03 a0 54 ld [ %sp + 0x54 ], %o4 18: d6 03 a0 50 ld [ %sp + 0x50 ], %o3 @@ -485,7 +632,12 @@ void sparc_push_dummy_frame PARAMS ((void)), sparc_pop_frame PARAMS ((void)); * this is a multiple of 8 (not only 4) bytes. * the `call' insn is a relative, not an absolute call. * the `nop' at the end is needed to keep the trap from - clobbering things (if NPC pointed to garbage instead). + clobbering things (if NPC pointed to garbage instead). + */ + +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. */ #define CALL_DUMMY { 0xbc100001, 0x9de38000, 0xbc100002, 0xbe100003, \ @@ -506,38 +658,93 @@ void sparc_push_dummy_frame PARAMS ((void)), sparc_pop_frame PARAMS ((void)); #define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + 0x24) -/* Offset within CALL_DUMMY of the 'ta 1' instruction. */ +/* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */ #define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30) #define CALL_DUMMY_STACK_ADJUST 68 -#endif +/* Call dummy method (eg. on stack, at entry point, etc.) */ + +#define CALL_DUMMY_LOCATION ON_STACK + +/* Method for detecting dummy frames. */ + +#define PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \ + pc_in_call_dummy_on_stack (PC, SP, FRAME_ADDRESS) + +#endif /* GDB_MULTI_ARCH */ + +#endif /* CALL_DUMMY */ + +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. + */ + /* 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) \ - sparc_fix_call_dummy (dummyname, pc, fun, type, gcc_p) -void sparc_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, - struct type * value_type, int using_gcc)); +#define 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 Sparc returns long doubles on the stack. */ +/* Arguments smaller than an int must be promoted to ints when + synthesizing function calls. */ + +/* Push an empty stack frame, to record the current PC, etc. */ + +#define PUSH_DUMMY_FRAME sparc_push_dummy_frame () +#define POP_FRAME sparc_pop_frame () + +void sparc_push_dummy_frame (void); +void sparc_pop_frame (void); + +#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ + sparc32_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) + +extern CORE_ADDR +sparc32_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); + +/* Store the address of the place in which to copy the structure the + subroutine will return. This is called from call_function_by_hand. + The ultimate mystery is, tho, what is the value "16"? */ + +#define STORE_STRUCT_RETURN(ADDR, SP) \ + { char val[4]; \ + store_unsigned_integer (val, 4, (ADDR)); \ + write_memory ((SP)+(16*4), val, 4); } + +/* Default definition of USE_STRUCT_CONVENTION. */ + +#ifndef USE_STRUCT_CONVENTION +#define USE_STRUCT_CONVENTION(GCC_P, TYPE) \ + generic_use_struct_convention (GCC_P, TYPE) +#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. */ + +#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ + sparc32_extract_return_value (TYPE, REGBUF, VALBUF) +extern void sparc32_extract_return_value (struct type *, char[], char *); + +#endif /* GDB_MULTI_ARCH */ -#define RETURN_VALUE_ON_STACK(TYPE) \ - (TYPE_CODE(TYPE) == TYPE_CODE_FLT \ - && TYPE_LENGTH(TYPE) > 8) /* Sparc has no reliable single step ptrace call */ #define SOFTWARE_SINGLE_STEP_P 1 -extern void sparc_software_single_step PARAMS ((unsigned int, int)); +extern void sparc_software_single_step (unsigned int, int); #define SOFTWARE_SINGLE_STEP(sig,bp_p) sparc_software_single_step (sig,bp_p) /* We need more arguments in a frame specification for the "frame" or "info frame" command. */ #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) -extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); +extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); /* To print every pair of float registers as a double, we use this hook. We also print the condition code registers in a readable format @@ -546,8 +753,7 @@ extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); #undef PRINT_REGISTER_HOOK #define PRINT_REGISTER_HOOK(regno) \ sparc_print_register_hook (regno) -extern void sparc_print_register_hook PARAMS ((int regno)); - +extern void sparc_print_register_hook (int regno); /* Optimization for storing registers to the inferior. The hook DO_DEFERRED_STORES @@ -564,21 +770,7 @@ extern int deferred_stores; #define CLEAR_DEFERRED_STORES \ deferred_stores = 0; -/* If the current gcc for for this target does not produce correct debugging - information for float parameters, both prototyped and unprototyped, then - define this macro. This forces gdb to always assume that floats are - passed as doubles and then converted in the callee. */ - -#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) - /* Select the sparc disassembler */ #define TM_PRINT_INSN_MACH bfd_mach_sparc -/* Arguments smaller than an int must promoted to ints when synthesizing - function calls. */ - -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ - (sparc_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) -extern CORE_ADDR - sparc_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR)); diff --git a/gdb/config/sparc/tm-sparclet.h b/gdb/config/sparc/tm-sparclet.h index 2cec5128b08..b2863bfb824 100644 --- a/gdb/config/sparc/tm-sparclet.h +++ b/gdb/config/sparc/tm-sparclet.h @@ -18,9 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define TARGET_SPARCLET 1 /* Still needed for non-multi-arch case */ + #include "sparc/tm-sparc.h" -#define TARGET_SPARCLET 1 +/* Note: we are not defining GDB_MULTI_ARCH for the sparclet target + at this time, because we have not figured out how to detect the + sparclet target from the bfd structure. */ + +/* Sparclet regs, for debugging purposes. */ + +enum { + CCSR_REGNUM = 72, + CCPR_REGNUM = 73, + CCCRCR_REGNUM = 74, + CCOR_REGNUM = 75, + CCOBR_REGNUM = 76, + CCIBR_REGNUM = 77, + CCIR_REGNUM = 78 +}; /* Select the sparclet disassembler. Slightly different instruction set from the V8 sparc. */ @@ -38,6 +54,11 @@ #define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01} #define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91} +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. + */ + #undef NUM_REGS /* formerly "72" */ /* WIN FP CPU CCP ASR AWR APSR */ #define NUM_REGS (32 + 32 + 8 + 8 + 8/*+ 32 + 1*/) @@ -80,7 +101,7 @@ /* Remove FP dependant code which was defined in tm-sparc.h */ #undef FP0_REGNUM /* Floating point register 0 */ -#undef FPS_REGNUM /* Floating point status register */ +#undef FPS_REGNUM /* Floating point status register */ #undef CPS_REGNUM /* Coprocessor status register */ /* sparclet register numbers */ @@ -103,6 +124,8 @@ TYPE_LENGTH (TYPE)); \ } +#endif /* GDB_MULTI_ARCH */ + #undef PRINT_REGISTER_HOOK #define PRINT_REGISTER_HOOK(regno) @@ -127,7 +150,6 @@ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/sparc/tm-sparclite.h b/gdb/config/sparc/tm-sparclite.h index 2e63418b639..1ccb37018bf 100644 --- a/gdb/config/sparc/tm-sparclite.h +++ b/gdb/config/sparc/tm-sparclite.h @@ -18,10 +18,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_SPARCLITE 1 +#define TARGET_SPARCLITE 1 /* Still needed for non-multi-arch case */ #include "sparc/tm-sparc.h" +/* Note: we are not defining GDB_MULTI_ARCH for the sparclet target + at this time, because we have not figured out how to detect the + sparclet target from the bfd structure. */ + +/* Sparclite regs, for debugging purposes */ + +enum { + DIA1_REGNUM = 72, /* debug instr address register 1 */ + DIA2_REGNUM = 73, /* debug instr address register 2 */ + DDA1_REGNUM = 74, /* debug data address register 1 */ + DDA2_REGNUM = 75, /* debug data address register 2 */ + DDV1_REGNUM = 76, /* debug data value register 1 */ + DDV2_REGNUM = 77, /* debug data value register 2 */ + DCR_REGNUM = 78, /* debug control register */ + DSR_REGNUM = 79 /* debug status regsiter */ +}; + /* overrides of tm-sparc.h */ #undef TARGET_BYTE_ORDER @@ -39,7 +56,13 @@ #define DECR_PC_AFTER_HW_BREAK 4 -#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi) +#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0) +/* + * The following defines must go away for MULTI_ARCH. + */ + +#undef FRAME_CHAIN_VALID +#define FRAME_CHAIN_VALID(FP,FI) func_frame_chain_valid (FP, FI) #undef NUM_REGS #define NUM_REGS 80 @@ -71,6 +94,8 @@ #define DCR_REGNUM 78 /* debug control register */ #define DSR_REGNUM 79 /* debug status regsiter */ +#endif /* GDB_MULTI_ARCH */ + #define TARGET_HW_BREAK_LIMIT 2 #define TARGET_HW_WATCH_LIMIT 2 diff --git a/gdb/config/sparc/tm-spc-em.h b/gdb/config/sparc/tm-spc-em.h index 2391f83f215..830f89bfdda 100644 --- a/gdb/config/sparc/tm-spc-em.h +++ b/gdb/config/sparc/tm-spc-em.h @@ -41,7 +41,6 @@ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/gdb/config/sparc/tm-sun4os4.h b/gdb/config/sparc/tm-sun4os4.h index 5acc70fc845..1026d502d40 100644 --- a/gdb/config/sparc/tm-sun4os4.h +++ b/gdb/config/sparc/tm-sun4os4.h @@ -26,7 +26,7 @@ #undef SKIP_TRAMPOLINE_CODE #define SKIP_TRAMPOLINE_CODE(pc) sunos4_skip_trampoline_code (pc) -extern CORE_ADDR sunos4_skip_trampoline_code PARAMS ((CORE_ADDR)); +extern CORE_ADDR sunos4_skip_trampoline_code (CORE_ADDR); /* Offsets into jmp_buf. Not defined by Sun, but at least documented in a comment in ! */ @@ -49,11 +49,10 @@ extern CORE_ADDR sunos4_skip_trampoline_code PARAMS ((CORE_ADDR)); extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -extern char *sunpro_static_transform_name PARAMS ((char *)); +extern char *sunpro_static_transform_name (char *); #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x) #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '$') diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h index a432d612463..6ff45ee15cf 100644 --- a/gdb/config/sparc/tm-sun4sol2.h +++ b/gdb/config/sparc/tm-sun4sol2.h @@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define GDB_MULTI_ARCH 2 + #include "sparc/tm-sparc.h" #include "tm-sysv4.h" @@ -61,8 +63,7 @@ extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. This routine returns true on success */ -extern int -get_longjmp_target PARAMS ((CORE_ADDR *)); +extern int get_longjmp_target (CORE_ADDR *); #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) #endif /* 0 */ @@ -71,7 +72,7 @@ get_longjmp_target PARAMS ((CORE_ADDR *)); and for SunPRO 3.0, N_FUN symbols too. */ #define SOFUN_ADDRESS_MAYBE_MISSING -extern char *sunpro_static_transform_name PARAMS ((char *)); +extern char *sunpro_static_transform_name (char *); #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x) #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '$') diff --git a/gdb/config/sparc/xm-sun4sol2.h b/gdb/config/sparc/xm-sun4sol2.h index 01218fd2d23..3edb5abdf54 100644 --- a/gdb/config/sparc/xm-sun4sol2.h +++ b/gdb/config/sparc/xm-sun4sol2.h @@ -26,13 +26,6 @@ #include "xm-sysv4.h" -/* gdb wants to use the prgregset_t interface rather than - the gregset_t interface, partly because that's what's - used in core-sol2.c */ - -#define GDB_GREGSET_TYPE prgregset_t -#define GDB_FPREGSET_TYPE prfpregset_t - /* These are not currently used in SVR4 (but should be, FIXME!). */ #undef DO_DEFERRED_STORES #undef CLEAR_DEFERRED_STORES diff --git a/gdb/config/tahoe/tm-tahoe.h b/gdb/config/tahoe/tm-tahoe.h index 5332548c2e0..0dc3e0e6f23 100644 Binary files a/gdb/config/tahoe/tm-tahoe.h and b/gdb/config/tahoe/tm-tahoe.h differ diff --git a/gdb/config/tic80/tm-tic80.h b/gdb/config/tic80/tm-tic80.h index a7accac302a..3f43cb9df5f 100644 --- a/gdb/config/tic80/tm-tic80.h +++ b/gdb/config/tic80/tm-tic80.h @@ -121,7 +121,7 @@ struct frame_saved_regs; /* Discard from the stack the innermost frame, restoring all registers. */ #define POP_FRAME tic80_pop_frame(get_current_frame ()) -extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info * frame)); +extern struct frame_info *tic80_pop_frame (struct frame_info *frame); /* Return number of bytes at start of arglist that are not really args. */ @@ -149,7 +149,7 @@ extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info * frame)); int frameoffset; \ int framereg; -extern void tic80_init_extra_frame_info PARAMS ((struct frame_info * fi)); +extern void tic80_init_extra_frame_info (struct frame_info *fi); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) tic80_init_extra_frame_info (fi) #define INIT_FRAME_PC /* Not necessary */ @@ -161,13 +161,14 @@ extern void tic80_init_extra_frame_info PARAMS ((struct frame_info * fi)); #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ tic80_frame_find_saved_regs(frame_info, &(frame_saved_regs)) -extern void tic80_frame_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *)); +extern void tic80_frame_find_saved_regs (struct frame_info *, + struct frame_saved_regs *); /* Advance PC across any function entry prologue instructions to reach some "real" code. */ #define SKIP_PROLOGUE(pc) (tic80_skip_prologue (pc)) -extern CORE_ADDR tic80_skip_prologue PARAMS ((CORE_ADDR pc)); +extern CORE_ADDR tic80_skip_prologue (CORE_ADDR pc); /* Immediately after a function call, return the saved pc. Can't always go through the frames for this because on some machines @@ -183,10 +184,10 @@ extern CORE_ADDR tic80_skip_prologue PARAMS ((CORE_ADDR pc)); and produces the frame's chain-pointer. */ #define FRAME_CHAIN(thisframe) (CORE_ADDR) tic80_frame_chain (thisframe) -extern CORE_ADDR tic80_frame_chain PARAMS ((struct frame_info *)); +extern CORE_ADDR tic80_frame_chain (struct frame_info *); #define FRAME_SAVED_PC(FRAME) tic80_frame_saved_pc (FRAME) -extern CORE_ADDR tic80_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR tic80_frame_saved_pc (struct frame_info *); /* Store the address of the place in which to copy the structure the subroutine will return. This is called from call_function. @@ -217,17 +218,17 @@ extern CORE_ADDR tic80_frame_saved_pc PARAMS ((struct frame_info *)); /* PUSH_ARGUMENTS */ -extern CORE_ADDR tic80_push_arguments PARAMS ((int nargs, - struct value ** args, - CORE_ADDR sp, - unsigned char struct_return, - CORE_ADDR struct_addr)); +extern CORE_ADDR tic80_push_arguments (int nargs, + struct value **args, + CORE_ADDR sp, + unsigned char struct_return, + CORE_ADDR struct_addr); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (tic80_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) /* PUSH_RETURN_ADDRESS */ -extern CORE_ADDR tic80_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR tic80_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) tic80_push_return_address (PC, SP) /* override the standard get_saved_register function with diff --git a/gdb/config/tm-sysv4.h b/gdb/config/tm-sysv4.h index 61f2568f2a5..f6fda358fe0 100644 --- a/gdb/config/tm-sysv4.h +++ b/gdb/config/tm-sysv4.h @@ -28,7 +28,7 @@ (e.g. on Irix5). */ #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name)) -extern int in_plt_section PARAMS ((CORE_ADDR, char *)); +extern int in_plt_section (CORE_ADDR, char *); /* If PC is in a shared library trampoline code, return the PC where the function itself actually starts. If not, return 0. */ diff --git a/gdb/config/v850/tm-v850.h b/gdb/config/v850/tm-v850.h index 256606a96c7..405b9acc84d 100644 --- a/gdb/config/v850/tm-v850.h +++ b/gdb/config/v850/tm-v850.h @@ -82,7 +82,7 @@ extern char **v850_register_names; #define MAX_REGISTER_VIRTUAL_SIZE 4 -#define BREAKPOINT {0x40, 0xF8} /* little-ended */ +#define BREAKPOINT {0x85, 0x05} /* little-ended */ #define FUNCTION_START_OFFSET 0 @@ -99,19 +99,20 @@ struct value; #define EXTRA_FRAME_INFO struct frame_saved_regs fsr; -extern void v850_init_extra_frame_info PARAMS ((struct frame_info * fi)); +extern void v850_init_extra_frame_info (struct frame_info *fi); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) v850_init_extra_frame_info (fi) #define INIT_FRAME_PC /* Not necessary */ -extern void v850_frame_find_saved_regs PARAMS ((struct frame_info * fi, struct frame_saved_regs * regaddr)); +extern void v850_frame_find_saved_regs (struct frame_info *fi, + struct frame_saved_regs *regaddr); #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr -extern CORE_ADDR v850_frame_chain PARAMS ((struct frame_info * fi)); +extern CORE_ADDR v850_frame_chain (struct frame_info *fi); #define FRAME_CHAIN(fi) v850_frame_chain (fi) #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) -extern CORE_ADDR v850_find_callers_reg PARAMS ((struct frame_info * fi, int regnum)); -extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR v850_find_callers_reg (struct frame_info *fi, int regnum); +extern CORE_ADDR v850_frame_saved_pc (struct frame_info *); #define FRAME_SAVED_PC(FI) (v850_frame_saved_pc (FI)) #define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ @@ -124,7 +125,7 @@ extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *)); #define STORE_RETURN_VALUE(TYPE, VALBUF) \ write_register_bytes(REGISTER_BYTE (V0_REGNUM), VALBUF, TYPE_LENGTH (TYPE)); -extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc)); +extern CORE_ADDR v850_skip_prologue (CORE_ADDR pc); #define SKIP_PROLOGUE(pc) (v850_skip_prologue (pc)) #define FRAME_ARGS_SKIP 0 @@ -133,7 +134,7 @@ extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc)); #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) #define FRAME_NUM_ARGS(fi) (-1) -extern void v850_pop_frame PARAMS ((struct frame_info * frame)); +extern void v850_pop_frame (struct frame_info *frame); #define POP_FRAME v850_pop_frame (get_current_frame ()) #define USE_GENERIC_DUMMY_FRAMES 1 @@ -143,16 +144,15 @@ extern void v850_pop_frame PARAMS ((struct frame_info * frame)); #define CALL_DUMMY_LOCATION AT_ENTRY_POINT #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) #define CALL_DUMMY_ADDRESS() entry_point_address () -extern CORE_ADDR v850_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR v850_push_return_address (CORE_ADDR, CORE_ADDR); #define PUSH_RETURN_ADDRESS(PC, SP) v850_push_return_address (PC, SP) #define PUSH_DUMMY_FRAME generic_push_dummy_frame () extern CORE_ADDR - v850_push_arguments PARAMS ((int nargs, struct value ** args, CORE_ADDR sp, - unsigned char struct_return, - CORE_ADDR struct_addr)); +v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, + unsigned char struct_return, CORE_ADDR struct_addr); #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (v850_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h index 607ee746099..b1439c2c6c2 100644 --- a/gdb/config/vax/tm-vax.h +++ b/gdb/config/vax/tm-vax.h @@ -29,7 +29,7 @@ /* Advance PC across any function entry prologue instructions to reach some "real" code. */ -extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR)); +extern CORE_ADDR vax_skip_prologue (CORE_ADDR); #define SKIP_PROLOGUE(pc) (vax_skip_prologue (pc)) /* Immediately after a function call, return the saved pc. @@ -214,7 +214,7 @@ extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR)); /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ -extern int vax_frame_num_args PARAMS ((struct frame_info * fi)); +extern int vax_frame_num_args (struct frame_info *fi); #define FRAME_NUM_ARGS(fi) (vax_frame_num_args ((fi))) /* Return number of bytes at start of arglist that are not really args. */ diff --git a/gdb/config/w65/tm-w65.h b/gdb/config/w65/tm-w65.h index b1fe4eddceb..b5a5934ba40 100644 --- a/gdb/config/w65/tm-w65.h +++ b/gdb/config/w65/tm-w65.h @@ -22,7 +22,7 @@ #define GDB_TARGET_IS_W65 -#define IEEE_FLOAT 1 +#define IEEE_FLOAT (1) /* Define the bit, byte, and word ordering of the machine. */ @@ -190,7 +190,7 @@ extern CORE_ADDR w65_skip_prologue (); typedef unsigned short INSN_WORD; -extern CORE_ADDR w65_addr_bits_remove PARAMS ((CORE_ADDR)); +extern CORE_ADDR w65_addr_bits_remove (CORE_ADDR); #define ADDR_BITS_REMOVE(addr) w65_addr_bits_remove (addr) #define CALL_DUMMY_LENGTH 10 diff --git a/gdb/config/xm-aix4.h b/gdb/config/xm-aix4.h index 14d62448c65..d1d4cdc2c7a 100644 --- a/gdb/config/xm-aix4.h +++ b/gdb/config/xm-aix4.h @@ -73,7 +73,7 @@ char *termdef (); /* Signal handler for SIGWINCH `window size changed'. */ #define SIGWINCH_HANDLER aix_resizewindow -extern void aix_resizewindow PARAMS ((int)); +extern void aix_resizewindow (int); /* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */ diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index f781e0a868e..544dea5936a 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define IEEE_FLOAT 1 +#define IEEE_FLOAT (1) #undef TARGET_INT_BIT #undef TARGET_LONG_BIT @@ -42,7 +42,7 @@ to reach some "real" code. */ #define SKIP_PROLOGUE(ip) (z8k_skip_prologue (ip)) -extern CORE_ADDR z8k_skip_prologue PARAMS ((CORE_ADDR ip)); +extern CORE_ADDR z8k_skip_prologue (CORE_ADDR ip); /* Immediately after a function call, return the saved pc. @@ -203,7 +203,7 @@ extern CORE_ADDR z8k_frame_saved_pc (struct frame_info *frame); #define FRAME_ARGS_SKIP 8 struct frame_info; -extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *)); +extern void z8k_frame_init_saved_regs (struct frame_info *); #define FRAME_INIT_SAVED_REGS(fi) z8k_frame_init_saved_regs (fi) @@ -259,9 +259,9 @@ extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *)); #define PUSH_DUMMY_FRAME { z8k_push_dummy_frame (); } -extern void z8k_push_dummy_frame PARAMS ((void)); +extern void z8k_push_dummy_frame (void); -extern void z8k_pop_frame PARAMS ((void)); +extern void z8k_pop_frame (void); /* Discard from the stack the innermost frame, restoring all registers. */ @@ -271,7 +271,7 @@ extern void z8k_pop_frame PARAMS ((void)); #define SP_ARG0 (1 * 4) -extern CORE_ADDR z8k_addr_bits_remove PARAMS ((CORE_ADDR)); +extern CORE_ADDR z8k_addr_bits_remove (CORE_ADDR); #define ADDR_BITS_REMOVE(addr) z8k_addr_bits_remove (addr) int sim_z8001_mode; #define BIG (sim_z8001_mode) diff --git a/gdb/configure b/gdb/configure index f1d4e743db3..9c5c4a6654d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -11,6 +11,9 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help @@ -70,7 +73,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -185,7 +187,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 @@ -356,11 +357,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=*) @@ -526,16 +522,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 @@ -575,11 +567,34 @@ fi +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:572: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + # 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:583: checking for $ac_word" >&5 +echo "configure:598: 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 @@ -609,7 +624,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:613: checking for $ac_word" >&5 +echo "configure:628: 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 @@ -660,7 +675,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:664: checking for $ac_word" >&5 +echo "configure:679: 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 @@ -692,7 +707,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:711: 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. @@ -703,12 +718,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 707 "configure" +#line 722 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:727: \"$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 @@ -734,12 +749,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:738: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:753: 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:743: checking whether we are using GNU C" >&5 +echo "configure:758: 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 @@ -748,7 +763,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:752: \"$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:767: \"$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 @@ -767,7 +782,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:771: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:786: 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 @@ -799,7 +814,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:803: checking how to run the C preprocessor" >&5 +echo "configure:818: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -814,13 +829,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:839: \"$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 : @@ -831,13 +846,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:856: \"$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 : @@ -848,13 +863,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:873: \"$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 : @@ -879,9 +894,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:883: checking for AIX" >&5 +echo "configure:898: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:907: checking for POSIXized ISC" >&5 +echo "configure:922: 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 @@ -927,7 +942,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:931: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:946: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -943,7 +958,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -980,7 +995,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1051,7 +1066,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:1055: checking host system type" >&5 +echo "configure:1070: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1072,7 +1087,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:1076: checking target system type" >&5 +echo "configure:1091: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1090,7 +1105,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1094: checking build system type" >&5 +echo "configure:1109: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1115,7 +1130,7 @@ test "$host_alias" != "$target_alias" && ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1119: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1134: 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 @@ -1144,7 +1159,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1148: checking for $ac_word" >&5 +echo "configure:1163: 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 @@ -1172,12 +1187,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1176: checking for ANSI C header files" >&5 +echo "configure:1191: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1185,7 +1200,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1204: \"$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* @@ -1202,7 +1217,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 @@ -1220,7 +1235,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 @@ -1241,7 +1256,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1252,7 +1267,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1276,12 +1291,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1280: checking for working const" >&5 +echo "configure:1295: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1351,21 +1366,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1355: checking for inline" >&5 +echo "configure:1370: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1391,12 +1406,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1395: checking for off_t" >&5 +echo "configure:1410: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1424,12 +1439,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1428: checking for size_t" >&5 +echo "configure:1443: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1459,19 +1474,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:1463: checking for working alloca.h" >&5 +echo "configure:1478: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1490: \"$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 @@ -1492,12 +1507,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1496: checking for alloca" >&5 +echo "configure:1511: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1544: \"$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 @@ -1557,12 +1572,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1561: checking whether alloca needs Cray hooks" >&5 +echo "configure:1576: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1591: checking for $ac_func" >&5 +echo "configure:1606: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1634: \"$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 @@ -1642,7 +1657,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1646: checking stack direction for C alloca" >&5 +echo "configure:1661: 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 @@ -1650,7 +1665,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1688: \"$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 @@ -1694,17 +1709,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:1698: checking for $ac_hdr" >&5 +echo "configure:1713: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1723: \"$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* @@ -1733,12 +1748,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1737: checking for $ac_func" >&5 +echo "configure:1752: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1780: \"$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 @@ -1786,7 +1801,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1790: checking for working mmap" >&5 +echo "configure:1805: 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 @@ -1794,7 +1809,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1953: \"$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 @@ -1962,17 +1977,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:1966: checking for $ac_hdr" >&5 +echo "configure:1981: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1991: \"$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* @@ -2002,12 +2017,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2006: checking for $ac_func" >&5 +echo "configure:2021: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2049: \"$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 @@ -2059,12 +2074,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2063: checking for $ac_func" >&5 +echo "configure:2078: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2106: \"$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 @@ -2121,19 +2136,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2125: checking for LC_MESSAGES" >&5 +echo "configure:2140: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2152: \"$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 @@ -2154,7 +2169,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2158: checking whether NLS is requested" >&5 +echo "configure:2173: 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" @@ -2174,7 +2189,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2178: checking whether included gettext is requested" >&5 +echo "configure:2193: 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" @@ -2193,17 +2208,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2197: checking for libintl.h" >&5 +echo "configure:2212: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2222: \"$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* @@ -2220,19 +2235,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:2224: checking for gettext in libc" >&5 +echo "configure:2239: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2251: \"$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 @@ -2248,7 +2263,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:2252: checking for bindtextdomain in -lintl" >&5 +echo "configure:2267: 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 @@ -2256,7 +2271,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2286: \"$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 @@ -2283,19 +2298,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:2287: checking for gettext in libintl" >&5 +echo "configure:2302: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2314: \"$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 @@ -2323,7 +2338,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:2327: checking for $ac_word" >&5 +echo "configure:2342: 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 @@ -2357,12 +2372,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2361: checking for $ac_func" >&5 +echo "configure:2376: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2404: \"$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 @@ -2412,7 +2427,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:2416: checking for $ac_word" >&5 +echo "configure:2431: 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 @@ -2448,7 +2463,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:2452: checking for $ac_word" >&5 +echo "configure:2467: 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 @@ -2480,7 +2495,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2520,7 +2535,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:2524: checking for $ac_word" >&5 +echo "configure:2539: 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 @@ -2554,7 +2569,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:2558: checking for $ac_word" >&5 +echo "configure:2573: 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 @@ -2590,7 +2605,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:2594: checking for $ac_word" >&5 +echo "configure:2609: 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 @@ -2680,7 +2695,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2684: checking for catalogs to be installed" >&5 +echo "configure:2699: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2708,17 +2723,17 @@ echo "configure:2684: 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:2712: checking for linux/version.h" >&5 +echo "configure:2727: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2737: \"$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* @@ -2820,7 +2835,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2824: checking for $ac_word" >&5 +echo "configure:2839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2861,7 +2876,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2865: checking for a BSD compatible install" >&5 +echo "configure:2880: 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 @@ -2922,7 +2937,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:2926: checking for $ac_word" >&5 +echo "configure:2941: 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 @@ -2954,7 +2969,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:2958: checking for $ac_word" >&5 +echo "configure:2973: 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 @@ -2986,7 +3001,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:2990: checking for $ac_word" >&5 +echo "configure:3005: 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 @@ -3018,12 +3033,76 @@ else fi fi +# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3040: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool" +fi +fi +DLLTOOL="$ac_cv_prog_DLLTOOL" +if test -n "$DLLTOOL"; then + echo "$ac_t""$DLLTOOL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3072: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_WINDRES" && ac_cv_prog_WINDRES="windres" +fi +fi +WINDRES="$ac_cv_prog_WINDRES" +if test -n "$WINDRES"; then + echo "$ac_t""$WINDRES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3027: checking for $ac_word" >&5 +echo "configure:3106: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3057,7 +3136,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3061: checking for $ac_word" >&5 +echo "configure:3140: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3108,12 +3187,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3112: checking return type of signal handlers" >&5 +echo "configure:3191: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3130,7 +3209,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3150,12 +3229,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3154: checking for ANSI C header files" >&5 +echo "configure:3233: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3163,7 +3242,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3246: \"$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* @@ -3180,7 +3259,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 @@ -3198,7 +3277,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 @@ -3219,7 +3298,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3230,7 +3309,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3262,26 +3341,28 @@ EOF esac; esac -for ac_hdr in ctype.h curses.h endian.h link.h thread_db.h proc_service.h \ +for ac_hdr in ctype.h endian.h link.h thread_db.h proc_service.h \ memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \ string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \ term.h termio.h termios.h unistd.h wait.h sys/wait.h \ wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \ - time.h sys/ioctl.h + time.h sys/ioctl.h sys/user.h \ + dirent.h sys/ndir.h sys/dir.h ndir.h \ + curses.h ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3275: checking for $ac_hdr" >&5 +echo "configure:3356: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3308,12 +3389,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3312: checking whether stat file-mode macros are broken" >&5 +echo "configure:3393: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3365,12 +3446,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3369: checking for working const" >&5 +echo "configure:3450: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3443,12 +3524,12 @@ fi for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3447: checking for $ac_func" >&5 +echo "configure:3528: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3556: \"$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 @@ -3498,19 +3579,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3502: checking for working alloca.h" >&5 +echo "configure:3583: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3595: \"$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 @@ -3531,12 +3612,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3535: checking for alloca" >&5 +echo "configure:3616: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3649: \"$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 @@ -3596,12 +3677,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3600: checking whether alloca needs Cray hooks" >&5 +echo "configure:3681: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3630: checking for $ac_func" >&5 +echo "configure:3711: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3739: \"$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 @@ -3681,7 +3762,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3685: checking stack direction for C alloca" >&5 +echo "configure:3766: 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 @@ -3689,7 +3770,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3793: \"$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 @@ -3730,20 +3811,87 @@ EOF fi +# See if machine/reg.h supports the %fs and %gs i386 segment registers. +# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. +echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 +echo "configure:3818: checking for r_fs in struct reg" >&5 +if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +struct reg r; r.r_fs; +; return 0; } +EOF +if { (eval echo configure:3830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_struct_reg_r_fs=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_struct_reg_r_fs=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_struct_reg_r_fs" 1>&6 +if test $gdb_cv_struct_reg_r_fs = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_REG_R_FS 1 +EOF + +fi +echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 +echo "configure:3850: checking for r_gs in struct reg" >&5 +if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +struct reg r; r.r_gs; +; return 0; } +EOF +if { (eval echo configure:3862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_struct_reg_r_gs=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_struct_reg_r_gs=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_struct_reg_r_gs" 1>&6 +if test $gdb_cv_struct_reg_r_gs = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_REG_R_GS 1 +EOF + +fi + echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:3735: checking for PTRACE_GETREGS" >&5 +echo "configure:3883: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:3747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -3764,19 +3912,19 @@ EOF fi echo $ac_n "checking for PTRACE_GETXFPREGS""... $ac_c" 1>&6 -echo "configure:3768: checking for PTRACE_GETXFPREGS" >&5 +echo "configure:3916: checking for PTRACE_GETXFPREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getxfpregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETXFPREGS; ; return 0; } EOF -if { (eval echo configure:3780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getxfpregs=yes else @@ -3797,7 +3945,7 @@ EOF fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:3801: checking for socketpair in -lsocket" >&5 +echo "configure:3949: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3805,7 +3953,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3968: \"$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 @@ -3846,12 +3994,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3850: checking for $ac_func" >&5 +echo "configure:3998: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4026: \"$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 @@ -3901,12 +4049,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:3905: checking whether malloc must be declared" >&5 +echo "configure:4053: 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 < @@ -3927,7 +4075,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:3931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -3948,12 +4096,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:3952: checking whether realloc must be declared" >&5 +echo "configure:4100: 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 < @@ -3974,7 +4122,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:3978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -3995,12 +4143,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:3999: checking whether free must be declared" >&5 +echo "configure:4147: 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 < @@ -4021,7 +4169,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4042,12 +4190,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4046: checking whether strerror must be declared" >&5 +echo "configure:4194: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4068,7 +4216,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4089,12 +4237,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4093: checking whether strdup must be declared" >&5 +echo "configure:4241: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4115,7 +4263,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4136,12 +4284,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4140: checking whether strstr must be declared" >&5 +echo "configure:4288: 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 < @@ -4162,7 +4310,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4189,9 +4337,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4193: checking for HPUX save_state structure" >&5 +echo "configure:4341: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4206,7 +4354,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4270,19 +4418,19 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4274: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4422: 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 < int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4304,19 +4452,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4308: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4456: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:4320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -4338,19 +4486,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4342: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:4490: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:4354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -4372,19 +4520,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4376: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:4524: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:4388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -4406,19 +4554,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4410: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:4558: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prgregset_t avar ; return 0; } EOF -if { (eval echo configure:4422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -4440,19 +4588,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4444: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:4592: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prfpregset_t avar ; return 0; } EOF -if { (eval echo configure:4456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -4474,19 +4622,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4478: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:4626: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpid_t avar ; return 0; } EOF -if { (eval echo configure:4490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -4508,19 +4656,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4512: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:4660: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { psaddr_t avar ; return 0; } EOF -if { (eval echo configure:4524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -4543,13 +4691,58 @@ EOF + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 +echo "configure:4698: checking whether prfpregset_t type is broken" >&5 + if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + gdb_cv_prfpregset_t_broken=yes +else + cat > conftest.$ac_ext < + int main () + { + if (sizeof (prfpregset_t) == sizeof (void *)) + return 1; + return 0; + } +EOF +if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + gdb_cv_prfpregset_t_broken=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + gdb_cv_prfpregset_t_broken=yes +fi +rm -fr conftest* +fi + +fi + + echo "$ac_t""$gdb_cv_prfpregset_t_broken" 1>&6 + if test $gdb_cv_prfpregset_t_broken = yes; then + cat >> confdefs.h <<\EOF +#define PRFPREGSET_T_BROKEN 1 +EOF + + fi + fi + + echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4548: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:4741: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4562,7 +4755,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -4584,7 +4777,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:4588: checking for main in -lm" >&5 +echo "configure:4781: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4592,14 +4785,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4796: \"$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 @@ -4628,7 +4821,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:4632: checking for wctype in -lc" >&5 +echo "configure:4825: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4636,7 +4829,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4844: \"$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 @@ -4666,7 +4859,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:4670: checking for wctype in -lw" >&5 +echo "configure:4863: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4674,7 +4867,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4882: \"$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 @@ -4717,12 +4910,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:4721: checking for long long support in compiler" >&5 +echo "configure:4914: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -4754,7 +4947,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:4758: checking for long long support in printf" >&5 +echo "configure:4951: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4762,7 +4955,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -4800,19 +4993,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:4804: checking for long double support in compiler" >&5 +echo "configure:4997: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -4834,7 +5027,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:4838: checking for long double support in printf" >&5 +echo "configure:5031: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4842,7 +5035,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -4876,7 +5069,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:4880: checking for long double support in scanf" >&5 +echo "configure:5073: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4884,7 +5077,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -4920,17 +5113,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:4924: checking for $ac_hdr" >&5 +echo "configure:5117: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5127: \"$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* @@ -4959,12 +5152,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4963: checking for $ac_func" >&5 +echo "configure:5156: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5184: \"$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 @@ -5012,7 +5205,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5016: checking for working mmap" >&5 +echo "configure:5209: 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 @@ -5020,7 +5213,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5357: \"$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 @@ -5189,7 +5382,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:5193: checking for HPUX/OSF thread support" >&5 +echo "configure:5386: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -5208,7 +5401,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:5212: checking for Solaris thread debugging library" >&5 +echo "configure:5405: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -5218,7 +5411,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5222: checking for dlopen in -ldl" >&5 +echo "configure:5415: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5226,7 +5419,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5434: \"$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 @@ -5269,17 +5462,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:5273: checking for the ld -export-dynamic flag" >&5 +echo "configure:5466: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -5298,13 +5491,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:5302: checking if is old" >&5 +echo "configure:5495: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5315,7 +5508,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -5390,21 +5583,20 @@ fi case ${enable_tui} in "yes" ) - cat >> confdefs.h <<\EOF -#define TUI 1 -EOF - - BUILD_TUI=all-tui - TUI_LIBRARY=tui/libtui.a - ;; - * ) - BUILD_TUI= - TUI_LIBRARY= - ;; + if test -d "${srcdir}/tui" ; then + CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_TUI_SRCS)" + CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)" + ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)" + CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)" + CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)" + fi + ;; esac - - # Check whether --enable-netrom or --disable-netrom was given. if test "${enable_netrom+set}" = set; then enableval="$enable_netrom" @@ -5422,10 +5614,16 @@ if test "${enable_netrom}" = "yes"; then fi +# Don't add -Wall or -Wunused, they include -Wunused-parameter which +# causes noise. build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith" -# Not yet: -Wall -Wpointer-arith -Wstrict-prototypes -# -Wmissing-prototypes -Wmissing-declarations +-Wformat -Wparentheses -Wpointer-arith -Wuninitialized" +# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs +# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value +# -Wchar-subscripts -Wuninitialized -Wtraditional -Wshadow -Wcast-qual +# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes +# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls +# -Woverloaded-virtual -Winline -Werror" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" @@ -5439,21 +5637,29 @@ if test "${enable_build_warnings+set}" = set; then *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting warning flags = $build_warnings" 6>&1 + echo "Setting compiler warning flags = $build_warnings" 6>&1 fi fi WARN_CFLAGS="" WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) WARN_CFLAGS="${WARN_CFLAGS} $w" - esac - done + echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 +echo "configure:5649: checking compiler warning flags" >&5 + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) # Check that GCC accepts it + if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then + : + else + WARN_CFLAGS="${WARN_CFLAGS} $w" + fi + esac + done + echo "$ac_t""${WARN_CFLAGS}${WERROR_CFLAGS}" 1>&6 fi @@ -5500,16 +5706,14 @@ else want_included_regex=true fi -REGEX="gnu-regex.o" -REGEX_CFLAGS="-DUSE_INCLUDED_REGEX" if test $want_included_regex = false; then echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:5508: checking for GNU regex" >&5 +echo "configure:5712: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5521,7 +5725,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -5534,22 +5738,28 @@ rm -f conftest* fi echo "$ac_t""$gdb_cv_have_gnu_regex" 1>&6 - if test $gdb_cv_have_gnu_regex = yes; then - REGEX= - REGEX_CFLAGS= + if test $gdb_cv_have_gnu_regex = no; then + want_included_regex=true fi fi +if test x${want_included_regex} = xtrue; then + REGEX="gnu-regex.o" + cat >> confdefs.h <<\EOF +#define USE_INCLUDED_REGEX 1 +EOF + +fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:5548: checking for cygwin" >&5 +echo "configure:5758: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -DLLTOOL=${DLLTOOL-dlltool} -WINDRES=${WINDRES-windres} - - - if test x$gdb_host = xgo32; then TERM_LIB= else @@ -5583,7 +5788,7 @@ if test x$gdb_cv_os_cygwin = xyes; then else TERM_LIB= echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:5587: checking for tgetent in -lncurses" >&5 +echo "configure:5792: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5591,7 +5796,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5811: \"$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 @@ -5621,7 +5826,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:5625: checking for tgetent in -lHcurses" >&5 +echo "configure:5830: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5629,7 +5834,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5849: \"$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 @@ -5659,7 +5864,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:5663: checking for tgetent in -ltermlib" >&5 +echo "configure:5868: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5667,7 +5872,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5887: \"$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 @@ -5697,7 +5902,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:5701: checking for tgetent in -ltermcap" >&5 +echo "configure:5906: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5705,7 +5910,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5925: \"$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 @@ -5735,7 +5940,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:5739: checking for tgetent in -lcurses" >&5 +echo "configure:5944: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5743,7 +5948,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5963: \"$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 @@ -5773,7 +5978,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:5777: checking for tgetent in -lterminfo" >&5 +echo "configure:5982: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5781,7 +5986,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6001: \"$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 @@ -5950,7 +6155,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:5954: checking for Tcl configuration" >&5 +echo "configure:6159: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6058,7 +6263,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:6062: checking for Tk configuration" >&5 +echo "configure:6267: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6154,7 +6359,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:6158: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:6363: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -6220,17 +6425,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:6224: checking for tclInt.h" >&5 +echo "configure:6429: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6439: \"$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* @@ -6290,7 +6495,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:6294: checking for Tk private headers" >&5 +echo "configure:6499: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -6356,17 +6561,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:6360: checking for tk.h" >&5 +echo "configure:6565: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6575: \"$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* @@ -6412,7 +6617,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6416: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:6621: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -6435,7 +6640,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6439: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:6644: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -6458,7 +6663,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6462: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:6667: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -6496,7 +6701,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:6500: checking for Itcl configuration" >&5 +echo "configure:6705: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6608,7 +6813,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:6612: checking for Itk configuration" >&5 +echo "configure:6817: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6720,7 +6925,7 @@ if test "${with_tixconfig+set}" = set; then fi echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:6724: checking for Tix configuration" >&5 +echo "configure:6929: checking for Tix configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6859,7 +7064,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:6863: checking for X" >&5 +echo "configure:7068: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -6921,12 +7126,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7135: \"$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* @@ -6995,14 +7200,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -7284,7 +7489,7 @@ files="${files} config/nm-empty.h" links="${links} nm.h" fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:7288: checking whether ln -s works" >&5 +echo "configure:7493: 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 @@ -7308,12 +7513,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:7312: checking for Cygwin environment" >&5 +echo "configure:7517: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -7341,19 +7546,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:7345: checking for mingw32 environment" >&5 +echo "configure:7550: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -7372,7 +7577,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:7376: checking for executable suffix" >&5 +echo "configure:7581: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7382,10 +7587,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:7386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:7591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -7506,7 +7711,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile tui/Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/gdb/configure.host b/gdb/configure.host index 02b6909e3a2..db720b1345f 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -17,7 +17,6 @@ hppa*) gdb_host_cpu=pa ;; i[3456]86*) gdb_host_cpu=i386 ;; m68*) gdb_host_cpu=m68k ;; m88*) gdb_host_cpu=m88k ;; -# OBSOLETE np1) gdb_host_cpu=gould ;; # OBSOLETE pyramid) gdb_host_cpu=pyr ;; powerpc*) gdb_host_cpu=powerpc ;; sparc64) gdb_host_cpu=sparc ;; @@ -35,6 +34,7 @@ alpha*-*-osf1*) gdb_host=alpha-osf1 ;; alpha*-*-osf2*) gdb_host=alpha-osf2 ;; alpha*-*-osf[3456789]*) gdb_host=alpha-osf3 ;; alpha*-*-linux*) gdb_host=alpha-linux ;; +alpha*-*-freebsd*) gdb_host=fbsd ;; arm*-*-linux*) gdb_host=linux ;; arm*-*-*) gdb_host=arm ;; @@ -57,6 +57,8 @@ i[3456]86-*-aix*) gdb_host=i386aix ;; i[3456]86-*-bsd*) gdb_host=i386bsd ;; i[3456]86-*-dgux*) gdb_host=i386dgux ;; i[3456]86-*-freebsd*) gdb_host=fbsd ;; +i[3456]86-*-netbsdelf*) gdb_host=nbsdelf ;; +i[3456]86-*-netbsdaout*) gdb_host=nbsd ;; i[3456]86-*-netbsd*) gdb_host=nbsd ;; i[3456]86-*-go32*) gdb_host=go32 ;; i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;; @@ -127,8 +129,6 @@ mips-*-riscos*) gdb_host=riscos ;; none-*-*) gdb_host=none ;; -# OBSOLETE np1-*-*) gdb_host=np1 ;; - ns32k-*-mach3*) gdb_host=ns32km3 ;; ns32k-*-netbsd*) gdb_host=nbsd ;; ns32k-umax-*) gdb_host=umax ;; @@ -138,6 +138,7 @@ powerpc-*-aix*) gdb_host=aix ;; powerpcle-*-cygwin*) gdb_host=cygwin ;; powerpcle-*-solaris*) gdb_host=solaris ;; powerpc-*-linux*) gdb_host=linux ;; +powerpc-*-netbsd*) gdb_host=nbsd ;; # OBSOLETE pn-*-*) gdb_host=pn ;; diff --git a/gdb/configure.in b/gdb/configure.in index 4d475140cde..d7a725ea689 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -22,6 +22,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13)dnl AC_INIT(main.c) AC_CONFIG_HEADER(config.h:config.in) +AM_MAINTAINER_MODE AC_PROG_CC AC_AIX @@ -77,6 +78,8 @@ AC_PROG_AWK AC_PROG_INSTALL AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(DLLTOOL, dlltool) +AC_CHECK_TOOL(WINDRES, windres) AC_PROG_YACC dnl MiG is needed for the Hurd. @@ -96,12 +99,14 @@ case $host_os in solaris2.7) case "$GCC" in yes) AC_DEFINE(_MSE_INT_H) esac; esac -AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h thread_db.h proc_service.h \ +AC_CHECK_HEADERS(ctype.h endian.h link.h thread_db.h proc_service.h \ memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \ string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \ term.h termio.h termios.h unistd.h wait.h sys/wait.h \ wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \ - time.h sys/ioctl.h) + time.h sys/ioctl.h sys/user.h \ + dirent.h sys/ndir.h sys/dir.h ndir.h \ + curses.h ncurses.h) AC_HEADER_STAT AC_C_CONST @@ -109,6 +114,21 @@ AC_C_CONST AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask) AC_FUNC_ALLOCA +# See if machine/reg.h supports the %fs and %gs i386 segment registers. +# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. +AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs, +[AC_TRY_COMPILE([#include ], [struct reg r; r.r_fs;], +gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)]) +if test $gdb_cv_struct_reg_r_fs = yes; then + AC_DEFINE(HAVE_STRUCT_REG_R_FS) +fi +AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs, +[AC_TRY_COMPILE([#include ], [struct reg r; r.r_gs;], +gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)]) +if test $gdb_cv_struct_reg_r_gs = yes; then + AC_DEFINE(HAVE_STRUCT_REG_R_GS) +fi + dnl See if ptrace.h provides the PTRACE_GETREGS request. AC_MSG_CHECKING(for PTRACE_GETREGS) AC_CACHE_VAL(gdb_cv_have_ptrace_getregs, @@ -200,6 +220,32 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) + dnl Check for broken prfpregset_t type + + dnl For Linux/i386, glibc 2.1.3 was released with a bogus + dnl prfpregset_t type (it's a typedef for the pointer to a struct + dnl instead of the struct itself). We detect this here, and work + dnl around it in lin-thread.c. + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + AC_MSG_CHECKING(whether prfpregset_t type is broken) + AC_CACHE_VAL(gdb_cv_prfpregset_t_broken, + [AC_TRY_RUN([#include + int main () + { + if (sizeof (prfpregset_t) == sizeof (void *)) + return 1; + return 0; + }], + gdb_cv_prfpregset_t_broken=no, + gdb_cv_prfpregset_t_broken=yes, + gdb_cv_prfpregset_t_broken=yes)]) + AC_MSG_RESULT($gdb_cv_prfpregset_t_broken) + if test $gdb_cv_prfpregset_t_broken = yes; then + AC_DEFINE(PRFPREGSET_T_BROKEN) + fi + fi + dnl Check for PIOCSET ioctl entry AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h) @@ -429,17 +475,19 @@ AC_ARG_ENABLE(tui, ]) case ${enable_tui} in "yes" ) - AC_DEFINE(TUI) - BUILD_TUI=all-tui - TUI_LIBRARY=tui/libtui.a - ;; - * ) - BUILD_TUI= - TUI_LIBRARY= - ;; + if test -d "${srcdir}/tui" ; then + CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_TUI_SRCS)" + CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)" + ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)" + CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)" + CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)" + fi + ;; esac -AC_SUBST(BUILD_TUI) -AC_SUBST(TUI_LIBRARY) AC_ARG_ENABLE(netrom, [ --enable-netrom Enable NetROM support], @@ -455,10 +503,16 @@ if test "${enable_netrom}" = "yes"; then fi +# Don't add -Wall or -Wunused, they include -Wunused-parameter which +# causes noise. build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith" -# Not yet: -Wall -Wpointer-arith -Wstrict-prototypes -# -Wmissing-prototypes -Wmissing-declarations +-Wformat -Wparentheses -Wpointer-arith -Wuninitialized" +# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs +# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value +# -Wchar-subscripts -Wuninitialized -Wtraditional -Wshadow -Wcast-qual +# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes +# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls +# -Woverloaded-virtual -Winline -Werror" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -471,20 +525,27 @@ AC_ARG_ENABLE(build-warnings, *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting warning flags = $build_warnings" 6>&1 + echo "Setting compiler warning flags = $build_warnings" 6>&1 fi])dnl WARN_CFLAGS="" WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) WARN_CFLAGS="${WARN_CFLAGS} $w" - esac - done + AC_MSG_CHECKING(compiler warning flags) + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) # Check that GCC accepts it + if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then + : + else + WARN_CFLAGS="${WARN_CFLAGS} $w" + fi + esac + done + AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS}) fi AC_SUBST(WARN_CFLAGS) AC_SUBST(WERROR_CFLAGS) @@ -517,8 +578,6 @@ AC_ARG_WITH(included-regex, *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;; esac],[want_included_regex=true])dnl -REGEX="gnu-regex.o" -REGEX_CFLAGS="-DUSE_INCLUDED_REGEX" if test $want_included_regex = false; then AC_MSG_CHECKING(for GNU regex) AC_CACHE_VAL(gdb_cv_have_gnu_regex, @@ -532,13 +591,16 @@ if test $want_included_regex = false; then [gdb_cv_have_gnu_regex=yes], [gdb_cv_have_gnu_regex=no])]) AC_MSG_RESULT($gdb_cv_have_gnu_regex) - if test $gdb_cv_have_gnu_regex = yes; then - REGEX= - REGEX_CFLAGS= + if test $gdb_cv_have_gnu_regex = no; then + want_included_regex=true fi fi + +if test x${want_included_regex} = xtrue; then + REGEX="gnu-regex.o" + AC_DEFINE(USE_INCLUDED_REGEX) +fi AC_SUBST(REGEX) -AC_SUBST(REGEX_CFLAGS) # In the Cygwin environment, we need some additional flags. AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, @@ -547,11 +609,6 @@ AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, lose #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])]) -DLLTOOL=${DLLTOOL-dlltool} -WINDRES=${WINDRES-windres} -AC_SUBST(DLLTOOL) -AC_SUBST(WINDRES) - dnl Figure out which term library to use. if test x$gdb_host = xgo32; then TERM_LIB= @@ -973,7 +1030,7 @@ dnl Check for exe extension set on certain hosts (e.g. Win32) AC_EXEEXT AC_CONFIG_SUBDIRS($configdirs) -AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in, +AC_OUTPUT(Makefile .gdbinit:gdbinit.in, [ dnl Autoconf doesn't provide a mechanism for modifying definitions dnl provided by makefile fragments. diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 8ad51e13648..99deff296fc 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -20,9 +20,7 @@ i[3456]86*) gdb_target_cpu=i386 ;; m68*) gdb_target_cpu=m68k ;; m88*) gdb_target_cpu=m88k ;; mips*) gdb_target_cpu=mips ;; -# OBSOLETE np1) gdb_target_cpu=gould ;; powerpc*) gdb_target_cpu=powerpc ;; -# OBSOLETE pn) gdb_target_cpu=gould ;; # OBSOLETE pyramid) gdb_target_cpu=pyr ;; sparc*) gdb_target_cpu=sparc ;; thumb*) gdb_target_cpu=arm ;; @@ -48,11 +46,14 @@ a29k-*-vxworks*) gdb_target=vx29k ;; alpha*-*-osf*) gdb_target=alpha-osf1 ;; alpha*-*-linux*) gdb_target=alpha-linux ;; +alpha*-*-freebsd*) gdb_target=fbsd ;; arc-*-*) gdb_target=arc ;; arm*-wince-pe) gdb_target=wince ;; -arm*-*-linux*) gdb_target=linux ;; +arm*-*-linux*) gdb_target=linux + configdirs="$configdirs gdbserver" + ;; arm*-*-* | thumb*-*-* | strongarm*-*-*) gdb_target=embed configdirs="$configdirs rdi-share" @@ -87,6 +88,8 @@ i[3456]86-*-elf*) gdb_target=embed ;; i[3456]86-*-aix*) gdb_target=i386aix ;; i[3456]86-*-bsd*) gdb_target=i386bsd ;; i[3456]86-*-freebsd*) gdb_target=fbsd ;; +i[3456]86-*-netbsdelf*) gdb_target=nbsdelf + configdirs="${configdirs} gdbserver" ;; i[3456]86-*-netbsd*) gdb_target=nbsd configdirs="${configdirs} gdbserver" ;; i[3456]86-*-os9k) gdb_target=i386os9k ;; @@ -211,16 +214,14 @@ mn10300-*-*) gdb_target=mn10300 ;; none-*-*) gdb_target=none ;; -# OBSOLETE np1-*-*) gdb_target=np1 ;; - ns32k-*-mach3*) gdb_target=ns32km3 ;; ns32k-*-netbsd*) gdb_target=nbsd ;; ns32k-utek-sysv*) gdb_target=merlin ;; ns32k-utek-*) gdb_target=umax ;; -# OBSOLETE pn-*-*) gdb_target=pn ;; - powerpc-*-macos*) gdb_target=macos ;; +powerpc-*-netbsd*) gdb_target=nbsd + configdirs="${configdirs} gdbserver" ;; powerpc-*-netware*) gdb_target=ppc-nw configdirs="${configdirs} nlm" ;; diff --git a/gdb/copying.c b/gdb/copying.c index a36db1fe0f4..76414bdf122 100644 --- a/gdb/copying.c +++ b/gdb/copying.c @@ -5,11 +5,11 @@ #include "command.h" #include "gdbcmd.h" -static void show_copying_command PARAMS ((char *, int)); +static void show_copying_command (char *, int); -static void show_warranty_command PARAMS ((char *, int)); +static void show_warranty_command (char *, int); -void _initialize_copying PARAMS ((void)); +void _initialize_copying (void); extern int immediate_quit; static void diff --git a/gdb/core-aout.c b/gdb/core-aout.c index 9af47ab0900..ad64720eb17 100644 --- a/gdb/core-aout.c +++ b/gdb/core-aout.c @@ -41,7 +41,7 @@ /* These are needed on various systems to expand REGISTER_U_ADDR. */ #ifndef USG -#include +#include "gdb_dirent.h" #include #include "gdb_stat.h" #include @@ -55,9 +55,9 @@ #include #endif -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); -void _initialize_core_aout PARAMS ((void)); +void _initialize_core_aout (void); /* Extract the register values out of the core file and store them where `read_register' will find them. diff --git a/gdb/core-regset.c b/gdb/core-regset.c index 8f96c0f1842..2070da6e86e 100644 --- a/gdb/core-regset.c +++ b/gdb/core-regset.c @@ -48,9 +48,12 @@ #include "command.h" #include "gdbcore.h" -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" -void _initialize_core_regset PARAMS ((void)); +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); + +void _initialize_core_regset (void); /* @@ -109,9 +112,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) else { memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset)); -#if defined (FP0_REGNUM) - supply_fpregset (&fpregset); -#endif + if (FP0_REGNUM >= 0) + supply_fpregset (&fpregset); } } #endif /* defined(HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T) */ diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c index 3ce9cd460d0..46b5eb6086c 100644 --- a/gdb/core-sol2.c +++ b/gdb/core-sol2.c @@ -40,7 +40,10 @@ #include "command.h" #include "gdbcore.h" -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); static void fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) diff --git a/gdb/corefile.c b/gdb/corefile.c index 4d11cbdcdf7..c8772de4c0a 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -40,8 +40,8 @@ /* Local function declarations. */ -extern void _initialize_core PARAMS ((void)); -static void call_extra_exec_file_hooks PARAMS ((char *filename)); +extern void _initialize_core (void); +static void call_extra_exec_file_hooks (char *filename); /* You can have any number of hooks for `exec_file_command' command to call. If there's only one hook, it is set in exec_file_display hook. @@ -51,7 +51,7 @@ static void call_extra_exec_file_hooks PARAMS ((char *filename)); old code that assumed that only one hook could be set, and which called exec_file_display_hook directly. */ -typedef void (*hook_type) PARAMS ((char *)); +typedef void (*hook_type) (char *); hook_type exec_file_display_hook; /* the original hook */ static hook_type *exec_file_extra_hooks; /* array of additional hooks */ @@ -124,7 +124,7 @@ call_extra_exec_file_hooks (filename) void specify_exec_file_hook (hook) - void (*hook) PARAMS ((char *)); + void (*hook) (char *); { hook_type *new_array; @@ -270,21 +270,7 @@ read_memory (memaddr, myaddr, len) memory_error (status, memaddr); } -void -read_memory_section (memaddr, myaddr, len, bfd_section) - CORE_ADDR memaddr; - char *myaddr; - int len; - asection *bfd_section; -{ - int status; - status = target_read_memory_section (memaddr, myaddr, len, bfd_section); - if (status != 0) - memory_error (status, memaddr); -} - /* Like target_read_memory, but slightly different parameters. */ - int dis_asm_read_memory (memaddr, myaddr, len, info) bfd_vma memaddr; @@ -430,8 +416,7 @@ char *gnutarget; /* Same thing, except it is "auto" not NULL for the default case. */ static char *gnutarget_string; -static void set_gnutarget_command - PARAMS ((char *, int, struct cmd_list_element *)); +static void set_gnutarget_command (char *, int, struct cmd_list_element *); static void set_gnutarget_command (ignore, from_tty, c) diff --git a/gdb/corelow.c b/gdb/corelow.c index d5998f4c42d..43163d927bd 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -1,5 +1,5 @@ /* Core dump and executable file functions below target vector, for GDB. - Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -44,35 +44,37 @@ static struct core_fns *core_file_fns = NULL; static struct core_fns *core_vec = NULL; -static void core_files_info PARAMS ((struct target_ops *)); +static void core_files_info (struct target_ops *); #ifdef SOLIB_ADD -static int solib_add_stub PARAMS ((PTR)); +static int solib_add_stub (PTR); #endif -static struct core_fns *sniff_core_bfd PARAMS ((bfd *)); +static struct core_fns *sniff_core_bfd (bfd *); -static boolean gdb_check_format PARAMS ((bfd *)); +static boolean gdb_check_format (bfd *); -static void core_open PARAMS ((char *, int)); +static void core_open (char *, int); -static void core_detach PARAMS ((char *, int)); +static void core_detach (char *, int); -static void core_close PARAMS ((int)); +static void core_close (int); -static void get_core_registers PARAMS ((int)); +static void core_close_cleanup (void *ignore); -static void add_to_thread_list PARAMS ((bfd *, asection *, PTR)); +static void get_core_registers (int); -static int ignore PARAMS ((CORE_ADDR, char *)); +static void add_to_thread_list (bfd *, asection *, PTR); -static char *core_file_to_sym_file PARAMS ((char *)); +static int ignore (CORE_ADDR, char *); -static int core_file_thread_alive PARAMS ((int tid)); +static char *core_file_to_sym_file (char *); -static void init_core_ops PARAMS ((void)); +static int core_file_thread_alive (int tid); -void _initialize_corelow PARAMS ((void)); +static void init_core_ops (void); + +void _initialize_corelow (void); struct target_ops core_ops; @@ -207,6 +209,12 @@ core_close (quitting) core_vec = NULL; } +static void +core_close_cleanup (void *ignore) +{ + core_close (0/*ignored*/); +} + #ifdef SOLIB_ADD /* Stub function for catch_errors around shared library hacking. FROM_TTYP is really an int * which points to from_tty. */ @@ -295,7 +303,7 @@ core_open (filename, from_tty) /* FIXME: should be checking for errors from bfd_close (for one thing, on error it does not free all the storage associated with the bfd). */ - make_cleanup ((make_cleanup_func) bfd_close, temp_bfd); + make_cleanup_bfd_close (temp_bfd); error ("\"%s\" is not a core dump: %s", filename, bfd_errmsg (bfd_get_error ())); } @@ -305,7 +313,7 @@ core_open (filename, from_tty) discard_cleanups (old_chain); /* Don't free filename any more */ unpush_target (&core_ops); core_bfd = temp_bfd; - old_chain = make_cleanup ((make_cleanup_func) core_close, core_bfd); + old_chain = make_cleanup (core_close_cleanup, 0 /*ignore*/); /* Find a suitable core file handler to munch on core_bfd */ core_vec = sniff_core_bfd (core_bfd); @@ -318,6 +326,8 @@ core_open (filename, from_tty) error ("\"%s\": Can't find sections: %s", bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ())); + set_gdbarch_from_file (core_bfd); + ontop = !push_target (&core_ops); discard_cleanups (old_chain); @@ -327,8 +337,12 @@ core_open (filename, from_tty) siggy = bfd_core_file_failing_signal (core_bfd); if (siggy > 0) + /* NOTE: target_signal_from_host() converts a target signal value + into gdb's internal signal value. Unfortunatly gdb's internal + value is called ``target_signal'' and this function got the + name ..._from_host(). */ printf_filtered ("Program terminated with signal %d, %s.\n", siggy, - safe_strsignal (siggy)); + target_signal_to_string (target_signal_from_host (siggy))); /* Build up thread list from BFD sections. */ @@ -491,7 +505,7 @@ core_file_to_sym_file (core) /* FIXME: should be checking for errors from bfd_close (for one thing, on error it does not free all the storage associated with the bfd). */ - make_cleanup ((make_cleanup_func) bfd_close, temp_bfd); + make_cleanup_bfd_close (temp_bfd); error ("\"%s\" is not a core dump: %s", core, bfd_errmsg (bfd_get_error ())); } diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index b70ef219d6c..58bbc7ca390 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -45,7 +45,7 @@ int static_field_print; /* Controls printing of static fields. */ static struct obstack dont_print_vb_obstack; static struct obstack dont_print_statmem_obstack; -extern void _initialize_cp_valprint PARAMS ((void)); +extern void _initialize_cp_valprint (void); static void cp_print_static_field (struct type *, value_ptr, struct ui_file *, int, int, @@ -429,7 +429,7 @@ cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format /* pai: FIXME 32x64 problem? */ /* Not sure what the best notation is in the case where there is no baseclass name. */ - v = value_from_longest (lookup_pointer_type (builtin_type_unsigned_long), + v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long), *(unsigned long *) (valaddr + offset)); val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c index f0a43962054..8bd0ea20040 100644 --- a/gdb/cpu32bug-rom.c +++ b/gdb/cpu32bug-rom.c @@ -26,7 +26,7 @@ #include "monitor.h" #include "serial.h" -static void cpu32bug_open PARAMS ((char *args, int from_tty)); +static void cpu32bug_open (char *args, int from_tty); static void cpu32bug_supply_register (regname, regnamelen, val, vallen) diff --git a/gdb/cxux-nat.c b/gdb/cxux-nat.c index 9db528a06b9..93ed232770c 100644 --- a/gdb/cxux-nat.c +++ b/gdb/cxux-nat.c @@ -281,6 +281,9 @@ m88k_register_u_addr (blockend, regnum) #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* Given a pointer to a general register set in /proc format (gregset_t *), unpack the register contents and supply them as gdb's idea of the current register values. */ @@ -386,7 +389,8 @@ add_shared_symbol_files () { struct section_addr_info section_addrs; memset (§ion_addrs, 0, sizeof (section_addrs)); - section_addrs.text_addr = lms.l_addr; + section_addrs.other[0].addr = lms.l_addr; + section_addrs.other[0].name = ".text"; symbol_file_add (path_name, 1, §ion_addrs, 0, 0); free (path_name); } diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index cfd70b0878e..3aab494e846 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -34,7 +34,9 @@ #include "symfile.h" #include "objfiles.h" #include "language.h" +#include "arch-utils.h" +#include "floatformat.h" #include "sim-d10v.h" #undef XMALLOC @@ -84,17 +86,18 @@ enum /* Local functions */ -extern void _initialize_d10v_tdep PARAMS ((void)); +extern void _initialize_d10v_tdep (void); -static void d10v_eva_prepare_to_trace PARAMS ((void)); +static void d10v_eva_prepare_to_trace (void); -static void d10v_eva_get_trace_data PARAMS ((void)); +static void d10v_eva_get_trace_data (void); -static int prologue_find_regs PARAMS ((unsigned short op, struct frame_info * fi, CORE_ADDR addr)); +static int prologue_find_regs (unsigned short op, struct frame_info *fi, + CORE_ADDR addr); -extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *)); +extern void d10v_frame_init_saved_regs (struct frame_info *); -static void do_d10v_pop_frame PARAMS ((struct frame_info * fi)); +static void do_d10v_pop_frame (struct frame_info *fi); int d10v_frame_chain_valid (chain, frame) @@ -104,7 +107,7 @@ d10v_frame_chain_valid (chain, frame) return ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START); } -CORE_ADDR +static CORE_ADDR d10v_stack_align (CORE_ADDR len) { return (len + 1) & ~1; @@ -1021,7 +1024,8 @@ struct stack_item void *data; }; -static struct stack_item *push_stack_item PARAMS ((struct stack_item * prev, void *contents, int len)); +static struct stack_item *push_stack_item (struct stack_item *prev, + void *contents, int len); static struct stack_item * push_stack_item (prev, contents, len) struct stack_item *prev; @@ -1037,7 +1041,7 @@ push_stack_item (prev, contents, len) return si; } -static struct stack_item *pop_stack_item PARAMS ((struct stack_item * si)); +static struct stack_item *pop_stack_item (struct stack_item *si); static struct stack_item * pop_stack_item (si) struct stack_item *si; @@ -1246,15 +1250,15 @@ remote_d10v_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes, #define TRACE_BUFFER_BASE (0xf40000) -static void trace_command PARAMS ((char *, int)); +static void trace_command (char *, int); -static void untrace_command PARAMS ((char *, int)); +static void untrace_command (char *, int); -static void trace_info PARAMS ((char *, int)); +static void trace_info (char *, int); -static void tdisassemble_command PARAMS ((char *, int)); +static void tdisassemble_command (char *, int); -static void display_trace PARAMS ((int, int)); +static void display_trace (int, int); /* True when instruction traces are being collected. */ @@ -1593,9 +1597,26 @@ d10v_gdbarch_init (info, arches) set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); + /* NOTE: The d10v as a 32 bit ``float'' and ``double''. ``long + double'' is 64 bits. */ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); + switch (info.byte_order) + { + case BIG_ENDIAN: + set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_big); + set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_big); + set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big); + break; + case LITTLE_ENDIAN: + set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_little); + set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_little); + set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_little); + break; + default: + internal_error ("d10v_gdbarch_init: bad byte order for float format"); + } set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); @@ -1655,13 +1676,14 @@ d10v_gdbarch_init (info, arches) set_gdbarch_frame_locals_address (gdbarch, d10v_frame_locals_address); set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); + set_gdbarch_stack_align (gdbarch, d10v_stack_align); return gdbarch; } -extern void (*target_resume_hook) PARAMS ((void)); -extern void (*target_wait_loop_hook) PARAMS ((void)); +extern void (*target_resume_hook) (void); +extern void (*target_wait_loop_hook) (void); void _initialize_d10v_tdep () diff --git a/gdb/d30v-tdep.c b/gdb/d30v-tdep.c index 94a1362b3fe..cea03508daf 100644 --- a/gdb/d30v-tdep.c +++ b/gdb/d30v-tdep.c @@ -36,13 +36,13 @@ #include "language.h" /* For local_hex_string() */ -void d30v_frame_find_saved_regs PARAMS ((struct frame_info * fi, - struct frame_saved_regs * fsr)); -void d30v_frame_find_saved_regs_offsets PARAMS ((struct frame_info * fi, - struct frame_saved_regs * fsr)); -static void d30v_pop_dummy_frame PARAMS ((struct frame_info * fi)); -static void d30v_print_flags PARAMS ((void)); -static void print_flags_command PARAMS ((char *, int)); +void d30v_frame_find_saved_regs (struct frame_info *fi, + struct frame_saved_regs *fsr); +void d30v_frame_find_saved_regs_offsets (struct frame_info *fi, + struct frame_saved_regs *fsr); +static void d30v_pop_dummy_frame (struct frame_info *fi); +static void d30v_print_flags (void); +static void print_flags_command (char *, int); /* the following defines assume: fp is r61, lr is r62, sp is r63, and ?? is r22 @@ -719,7 +719,7 @@ d30v_init_frame_pc (fromleaf, prev) prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); } -static void d30v_print_register PARAMS ((int regnum, int tabular)); +static void d30v_print_register (int regnum, int tabular); static void d30v_print_register (regnum, tabular) @@ -1091,15 +1091,15 @@ d30v_extract_return_value (valtype, regbuf, valbuf) #define TRACE_BUFFER_BASE (0xf40000) -static void trace_command PARAMS ((char *, int)); +static void trace_command (char *, int); -static void untrace_command PARAMS ((char *, int)); +static void untrace_command (char *, int); -static void trace_info PARAMS ((char *, int)); +static void trace_info (char *, int); -static void tdisassemble_command PARAMS ((char *, int)); +static void tdisassemble_command (char *, int); -static void display_trace PARAMS ((int, int)); +static void display_trace (int, int); /* True when instruction traces are being collected. */ @@ -1365,8 +1365,8 @@ display_trace (low, high) } } -extern void (*target_resume_hook) PARAMS ((void)); -extern void (*target_wait_loop_hook) PARAMS ((void)); +extern void (*target_resume_hook) (void); +extern void (*target_wait_loop_hook) (void); void _initialize_d30v_tdep () diff --git a/gdb/dbug-rom.c b/gdb/dbug-rom.c index 6b9787f4d4a..4d95012cf92 100644 --- a/gdb/dbug-rom.c +++ b/gdb/dbug-rom.c @@ -31,7 +31,7 @@ #include "monitor.h" #include "serial.h" -static void dbug_open PARAMS ((char *args, int from_tty)); +static void dbug_open (char *args, int from_tty); static void dbug_supply_register (regname, regnamelen, val, vallen) diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 74667e4c129..10e153544ea 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -265,77 +265,56 @@ static int bincls_allocated; /* Local function prototypes */ -extern void _initialize_dbxread PARAMS ((void)); +extern void _initialize_dbxread (void); -static void -process_now PARAMS ((struct objfile *)); +static void process_now (struct objfile *); -static void -free_header_files PARAMS ((void)); +static void free_header_files (void); -static void -init_header_files PARAMS ((void)); +static void init_header_files (void); -static void -read_ofile_symtab PARAMS ((struct partial_symtab *)); +static void read_ofile_symtab (struct partial_symtab *); -static void -dbx_psymtab_to_symtab PARAMS ((struct partial_symtab *)); +static void dbx_psymtab_to_symtab (struct partial_symtab *); -static void -dbx_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *)); +static void dbx_psymtab_to_symtab_1 (struct partial_symtab *); -static void -read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile)); +static void read_dbx_dynamic_symtab (struct objfile *objfile); -static void -read_dbx_symtab PARAMS ((struct objfile *)); +static void read_dbx_symtab (struct objfile *); -static void -free_bincl_list PARAMS ((struct objfile *)); +static void free_bincl_list (struct objfile *); -static struct partial_symtab * - find_corresponding_bincl_psymtab PARAMS ((char *, int)); +static struct partial_symtab *find_corresponding_bincl_psymtab (char *, int); -static void -add_bincl_to_list PARAMS ((struct partial_symtab *, char *, int)); +static void add_bincl_to_list (struct partial_symtab *, char *, int); -static void -init_bincl_list PARAMS ((int, struct objfile *)); +static void init_bincl_list (int, struct objfile *); -static char * - dbx_next_symbol_text PARAMS ((struct objfile *)); +static char *dbx_next_symbol_text (struct objfile *); -static void -fill_symbuf PARAMS ((bfd *)); +static void fill_symbuf (bfd *); -static void -dbx_symfile_init PARAMS ((struct objfile *)); +static void dbx_symfile_init (struct objfile *); -static void -dbx_new_init PARAMS ((struct objfile *)); +static void dbx_new_init (struct objfile *); -static void -dbx_symfile_read PARAMS ((struct objfile *, int)); +static void dbx_symfile_read (struct objfile *, int); -static void -dbx_symfile_finish PARAMS ((struct objfile *)); +static void dbx_symfile_finish (struct objfile *); -static void -record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *)); +static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *); -static void -add_new_header_file PARAMS ((char *, int)); +static void add_new_header_file (char *, int); -static void -add_old_header_file PARAMS ((char *, int)); +static void add_old_header_file (char *, int); -static void -add_this_object_header_file PARAMS ((int)); +static void add_this_object_header_file (int); -static struct partial_symtab * -start_psymtab PARAMS ((struct objfile *, char *, CORE_ADDR, int, - struct partial_symbol **, struct partial_symbol **)); +static struct partial_symtab *start_psymtab (struct objfile *, char *, + CORE_ADDR, int, + struct partial_symbol **, + struct partial_symbol **); /* Free up old header file tables */ @@ -488,17 +467,17 @@ record_minimal_symbol (name, address, type, objfile) { case N_TEXT | N_EXT: ms_type = mst_text; - section = SECT_OFF_TEXT; + section = SECT_OFF_TEXT (objfile); bfd_section = DBX_TEXT_SECTION (objfile); break; case N_DATA | N_EXT: ms_type = mst_data; - section = SECT_OFF_DATA; + section = SECT_OFF_DATA (objfile); bfd_section = DBX_DATA_SECTION (objfile); break; case N_BSS | N_EXT: ms_type = mst_bss; - section = SECT_OFF_BSS; + section = SECT_OFF_BSS (objfile); bfd_section = DBX_BSS_SECTION (objfile); break; case N_ABS | N_EXT: @@ -509,7 +488,7 @@ record_minimal_symbol (name, address, type, objfile) #ifdef N_SETV case N_SETV | N_EXT: ms_type = mst_data; - section = SECT_OFF_DATA; + section = SECT_OFF_DATA (objfile); bfd_section = DBX_DATA_SECTION (objfile); break; case N_SETV: @@ -517,7 +496,7 @@ record_minimal_symbol (name, address, type, objfile) of going over many .o files, it doesn't make sense to have one file local. */ ms_type = mst_file_data; - section = SECT_OFF_DATA; + section = SECT_OFF_DATA (objfile); bfd_section = DBX_DATA_SECTION (objfile); break; #endif @@ -526,7 +505,7 @@ record_minimal_symbol (name, address, type, objfile) case N_FN: case N_FN_SEQ: ms_type = mst_file_text; - section = SECT_OFF_TEXT; + section = SECT_OFF_TEXT (objfile); bfd_section = DBX_TEXT_SECTION (objfile); break; case N_DATA: @@ -547,12 +526,12 @@ record_minimal_symbol (name, address, type, objfile) if (VTBL_PREFIX_P ((tempstring))) ms_type = mst_data; } - section = SECT_OFF_DATA; + section = SECT_OFF_DATA (objfile); bfd_section = DBX_DATA_SECTION (objfile); break; case N_BSS: ms_type = mst_file_bss; - section = SECT_OFF_BSS; + section = SECT_OFF_BSS (objfile); bfd_section = DBX_BSS_SECTION (objfile); break; default: @@ -624,7 +603,7 @@ dbx_symfile_read (objfile, mainline) back_to = make_cleanup (really_free_pendings, 0); init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Read stabs data from executable file and define symbols. */ @@ -830,7 +809,7 @@ struct cont_elem int sym_idx; int sym_end; int symnum; - int (*func) PARAMS ((struct objfile *, struct symbol *, char *)); + int (*func) (struct objfile *, struct symbol *, char *); /* other state dependancies include: (assumption is that these will not change since process_now FIXME!!) stringtab_global @@ -849,7 +828,7 @@ void process_later (sym, p, f) struct symbol *sym; char *p; - int (*f) PARAMS ((struct objfile *, struct symbol *, char *)); + int (*f) (struct objfile *, struct symbol *, char *); { /* Allocate more space for the deferred list. */ @@ -888,7 +867,7 @@ process_now (objfile) struct symbol *sym; char *stabs; int err; - int (*func) PARAMS ((struct objfile *, struct symbol *, char *)); + int (*func) (struct objfile *, struct symbol *, char *); /* Save the state of our caller, we'll want to restore it before returning. */ @@ -1094,6 +1073,18 @@ free_bincl_list (objfile) bincls_allocated = 0; } +static void +do_free_bincl_list_cleanup (void *objfile) +{ + free_bincl_list (objfile); +} + +static struct cleanup * +make_cleanup_free_bincl_list (struct objfile *objfile) +{ + return make_cleanup (do_free_bincl_list_cleanup, objfile); +} + /* Scan a SunOs dynamic symbol table for symbols of interest and add them to the minimal symbol table. */ @@ -1157,17 +1148,17 @@ read_dbx_dynamic_symtab (objfile) if (bfd_get_section_flags (abfd, sec) & SEC_CODE) { - sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); type = N_TEXT; } else if (bfd_get_section_flags (abfd, sec) & SEC_DATA) { - sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); type = N_DATA; } else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC) { - sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); type = N_BSS; } else @@ -1208,7 +1199,7 @@ read_dbx_dynamic_symtab (objfile) { arelent *rel = *relptr; CORE_ADDR address = - rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); switch (bfd_get_arch (abfd)) { @@ -1295,7 +1286,7 @@ read_dbx_symtab (objfile) /* Init bincl list */ init_bincl_list (20, objfile); - back_to = make_cleanup ((make_cleanup_func) free_bincl_list, objfile); + back_to = make_cleanup_free_bincl_list (objfile); last_source_file = NULL; @@ -1382,7 +1373,7 @@ read_dbx_symtab (objfile) /* Don't set pst->texthigh lower than it already is. */ CORE_ADDR text_end = (lowest_text_address == (CORE_ADDR) -1 - ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)) + ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))) : lowest_text_address) + text_size; @@ -1558,6 +1549,7 @@ end_psymtab (pst, include_list, num_includes, capping_symbol_offset, struct partial_symtab *subpst = allocate_psymtab (include_list[i], objfile); + /* Copy the sesction_offsets array from the main psymtab. */ subpst->section_offsets = pst->section_offsets; subpst->read_symtab_private = (char *) obstack_alloc (&objfile->psymbol_obstack, @@ -1738,6 +1730,10 @@ read_ofile_symtab (pst) sym_size = LDSYMLEN (pst); text_offset = pst->textlow; text_size = pst->texthigh - pst->textlow; + /* This cannot be simply objfile->section_offsets because of + elfstab_offset_sections() which initializes the psymtab section + offsets information in a special way, and that is different from + objfile->section_offsets. */ section_offsets = pst->section_offsets; current_objfile = objfile; @@ -1880,7 +1876,7 @@ read_ofile_symtab (pst) if (last_source_start_addr > text_offset) last_source_start_addr = text_offset; - pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT); + pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); /* Process items which we had to "process_later" due to dependancies on other stabs. */ @@ -1899,6 +1895,8 @@ read_ofile_symtab (pst) NAME is the symbol name, in our address space. SECTION_OFFSETS is a set of amounts by which the sections of this object file were relocated when it was loaded into memory. + Note that these section_offsets are not the + objfile->section_offsets but the pst->section_offsets. All symbols that refer to memory locations need to be offset by these amounts. OBJFILE is the object file from which we are reading symbols. @@ -1942,7 +1940,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) if (!block_address_function_relative) /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the function start address, so just use the text offset. */ - function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT); + function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); /* Something is wrong if we see real data before seeing a source file name. */ @@ -1982,7 +1980,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) } /* Relocate for dynamic loading */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); #ifdef SMASH_TEXT_ADDRESS SMASH_TEXT_ADDRESS (valu); #endif @@ -2090,7 +2088,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) case N_FN_SEQ: /* This kind of symbol indicates the start of an object file. */ /* Relocate for dynamic loading */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); break; case N_SO: @@ -2099,7 +2097,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) Finish the symbol table of the previous source file (if any) and start accumulating a new symbol table. */ /* Relocate for dynamic loading */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); n_opt_found = 0; @@ -2126,7 +2124,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) patch_subfile_names (current_subfile, name); break; /* Ignore repeated SOs */ } - end_symtab (valu, objfile, SECT_OFF_TEXT); + end_symtab (valu, objfile, SECT_OFF_TEXT (objfile)); end_stabs (); } @@ -2149,7 +2147,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) included in the compilation of the main source file (whose name was given in the N_SO symbol.) */ /* Relocate for dynamic loading */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); start_subfile (name, current_subfile->dirname); break; @@ -2227,7 +2225,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) elfstab_offset_sections ever starts dealing with the text offset, and we still need to do this, we need to invent a SECT_OFF_ADDR_KLUDGE or something. */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); goto define_a_symbol; } } @@ -2247,22 +2245,22 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) case_N_STSYM: /* Static symbol in data seg */ case N_DSLINE: /* Source line number, data seg */ - valu += ANOFFSET (section_offsets, SECT_OFF_DATA); + valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile)); goto define_a_symbol; case_N_LCSYM: /* Static symbol in BSS seg */ case N_BSLINE: /* Source line number, bss seg */ /* N_BROWS: overlaps with N_BSLINE */ - valu += ANOFFSET (section_offsets, SECT_OFF_BSS); + valu += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile)); goto define_a_symbol; case_N_ROSYM: /* Static symbol in Read-only data seg */ - valu += ANOFFSET (section_offsets, SECT_OFF_RODATA); + valu += ANOFFSET (section_offsets, SECT_OFF_RODATA (objfile)); goto define_a_symbol; case N_ENTRY: /* Alternate entry point */ /* Relocate for dynamic loading */ - valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); goto define_a_symbol; /* The following symbol types we don't know how to process. Handle @@ -2314,7 +2312,7 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) /* Deal with the SunPRO 3.0 compiler which omits the address from N_FUN symbols. */ if (type == N_FUN - && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT)) + && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile))) valu = find_stab_function_addr (name, last_source_file, objfile); #endif diff --git a/gdb/dcache.c b/gdb/dcache.c index c43413965ae..538f77e06a1 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -149,24 +149,21 @@ struct dcache_struct int cache_has_stuff; }; -static int dcache_poke_byte PARAMS ((DCACHE * dcache, CORE_ADDR addr, - char *ptr)); +static int dcache_poke_byte (DCACHE * dcache, CORE_ADDR addr, char *ptr); -static int dcache_peek_byte PARAMS ((DCACHE * dcache, CORE_ADDR addr, - char *ptr)); +static int dcache_peek_byte (DCACHE * dcache, CORE_ADDR addr, char *ptr); -static struct dcache_block *dcache_hit PARAMS ((DCACHE * dcache, - CORE_ADDR addr)); +static struct dcache_block *dcache_hit (DCACHE * dcache, CORE_ADDR addr); -static int dcache_write_line PARAMS ((DCACHE * dcache, struct dcache_block * db)); +static int dcache_write_line (DCACHE * dcache, struct dcache_block *db); -static struct dcache_block *dcache_alloc PARAMS ((DCACHE * dcache)); +static struct dcache_block *dcache_alloc (DCACHE * dcache); -static int dcache_writeback PARAMS ((DCACHE * dcache)); +static int dcache_writeback (DCACHE * dcache); -static void dcache_info PARAMS ((char *exp, int tty)); +static void dcache_info (char *exp, int tty); -void _initialize_dcache PARAMS ((void)); +void _initialize_dcache (void); static int dcache_enabled_p = 0; @@ -481,7 +478,7 @@ dcache_xfer_memory (dcache, memaddr, myaddr, len, should_write) if (dcache_enabled_p) { - int (*xfunc) PARAMS ((DCACHE * dcache, CORE_ADDR addr, char *ptr)); + int (*xfunc) (DCACHE * dcache, CORE_ADDR addr, char *ptr); xfunc = should_write ? dcache_poke_byte : dcache_peek_byte; for (i = 0; i < len; i++) diff --git a/gdb/dcache.h b/gdb/dcache.h index 78d17efd181..d13708f2b2e 100644 --- a/gdb/dcache.h +++ b/gdb/dcache.h @@ -23,31 +23,30 @@ #ifndef DCACHE_H #define DCACHE_H -typedef int (*memxferfunc) PARAMS ((CORE_ADDR memaddr, - char *myaddr, - int len)); +typedef int (*memxferfunc) (CORE_ADDR memaddr, char *myaddr, int len); typedef struct dcache_struct DCACHE; /* Using the data cache DCACHE return the contents of the word at address ADDR in the remote machine. */ -int dcache_fetch PARAMS ((DCACHE * dcache, CORE_ADDR addr)); +int dcache_fetch (DCACHE * dcache, CORE_ADDR addr); /* Flush DCACHE. */ -void dcache_flush PARAMS ((DCACHE * dcache)); +void dcache_flush (DCACHE * dcache); /* Initialize DCACHE. */ -DCACHE *dcache_init PARAMS ((memxferfunc reading, memxferfunc writing)); +DCACHE *dcache_init (memxferfunc reading, memxferfunc writing); /* Write the word at ADDR both in the data cache and in the remote machine. */ -int dcache_poke PARAMS ((DCACHE * dcache, CORE_ADDR addr, int data)); +int dcache_poke (DCACHE * dcache, CORE_ADDR addr, int data); /* Simple to call from _xfer_memory */ -int dcache_xfer_memory PARAMS ((DCACHE * cache, CORE_ADDR mem, char *my, int len, int should_write)); +int dcache_xfer_memory (DCACHE * cache, CORE_ADDR mem, char *my, int len, + int should_write); /* Write the bytes at ADDR into the data cache and the remote machine. */ -int dcache_poke_block PARAMS ((DCACHE * cache, CORE_ADDR mem, char *my, int len)); +int dcache_poke_block (DCACHE * cache, CORE_ADDR mem, char *my, int len); /* Turn dcache state on or off */ void set_dcache_state (int); diff --git a/gdb/defs.h b/gdb/defs.h index 0270ddd1d8d..400f630b765 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -56,9 +56,6 @@ #include "libiberty.h" -/* libiberty.h can't declare this one, but evidently we can. */ -extern char *strsignal (int); - #include "progress.h" #ifdef USE_MMALLOC @@ -106,10 +103,6 @@ typedef bfd_vma CORE_ADDR; #endif /* ! LONGEST */ -extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs); -extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs); - - #ifndef min #define min(a, b) ((a) < (b) ? (a) : (b)) #endif @@ -253,7 +246,7 @@ struct cleanup works everywhere we use it. */ #ifndef ATTR_NORETURN -#if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) #define ATTR_NORETURN __attribute__ ((noreturn)) #else #define ATTR_NORETURN /* nothing */ @@ -261,7 +254,7 @@ struct cleanup #endif #ifndef ATTR_FORMAT -#if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 4 +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)) #define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y))) #else #define ATTR_FORMAT(type, x, y) /* nothing */ @@ -297,8 +290,6 @@ extern int subset_compare (char *, char *); extern char *safe_strerror (int); -extern char *safe_strsignal (int); - extern void init_malloc (void *); extern void request_quit (int); @@ -336,6 +327,10 @@ extern struct cleanup *make_cleanup_freeargv (char **); struct ui_file; extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *); +extern struct cleanup *make_cleanup_close (int fd); + +extern struct cleanup *make_cleanup_bfd_close (bfd *abfd); + extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *); extern struct cleanup *make_my_cleanup (struct cleanup **, @@ -354,7 +349,7 @@ extern void restore_cleanups (struct cleanup *); extern void restore_final_cleanups (struct cleanup *); extern void restore_my_cleanups (struct cleanup **, struct cleanup *); -extern void free_current_contents (char **); +extern void free_current_contents (void *); extern void null_cleanup (void *); @@ -374,6 +369,9 @@ extern void mfree (PTR, PTR); extern void init_page_info (void); +extern CORE_ADDR host_pointer_to_address (void *ptr); +extern void *address_to_host_pointer (CORE_ADDR addr); + /* From demangle.c */ extern void set_demangling_style (char *); @@ -484,9 +482,8 @@ extern char *paddr_nz (CORE_ADDR addr); extern char *paddr_u (CORE_ADDR addr); extern char *paddr_d (LONGEST addr); -typedef bfd_vma t_reg; -extern char *preg (t_reg reg); -extern char *preg_nz (t_reg reg); +extern char *phex (ULONGEST l, int sizeof_l); +extern char *phex_nz (ULONGEST l, int sizeof_l); extern void fprintf_symbol_filtered (struct ui_file *, char *, enum language, int); @@ -984,6 +981,12 @@ extern char *alloca (); /* Dynamic target-system-dependent parameters for GDB. */ #include "gdbarch.h" +#if (GDB_MULTI_ARCH == 0) +/* Multi-arch targets _should_ be including "arch-utils.h" directly + into their *-tdep.c file. This is a prop to help old non- + multi-arch targets to continue to compile. */ +#include "arch-utils.h" +#endif /* Static target-system-dependent parameters for GDB. */ @@ -1067,12 +1070,16 @@ extern int extract_long_unsigned_integer (void *, int, LONGEST *); extern CORE_ADDR extract_address (void *, int); +extern CORE_ADDR extract_typed_address (void *buf, struct type *type); + extern void store_signed_integer (void *, int, LONGEST); extern void store_unsigned_integer (void *, int, ULONGEST); extern void store_address (void *, int, LONGEST); +extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr); + /* Setup definitions for host and target floating point formats. We need to consider the format for `float', `double', and `long double' for both target and host. We need to do this so that we know what kind of conversions need @@ -1105,21 +1112,6 @@ extern const struct floatformat floatformat_unknown; #define HOST_LONG_DOUBLE_FORMAT &floatformat_unknown #endif -#ifndef TARGET_FLOAT_FORMAT -#define TARGET_FLOAT_FORMAT (TARGET_BYTE_ORDER == BIG_ENDIAN \ - ? &floatformat_ieee_single_big \ - : &floatformat_ieee_single_little) -#endif -#ifndef TARGET_DOUBLE_FORMAT -#define TARGET_DOUBLE_FORMAT (TARGET_BYTE_ORDER == BIG_ENDIAN \ - ? &floatformat_ieee_double_big \ - : &floatformat_ieee_double_little) -#endif - -#ifndef TARGET_LONG_DOUBLE_FORMAT -#define TARGET_LONG_DOUBLE_FORMAT &floatformat_unknown -#endif - /* Use `long double' if the host compiler supports it. (Note that this is not necessarily any longer than `double'. On SunOS/gcc, it's the same as double.) This is necessary because GDB internally converts all floating diff --git a/gdb/demangle.c b/gdb/demangle.c index 29174f5f956..b0fd13851b0 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -41,7 +41,7 @@ #define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING #endif -extern void _initialize_demangler PARAMS ((void)); +extern void _initialize_demangler (void); /* String name for the current demangling style. Set by the "set demangle-style" command, printed as part of the output by the @@ -101,8 +101,7 @@ demanglers[] = } }; -static void -set_demangling_command PARAMS ((char *, int, struct cmd_list_element *)); +static void set_demangling_command (char *, int, struct cmd_list_element *); /* Set current demangling style. Called by the "set demangle-style" command after it has updated the current_demangling_style_string to diff --git a/gdb/dink32-rom.c b/gdb/dink32-rom.c index 2bd004d28cb..1d6f4d0fc25 100644 --- a/gdb/dink32-rom.c +++ b/gdb/dink32-rom.c @@ -27,7 +27,7 @@ #include "symfile.h" /* For generic_load() */ #include "inferior.h" /* For write_pc() */ -static void dink32_open PARAMS ((char *args, int from_tty)); +static void dink32_open (char *args, int from_tty); static void dink32_supply_register (regname, regnamelen, val, vallen) diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2c3b6512018..8d95eba1eae 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,120 @@ +Fri May 26 15:55:33 2000 Andrew Cagney + + * Makefile.in (pdf, gdbint.pdf, gdb.pdf, stabs.pdf): New targets. + Generate using pdftex. + (PDFTEX): Define. + (STAGESTUFF, maintainer-clean realclean): Add *.pdf. + (gdb.texinfo, gdbint.texinfo, stabs.texinfo): When TeX insert the + @contents at the start. + +2000-05-24 Eli Zaretskii + + * gdb.texinfo: Remove duplicate @syncodeindex. From Brian + Youmans. + +Wed May 24 21:27:58 2000 Andrew Cagney + + From Brian Youmans: + * gdb.texinfo: Fix ``et al.''. + +Tue May 23 22:57:41 2000 Andrew Cagney + + * Makefile.in (refcard.dvi): Remove quotes around REFEDITS in for + loop. + +2000-05-19 Jimmy Guo + + * configure: Regenerate. + +2000-05-17 Eli Zaretskii + + * Makefile.in (install-info): Run install-info on installed Info + files. + +Fri May 12 20:18:04 2000 Andrew Cagney + + * gdb.texinfo: Add Stan Shebs, et.al. as authors. Mention + Andrew Cagney. + +2000-05-09 Eli Zaretskii + + * gdb.texinfo: Proofreading changes from Brian Youmans. + +2000-05-01 Nick Duffek + + * gdb.texinfo (Command Files): Mention -x, use @enumerate for + startup sequence, minor edits. + +2000-05-01 Eli Zaretskii + + * annotate.texi: Remove "@syncodeindex fn cp", it causes grief in + TeX. + + * gdb.texinfo: Add "@syncodeindex fn cp". Convert all entries + "@kindex f" into "@kindex f (foo)", otherwise we get index entries + like `n' and `s' which look weird. Convert some of the @kindex to + @vindex, when they refer to variables, not commands. + +Sat Apr 29 17:01:04 2000 Andrew Cagney + + * gdbint.texinfo (Hints): Do not use @value{GDBN in @nodes. + +2000-04-23 Eli Zaretskii + + * Makefile.in (GDBMI_DIR): New variable. + (SET_TEXINPUTS): Add $(GDBMI_DIR). + (SFILES_DOC): Add $(GDBMI_DIR)/gdbmi.texinfo. + (gdbmi.texinfo): New target, for texi2roff. + (gdb.me, gdb.ms, gdb.mm): Depend on gdbmi.texinfo. + (gdb.info, gdb_toc.html): Add "-I ${GDBMI_DIR}". + + * gdb.texinfo (Top): Add GDB/MI to the main menu and @include + gdbmi.texinfo. + (Mode Options): Add xref to GDB/MI docs and remove a FIXME + comment. + +2000-04-17 Elena Zannoni + + * gdb.texinfo (Files): Update description of add-symbol-file + command. + +2000-04-17 Eli Zaretskii + + * gdb.texinfo (Porting GDB): Don't use @value in the node name, it + prevents the build (and is generally a Bad Idea). + +2000-04-17 Eli Zaretskii + + * gdb.texinfo (Protocol): Prevent makeinfo from complaining about + a comma inside @var. + (Command Files): Index markup changes from Dmitry Sivachenko + . + +2000-04-16 Eli Zaretskii + + * Makefile.in (LN_S): Define. + (gdb-cfg.texi, gdb.dvi, links2roff, inc-hist.texinfo): Don't + invoke "ln -s" unless it is known to work. + + * configure.in (AC_PROG_LN_S): Add. + +2000-04-14 Jim Blandy + + * gdbint.texinfo (Pointers Are Not Always Addresses): New manual + section. + (Target Conditionals): Document ADDRESS_TO_POINTER, + POINTER_TO_ADDRESS. + +2000-04-11 Daniel Berlin + + * gdbint.texinfo: Replaced GDB with @value{GDBN}, @include + gdb-cfg.texi to get the value. + +2000-04-10 Jim Blandy + + * gdbint.texinfo (Target Architecture Definition): Fix + cross-references. + 2000-04-08 Jim Blandy * gdbint.texinfo (Using Different Register and Memory Data @@ -1847,7 +1964,7 @@ Thu Dec 5 22:46:12 1991 K. Richard Pixley (rich at rtl.cygnus.com) Local Variables: -mode: indented-text +mode: change-log left-margin: 8 fill-column: 74 version-control: never diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 0b703a88c56..025c20ed68d 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -27,6 +27,8 @@ htmldir = $(prefix)/html SHELL = @SHELL@ +LN_S = @LN_S@ + INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ @@ -54,7 +56,11 @@ TEXI2ROFF=texi2roff # Traditionally readline is in .. or . READLINE_DIR = ${gdbdir}/../readline/doc -SET_TEXINPUTS = TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$$TEXINPUTS +# The GDB/MI docs come from a sibling directory ../mi +GDBMI_DIR = ${gdbdir}/mi + +SET_TEXINPUTS = \ + TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS # There may be alternate predefined collections of switches to configure # the GDB manual. Normally this is not done in synch with the software @@ -86,12 +92,15 @@ TEXINDEX = texindex # Program to generate Postscript files from DVI files. DVIPS = dvips +# Program to generate PDF files from tex files. +PDFTEX = pdftex + # Main GDB manual's source files SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/annotate.texi SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) -SFILES_DOC = $(SFILES_LOCAL) \ +SFILES_DOC = $(SFILES_LOCAL) $(GDBMI_DIR)/gdbmi.texinfo \ $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo #### Host, target, and site specific Makefile fragments come in here. @@ -103,7 +112,8 @@ info: gdb.info gdbint.info stabs.info dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi ps: gdb.ps gdbint.ps stabs.ps refcard.ps html: gdb_toc.html gdbint_toc.html stabs_toc.html -all-doc: info dvi ps +pdf: gdb.pdf gdbint.pdf stabs.pdf +all-doc: info dvi ps # pdf diststuff: info install-info: info @@ -111,13 +121,20 @@ install-info: info for i in *.info* ; do \ $(INSTALL_DATA) $$i $(infodir)/$$i ; \ done + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='gdb.info gdbint.info stabs.info'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\ + install-info --info-dir=$(infodir) $(infodir)/$$file || :;\ + done; \ + else : ; fi install-html: html for i in *.html ; do \ $(INSTALL_DATA) $$i $(htmldir)/$$i ; \ done -STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi +STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf # Copy the object files from a particular stage into a subdirectory. stage1: force @@ -168,7 +185,7 @@ distclean: clean # "clean" or "distclean". Use maintainer-clean to remove them. maintainer-clean realclean: distclean - rm -f GDBvn.texi *.info* *.dvi *.ps *.html + rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf # GDB QUICK REFERENCE (dvi output) refcard.dvi : refcard.tex $(REFEDITS) @@ -176,7 +193,7 @@ refcard.dvi : refcard.tex $(REFEDITS) cp $(srcdir)/refcard.tex sedref.tex ; \ else \ echo > tmp.sed ; \ - for f in "$(REFEDITS)" ; do \ + for f in $(REFEDITS) ; do \ cat $(srcdir)/$$f >>tmp.sed ; done ; \ sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex ; \ fi @@ -200,7 +217,8 @@ GDBvn.texi : ${gdbdir}/Makefile.in # not one for their binary config---which may not be specifically # defined anyways). gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi - ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \ + (test "$$LN_S" = "ln -s" && \ + ln -s ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi) || \ ln ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi || \ cp ${srcdir}/${DOC_CONFIG}-cfg.texi gdb-cfg.texi @@ -216,7 +234,7 @@ gdb-cfg.texi: ${srcdir}/${DOC_CONFIG}-cfg.texi # GDB MANUAL: TeX dvi file gdb.dvi: ${SFILES_DOC} if [ ! -f ./GDBvn.texi ]; then \ - ln -s $(srcdir)/GDBvn.texi . || \ + (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ ln $(srcdir)/GDBvn.texi . || \ cp $(srcdir)/GDBvn.texi . ; else true; fi $(SET_TEXINPUTS) $(TEX) gdb.texinfo @@ -229,11 +247,23 @@ gdb.dvi: ${SFILES_DOC} gdb.ps: gdb.dvi $(DVIPS) -o $@ $? +gdb.pdf: ${SFILES_DOC} + if [ ! -f ./GDBvn.texi ]; then \ + (test "$$LN_S" = "ln -s" && ln -s $(srcdir)/GDBvn.texi .) || \ + ln $(srcdir)/GDBvn.texi . || \ + cp $(srcdir)/GDBvn.texi . ; else true; fi + $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo + $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo + $(TEXINDEX) gdb.?? + $(SET_TEXINPUTS) $(PDFTEX) gdb.texinfo + rm -f gdb.aux gdb.cp* gdb.fn* gdb.ky* gdb.log gdb.pg* gdb.toc \ + gdb.tp* gdb.vr* + # GDB MANUAL: info file -# We're using texinfo2, and older makeinfo's may not be able to +# We're using texinfo 3.12; older makeinfo's may not be able to # cope with all the markup. gdb.info: ${SFILES_DOC} - $(MAKEINFO) -I ${READLINE_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo + $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) -o ./gdb.info gdb.texinfo # GDB MANUAL: roff translations # Try to use a recent texi2roff. v2 was put on prep in jan91. @@ -251,7 +281,7 @@ gdb.info: ${SFILES_DOC} # in main sourcedir. links2roff: $(SFILES_INCLUDED) if [ ! -f gdb.texinfo ]; then \ - ln -s $(SFILES_INCLUDED) . || \ + (test "$$LN_S" = "ln -s" && ln -s $(SFILES_INCLUDED) .) || \ ln $(SFILES_INCLUDED) . || \ cp $(SFILES_INCLUDED) . ; \ fi @@ -267,12 +297,19 @@ rluser.texinfo: ${READLINE_DIR}/rluser.texinfo ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo - ln -s ${READLINE_DIR}/inc-hist.texinfo . || \ + (test "$$LN_S" = "ln -s" && \ + ln -s ${READLINE_DIR}/inc-hist.texinfo .) || \ ln ${READLINE_DIR}/inc-hist.texinfo . || \ cp ${READLINE_DIR}/inc-hist.texinfo . +gdbmi.texinfo: ${GDBMI_DIR}/gdbmi.texinfo + (test "$$LN_S" = "ln -s" && \ + ln -s ${GDBMI_DIR}/gdbmi.texinfo .) || \ + ln ${GDBMI_DIR}/gdbmi.texinfo . || \ + cp ${GDBMI_DIR}/gdbmi.texinfo . + # gdb manual suitable for [gtn]roff -me -gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo +gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -287,7 +324,7 @@ gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo >gdb.me # gdb manual suitable for [gtn]roff -ms -gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo +gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -304,7 +341,7 @@ gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo # gdb manual suitable for [tn]roff -mm # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, # try leaving them in -gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo +gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo gdbmi.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -322,7 +359,7 @@ gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo # GDB MANUAL: HTML file gdb_toc.html: ${SFILES_DOC} - $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo + $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo # GDB GUI MANUAL: TeX dvi file gdbgui.dvi : gdbgui.texinfo ${SFILES_DOC} @@ -349,6 +386,13 @@ gdbint.dvi : gdbint.texinfo gdbint.ps : gdbint.dvi $(DVIPS) -o $@ $? +gdbint.pdf: gdbint.dvi + $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo + $(TEXINDEX) gdbint.?? + $(SET_TEXINPUTS) $(PDFTEX) gdbint.texinfo + rm -f gdbint.aux gdbint.cp* gdbint.fn* gdbint.ky* \ + gdbint.log gdbint.pg* gdbint.toc gdbint.tp* gdbint.vr* + # GDB INTERNALS MANUAL: info file gdbint.info: gdbint.texinfo @@ -378,6 +422,13 @@ stabs.dvi : stabs.texinfo stabs.ps: stabs.dvi $(DVIPS) -o $@ $? +stabs.pdf: stabs.dvi + $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo + $(TEXINDEX) stabs.?? + $(SET_TEXINPUTS) $(PDFTEX) stabs.texinfo + rm -f stabs.aux stabs.cp* stabs.fn* stabs.ky* \ + stabs.log stabs.pg* stabs.toc stabs.tp* stabs.vr* + force: Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag) config.status diff --git a/gdb/doc/annotate.texi b/gdb/doc/annotate.texi index ec79a39e971..e16de05cdfd 100644 --- a/gdb/doc/annotate.texi +++ b/gdb/doc/annotate.texi @@ -53,7 +53,7 @@ @c @node Top @c @top GDB Annotations -@syncodeindex fn cp +@c @syncodeindex fn cp @node Annotations @chapter @value{GDBN} Annotations diff --git a/gdb/doc/configure b/gdb/doc/configure index 8c5591ce05e..2f9ade3e547 100755 --- a/gdb/doc/configure +++ b/gdb/doc/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12.2 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -333,7 +333,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12.2" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -600,8 +600,31 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:609: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -625,7 +648,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1 | grep ac_space` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -704,7 +727,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12.2" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -728,6 +751,7 @@ s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -747,7 +771,9 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@LN_S@%$LN_S%g CEOF EOF diff --git a/gdb/doc/configure.in b/gdb/doc/configure.in index 460efc2b466..fee9eced522 100644 --- a/gdb/doc/configure.in +++ b/gdb/doc/configure.in @@ -1,4 +1,5 @@ AC_PREREQ(2.12.1) AC_INIT(refcard.tex) AC_PROG_INSTALL +AC_PROG_LN_S AC_OUTPUT(Makefile) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 3b81c128fe4..914e0ab3cb9 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21,8 +21,10 @@ @finalout @syncodeindex ky cp -@c readline appendices use @vindex +@c readline appendices use @vindex, @findex and @ftable, +@c annotate.texi and gdbmi use @findex. @syncodeindex vr cp +@syncodeindex fn cp @c !!set GDB manual's edition---not the same as GDB version! @set EDITION Eighth @@ -75,7 +77,7 @@ into another language, under the above conditions for modified versions. @sp 1 @subtitle @value{EDITION} Edition, for @value{GDBN} version @value{GDBVN} @subtitle @value{DATE} -@author Richard M. Stallman and Roland H. Pesch +@author Richard Stallman, Roland Pesch, Stan Shebs, et al. @page @tex {\parskip=0pt @@ -142,6 +144,7 @@ Copyright (C) 1988-2000 Free Software Foundation, Inc. * Sequences:: Canned sequences of commands * Emacs:: Using @value{GDBN} under @sc{gnu} Emacs * Annotations:: @value{GDBN}'s annotation interface. +* GDB/MI:: @value{GDBN}'s Machine Interface. * GDB Bugs:: Reporting bugs in @value{GDBN} * Formatting Documentation:: How to format and print @value{GDBN} documentation @@ -203,6 +206,11 @@ Copyright (C) 1988-2000 Free Software Foundation, Inc. @end ifhtml +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@iftex +@contents +@end iftex + @node Summary @unnumbered Summary of @value{GDBN} @@ -291,6 +299,7 @@ omitted from this list, we would like to add your names! So that they may not regard their many labors as thankless, we particularly thank those who shepherded @value{GDBN} through major releases: +Andrew Cagney (release 5.0); Jim Blandy (release 4.18); Jason Molenda (release 4.17); Stan Shebs (release 4.14); @@ -1040,9 +1049,7 @@ Use the interpreter @var{interp} for interface with the controlling program or device. This option is meant to be set by programs which communicate with @value{GDBN} using it as a back end. For example, @samp{--interpreter=mi} causes @value{GDBN} to use the @dfn{gdbmi -interface}. -@c FIXME: There should be an @xref here to the GDB/MI docs, but -@c gdbmi.texi doesn't have a single node to reference! +interface} (@pxref{GDB/MI, , The @sc{gdb/mi} Interface}). @item -write @cindex @code{--write} @@ -1069,7 +1076,7 @@ no-warranty blurb, and exit. @table @code @kindex quit @r{[}@var{expression}@r{]} -@kindex q +@kindex q @r{(@code{quit})} @item quit @r{[}@var{expression}@r{]} @itemx q To exit @value{GDBN}, use the @code{quit} command (abbreviated @@ -1154,7 +1161,7 @@ names start with @code{s}. You can test abbreviations by using them as arguments to the @code{help} command. @cindex repeating commands -@kindex RET +@kindex RET @r{(repeat last command)} A blank line as input to @value{GDBN} (typing just @key{RET}) means to repeat the previous command. Certain commands (for example, @code{run}) will not repeat this way; these are commands whose unintentional @@ -1171,7 +1178,7 @@ output, in a way similar to the common utility @code{more} @key{RET} too many in this situation, @value{GDBN} disables command repetition after any command that generates this sort of display. -@kindex # +@kindex # @r{(a comment)} @cindex comment Any text from a @kbd{#} to the end of the line is a comment; it does nothing. This is useful mainly in command files (@pxref{Command @@ -1305,7 +1312,7 @@ You can always ask @value{GDBN} itself for information on its commands, using the command @code{help}. @table @code -@kindex h +@kindex h @r{(@code{help})} @item help @itemx h You can use @code{help} (abbreviated @code{h}) with no arguments to @@ -1421,7 +1428,7 @@ all the sub-commands. @xref{Index}. @c @group @table @code @kindex info -@kindex i +@kindex i @r{(@code{info})} @item info This command (abbreviated @code{i}) is for describing the state of your program. For example, you can list the arguments given to your program @@ -1557,6 +1564,7 @@ format; if your @sc{gnu} C compiler has this option, do not use it. @table @code @kindex run +@kindex r @r{(@code{run})} @item run @itemx r Use the @code{run} command to start your program under @value{GDBN}. @@ -1646,8 +1654,8 @@ the program, not by the shell. @code{run} with no arguments uses the same arguments used by the previous @code{run}, or those set by the @code{set args} command. -@kindex set args @table @code +@kindex set args @item set args Specify the arguments to be used the next time your program is run. If @code{set args} has no arguments, @code{run} executes your program @@ -1954,7 +1962,7 @@ control, one thread in particular is always the focus of debugging. This thread is called the @dfn{current thread}. Debugging commands show program information from the perspective of the current thread. -@kindex New @var{systag} +@cindex @code{New} @var{systag} message @cindex thread identifier (system) @c FIXME-implementors!! It would be more helpful if the [New...] message @c included GDB's numeric thread handle, so you could just go to that @@ -2025,8 +2033,8 @@ For debugging purposes, @value{GDBN} associates its own thread number---a small integer assigned in thread-creation order---with each thread in your program. -@kindex New @var{systag} -@cindex thread identifier (system) +@cindex @code{New} @var{systag} message, on HP-UX +@cindex thread identifier (system), on HP-UX @c FIXME-implementors!! It would be more helpful if the [New...] message @c included GDB's numeric thread handle, so you could just go to that @c thread without first checking `info threads'. @@ -2311,8 +2319,8 @@ all breakpoint in that range are operated on. @c FIXME 2 is there stuff on this already? break at fun start, already init? @kindex break -@kindex b -@kindex $bpnum +@kindex b @r{(@code{break})} +@vindex $bpnum@r{, convenience variable} @cindex latest breakpoint Breakpoints are set with the @code{break} command (abbreviated @code{b}). The debugger convenience variable @samp{$bpnum} records the @@ -2822,7 +2830,7 @@ Delete any breakpoints set at or within the code of the specified line. @cindex delete breakpoints @kindex delete -@kindex d +@kindex d @r{(@code{delete})} @item delete @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} Delete the breakpoints, watchpoints, or catchpoints of the breakpoint ranges specified as arguments. If no argument is specified, delete all @@ -2870,7 +2878,7 @@ watchpoints, and catchpoints: @table @code @kindex disable breakpoints @kindex disable -@kindex dis +@kindex dis @r{(@code{disable})} @item disable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} Disable the specified breakpoints---or all breakpoints, if none are listed. A disabled breakpoint has no effect but is not forgotten. All @@ -3218,8 +3226,8 @@ it stops due to a signal, you may want to use @code{handle}, or use @table @code @kindex continue -@kindex c -@kindex fg +@kindex c @r{(@code{continue})} +@kindex fg @r{(resume foreground execution)} @item continue @r{[}@var{ignore-count}@r{]} @itemx c @r{[}@var{ignore-count}@r{]} @itemx fg @r{[}@var{ignore-count}@r{]} @@ -3253,7 +3261,7 @@ interesting, until you see the problem happen. @table @code @kindex step -@kindex s +@kindex s @r{(@code{step})} @item step Continue running your program until control reaches a different source line, then stop it and return control to @value{GDBN}. This command is @@ -3292,7 +3300,7 @@ breakpoint is reached, or a signal not related to stepping occurs before @var{count} steps, stepping stops right away. @kindex next -@kindex n +@kindex n @r{(@code{next})} @item next @r{[}@var{count}@r{]} Continue to the next source line in the current (innermost) stack frame. This is similar to @code{step}, but function calls that appear within @@ -3324,7 +3332,7 @@ Contrast this with the @code{return} command (@pxref{Returning, ,Returning from a function}). @kindex until -@kindex u +@kindex u @r{(@code{until})} @item until @itemx u Continue running until a source line past the current line, in the @@ -3378,7 +3386,7 @@ the forms of argument acceptable to @code{break} (@pxref{Set Breaks, and hence is quicker than @code{until} without an argument. @kindex stepi -@kindex si +@kindex si @r{(@code{stepi})} @item stepi @itemx stepi @var{arg} @itemx si @@ -3393,7 +3401,7 @@ An argument is a repeat count, as in @code{step}. @need 750 @kindex nexti -@kindex ni +@kindex ni @r{(@code{nexti})} @item nexti @itemx nexti @var{arg} @itemx ni @@ -3680,6 +3688,7 @@ no provision for frameless functions elsewhere in the stack. @table @code @kindex frame@r{, command} +@cindex current stack frame @item frame @var{args} The @code{frame} command allows you to move from one stack frame to another, and to print the stack frame you select. @var{args} may be either the @@ -3687,6 +3696,7 @@ address of the frame or the stack frame number. Without an argument, @code{frame} prints the current stack frame. @kindex select-frame +@cindex selecting frame silently @item select-frame The @code{select-frame} command allows you to move from one stack frame to another without printing the frame. This is the silent version of @@ -3706,7 +3716,7 @@ stack. @table @code @kindex backtrace -@kindex bt +@kindex bt @r{(@code{backtrace})} @item backtrace @itemx bt Print a backtrace of the entire stack: one line per frame for all @@ -3726,7 +3736,7 @@ Similar, but print only the outermost @var{n} frames. @kindex where @kindex info stack -@kindex info s +@kindex info s @r{(@code{info stack})} The names @code{where} and @code{info stack} (abbreviated @code{info s}) are additional aliases for @code{backtrace}. @@ -3766,7 +3776,7 @@ of the stack frame just selected. @table @code @kindex frame@r{, selecting} -@kindex f +@kindex f @r{(@code{frame})} @item frame @var{n} @itemx f @var{n} Select frame number @var{n}. Recall that frame zero is the innermost @@ -3801,7 +3811,7 @@ advances toward the outermost frame, to higher frame numbers, to frames that have existed longer. @var{n} defaults to one. @kindex down -@kindex do +@kindex do @r{(@code{down})} @item down @var{n} Move @var{n} frames down the stack. For positive numbers @var{n}, this advances toward the innermost frame, to lower frame numbers, to frames @@ -3858,7 +3868,7 @@ argument, this command is used to select a stack frame. @xref{Selection, ,Selecting a frame}. @kindex info frame -@kindex info f +@kindex info f @r{(@code{info frame})} @item info frame @itemx info f This command prints a verbose description of the selected stack frame, @@ -3944,7 +3954,7 @@ prefer to use Emacs facilities to view source; see @ref{Emacs, ,Using @section Printing source lines @kindex list -@kindex l +@kindex l @r{(@code{list})} To print lines from a source file, use the @code{list} command (abbreviated @code{l}). By default, ten lines are printed. There are several ways to specify what part of the file you want to print. @@ -4127,8 +4137,8 @@ path; this moves it forward, so @value{GDBN} searches it sooner. @kindex cdir @kindex cwd -@kindex $cdir -@kindex $cwd +@vindex $cdir@r{, convenience variable} +@vindex $cwdr@r{, convenience variable} @cindex compilation directory @cindex current directory @cindex working directory @@ -4205,7 +4215,7 @@ Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404. @end smallexample @cindex @code{$_} and @code{info line} -@kindex x@r{, and }@code{info line} +@kindex x@r{(examine), and} info line After @code{info line}, the default address for the @code{x} command is changed to the starting address of the line, so that @samp{x/i} is sufficient to begin examining the machine code (@pxref{Memory, @@ -4429,7 +4439,7 @@ using the colon-colon notation: @cindex colon-colon, context for variables/functions @iftex @c info cannot cope with a :: index entry, but why deprive hard copy readers? -@kindex :: +@cindex @code{::}, context for variables/functions @end iftex @example @var{file}::@var{variable} @@ -4500,7 +4510,7 @@ information. @section Artificial arrays @cindex artificial array -@kindex @@ +@kindex @@@r{, referencing memory as an array} It is often useful to print out several successive objects of the same type in memory; a section of an array, or an array of dynamically determined size for which only a pointer exists in the @@ -4645,7 +4655,7 @@ any of several formats, independently of your program's data types. @cindex examining memory @table @code -@kindex x +@kindex x @r{(examine memory)} @item x/@var{nfu} @var{addr} @itemx x @var{addr} @itemx x @@ -5336,7 +5346,7 @@ Some convenience variables are created automatically by @value{GDBN} and given values likely to be useful. @table @code -@kindex $_ +@vindex $_@r{, convenience variable} @item $_ The variable @code{$_} is automatically set by the @code{x} command to the last address examined (@pxref{Memory, ,Examining memory}). Other @@ -5346,14 +5356,14 @@ and @code{info breakpoint}. The type of @code{$_} is @code{void *} except when set by the @code{x} command, in which case it is a pointer to the type of @code{$__}. -@kindex $__ +@vindex $__@r{, convenience variable} @item $__ The variable @code{$__} is automatically set by the @code{x} command to the value found in the last address examined. Its type is chosen to match the format in which the data was printed. @item $_exitcode -@kindex $_exitcode +@vindex $_exitcode@r{, convenience variable} The variable @code{$_exitcode} is automatically set to the exit code when the program being debugged terminates. @end table @@ -5868,8 +5878,8 @@ Since C and C++ are so closely related, many features of @value{GDBN} apply to both languages. Whenever this is the case, we discuss those languages together. -@cindex C++ -@kindex g++ +@cindex C@t{++} +@cindex @code{g++}, @sc{gnu} C@t{++} compiler @cindex @sc{gnu} C++ The C++ debugging facilities are jointly implemented by the C++ compiler and @value{GDBN}. Therefore, to debug your C++ code @@ -6161,7 +6171,7 @@ Member function calls are allowed; you can use expressions like count = aml->GetOriginal(x, y) @end example -@kindex this +@vindex this@r{, inside C@t{++} member functions} @cindex namespace in C++ @item While a member function is active (in the selected stack frame), your @@ -6762,14 +6772,14 @@ index bounds, and all built-in functions and procedures. @node M2 Scope @subsubsection The scope operators @code{::} and @code{.} @cindex scope -@kindex . +@cindex @code{.}, Modula-2 scope operator @cindex colon, doubled as scope operator @ifinfo -@kindex colon-colon@r{, in Modula-2} +@vindex colon-colon@r{, in Modula-2} @c Info cannot handle :: but TeX can. @end ifinfo @iftex -@kindex :: +@vindex ::@r{, in Modula-2} @end iftex There are a few subtle differences between the Modula-2 scope operator @@ -8012,19 +8022,16 @@ the program is running. To do this, use the @code{kill} command @cindex dynamic linking @item add-symbol-file @var{filename} @var{address} @itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]} @r{[} -mapped @r{]} -@itemx add-symbol-file @var{filename} @var{address} @var{data_address} @var{bss_address} -@itemx add-symbol-file @var{filename} @r{-T}@var{section} @var{address} +@itemx add-symbol-file @var{filename} @r{-s}@var{section} @var{address} The @code{add-symbol-file} command reads additional symbol table information from the file @var{filename}. You would use this command when @var{filename} has been dynamically loaded (by some other means) into the program that is running. @var{address} should be the memory address at which the file has been loaded; @value{GDBN} cannot figure -this out for itself. You can specify up to three addresses, in which -case they are taken to be the addresses of the text, data, and bss -segments respectively. For complicated cases, you can specify an -arbitrary number of @samp{@r{-T}@var{section} @var{address}} pairs, to -give an explicit section name and base address for that section. You -can specify any @var{address} as an expression. +this out for itself. You can additionally specify an arbitrary number +of @samp{@r{-s}@var{section} @var{address}} pairs, to give an explicit +section name and base address for that section. You can specify any +@var{address} as an expression. The symbol table of the file @var{filename} is added to the symbol table originally read with the @code{symbol-file} command. You can use the @@ -8421,10 +8428,6 @@ specifies a fixed address. @cindex choosing target byte order @cindex target byte order -@kindex set endian big -@kindex set endian little -@kindex set endian auto -@kindex show endian Some types of processors, such as the MIPS, PowerPC, and Hitachi SH, offer the ability to run either big-endian or little-endian byte @@ -8536,30 +8539,30 @@ These working remote stubs are distributed with @value{GDBN}: @table @code @item i386-stub.c -@kindex i386-stub.c +@cindex @file{i386-stub.c} @cindex Intel @cindex i386 For Intel 386 and compatible architectures. @item m68k-stub.c -@kindex m68k-stub.c +@cindex @file{m68k-stub.c} @cindex Motorola 680x0 @cindex m680x0 For Motorola 680x0 architectures. @item sh-stub.c -@kindex sh-stub.c +@cindex @file{sh-stub.c} @cindex Hitachi @cindex SH For Hitachi SH architectures. @item sparc-stub.c -@kindex sparc-stub.c +@cindex @file{sparc-stub.c} @cindex Sparc For @sc{sparc} architectures. @item sparcl-stub.c -@kindex sparcl-stub.c +@cindex @file{sparcl-stub.c} @cindex Fujitsu @cindex SparcLite For Fujitsu @sc{sparclite} architectures. @@ -8754,7 +8757,7 @@ void (*exceptionHook)() = 0; @noindent but if before calling @code{set_debug_traps}, you set it to point to a -function in your program; that function is called when +function in your program, that function is called when @code{@value{GDBN}} continues after stopping on a trap (for example, bus error). The function indicated by @code{exceptionHook} is called with one parameter: an @code{int} which is the exception number. @@ -8928,7 +8931,7 @@ So: @noindent means the same as "0000". -The error response, returned for some packets includes a two character +The error response returned for some packets includes a two character error number. That number is not well defined. For any @var{command} not supported by the stub, an empty response @@ -8942,7 +8945,7 @@ optional. Below is a complete list of all currently defined @var{command}s and their corresponding response @var{data}: - +@page @multitable @columnfractions .30 .30 .40 @item Packet @tab Request @@ -8952,7 +8955,7 @@ their corresponding response @var{data}: @tab @code{!} @tab Use the extended remote protocol. Sticky---only needs to be set once. -The extended remote protocol support the @samp{R} packet. +The extended remote protocol supports the @samp{R} packet. @item @tab reply @samp{} @tab @@ -8977,6 +8980,9 @@ and continue. @item set program arguments @strong{(reserved)} @tab @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,...} @tab +@item +@tab +@tab Initialized @samp{argv[]} array passed into program. @var{arglen} specifies the number of bytes in the hex encoded byte stream @var{arg}. See @file{gdbserver} for more details. @@ -9023,7 +9029,7 @@ Continue with signal @var{sig} (hex signal number). If @tab reply @tab see below -@item toggle debug @emph{(deprecated)} +@item toggle debug @strong{(deprecated)} @tab @code{d} @tab toggle debug flag. @@ -9036,7 +9042,7 @@ Detach @value{GDBN} from the remote system. Sent to the remote target before @item @tab reply @emph{no response} @tab -@value{GDBN} does not check for any response after sending this packet +@value{GDBN} does not check for any response after sending this packet. @item reserved @tab @code{e} @@ -9219,7 +9225,7 @@ digits for each byte in the register (target byte order). @item general query @tab @code{q}@var{query} @tab -Request info about @var{query}. In general @value{GDBN} @var{query}'s +Request info about @var{query}. In general @value{GDBN} queries have a leading upper case letter. Custom vendor queries should use a company prefix (in lower case) ex: @samp{qfsf.var}. @var{query} may optionally be followed by a @samp{,} or @samp{;} separated list. Stubs @@ -9240,7 +9246,7 @@ must ensure that they match the full @var{query} name. Set value of @var{var} to @var{val}. See @samp{q} for a discussing of naming conventions. -@item reset @emph{(deprecated)} +@item reset @strong{(deprecated)} @tab @code{r} @tab Reset the entire system. @@ -9448,7 +9454,7 @@ sequence will be the @code{qs}@code{ThreadInfo} query. @tab reply @code{m}@var{} @tab A single thread id @item -@tab reply @code{m}@var{,}@var{...} +@tab reply @code{m}@var{},@var{...} @tab a comma-separated list of thread ids @item @tab reply @code{l} @@ -9534,6 +9540,9 @@ offset to the @code{Bss} section.} @item thread info request @tab @code{q}@code{P}@var{mode}@var{threadid} @tab +@item +@tab +@tab Returns information on @var{threadid}. Where: @var{mode} is a hex encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID. @item @@ -9544,6 +9553,9 @@ See @code{remote.c:remote_unpack_thread_info_response()}. @item remote command @tab @code{q}@code{Rcmd,}@var{COMMAND} @tab +@item +@tab +@tab @var{COMMAND} (hex encoded) is passed to the local interpreter for execution. Invalid commands should be reported using the output string. Before the final result packet, the target may also respond with a @@ -10339,7 +10351,7 @@ and type @kbd{~.} to leave @code{tip} or @code{cu}. @node Remote Log @subsubsection Remote log -@kindex eb.log +@cindex @file{eb.log}, a log file for EB29K @cindex log file for EB29K The @code{target amd-eb} command creates a file @file{eb.log} in the @@ -10598,6 +10610,7 @@ memory}. The accepted values for @var{mod} are @code{small}, @item target mon960 @var{dev} MON960 monitor for Intel i960. +@kindex target nindy @item target nindy @var{devicename} An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is the name of the serial device to use for the connection, e.g. @@ -10623,12 +10636,6 @@ By responding to a prompt on startup; By using the @code{target} command at any point during your @value{GDBN} session. @xref{Target Commands, ,Commands for managing targets}. -@kindex target nindy -@item target nindy @var{devicename} -An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is -the name of the serial device to use for the connection, e.g. -@file{/dev/ttya}. - @end itemize @cindex download to Nindy-960 @@ -11004,14 +11011,14 @@ both the Unix host and on the Sparclet target. The program @code{@value{GDBP}} is installed and executed on the Unix host. @table @code -@item timeout @var{args} +@item remotetimeout @var{args} @kindex remotetimeout @value{GDBN} supports the option @code{remotetimeout}. This option is set by the user, and @var{args} represents the number of seconds @value{GDBN} waits for responses. @end table -@kindex Compiling +@cindex compiling, on Sparclet When compiling for debugging, include the options @samp{-g} to get debug information and @samp{-Ttext} to relocate the program to where you wish to load it on the target. You may also want to add the options @samp{-n} or @@ -11027,7 +11034,7 @@ You can use @code{objdump} to verify that the addresses are what you intended: sparclet-aout-objdump --headers --syms prog @end example -@kindex Running +@cindex running, on Sparclet Once you have set your Unix execution search path to find @value{GDBN}, you are ready to run @value{GDBN}. From your Unix host, run @code{@value{GDBP}} @@ -11316,7 +11323,7 @@ you may want to limit the size of this search, using one of these commands: @table @code -@cindex @code{heuristic-fence-post} (Alpha,MIPS) +@cindex @code{heuristic-fence-post} (Alpha, MIPS) @item set heuristic-fence-post @var{limit} Restrict @value{GDBN} to examining at most @var{limit} bytes in its search for the beginning of a function. A value of @var{0} (the @@ -11493,7 +11500,7 @@ These commands display the state of the @value{GDBN} history parameters. @end table @table @code -@kindex show commands +@kindex shows @item show commands Display the last ten commands in the command history. @@ -11907,16 +11914,30 @@ the last command, as it would from the terminal. @cindex @file{.gdbinit} @cindex @file{gdb.ini} When you start @value{GDBN}, it automatically executes commands from its -@dfn{init files}. These are files named @file{.gdbinit} on Unix, or -@file{gdb.ini} on DOS/Windows. @value{GDBN} reads the init file (if -any) in your home directory@footnote{On DOS/Windows systems, the home -directory is the one pointed to by the @code{HOME} environment -variable.}, then processes command line options and operands, and then -reads the init file (if any) in the current working directory. This is -so the init file in your home directory can set options (such as -@code{set complaints}) which affect the processing of the command line -options and operands. The init files are not executed if you use the -@samp{-nx} option; @pxref{Mode Options, ,Choosing modes}. +@dfn{init files}. These are files named @file{.gdbinit} on Unix and +@file{gdb.ini} on DOS/Windows. During startup, @value{GDBN} does the +following: + +@enumerate +@item +Reads the init file (if any) in your home directory@footnote{On +DOS/Windows systems, the home directory is the one pointed to by the +@code{HOME} environment variable.}. + +@item +Processes command line options and operands. + +@item +Reads the init file (if any) in the current working directory. + +@item +Reads command files specified by the @samp{-x} option. +@end enumerate + +The init file in your home directory can set options (such as @samp{set +complaints}) that affect subsequent processing of command line options +and operands. Init files are not executed if you use the @samp{-nx} +option (@pxref{Mode Options, ,Choosing modes}). @cindex init file name On some configurations of @value{GDBN}, the init file is known by a @@ -11925,18 +11946,18 @@ form of @value{GDBN} may need to coexist with other forms, hence a different name for the specialized version's init file). These are the environments with special init file names: -@kindex .vxgdbinit +@cindex @file{.vxgdbinit} @itemize @bullet @item -VxWorks (Wind River Systems real-time OS): @samp{.vxgdbinit} +VxWorks (Wind River Systems real-time OS): @file{.vxgdbinit} -@kindex .os68gdbinit +@cindex @file{.os68gdbinit} @item -OS68K (Enea Data Systems real-time OS): @samp{.os68gdbinit} +OS68K (Enea Data Systems real-time OS): @file{.os68gdbinit} -@kindex .esgdbinit +@cindex @file{.esgdbinit} @item -ES-1800 (Ericsson Telecom AB M68000 emulator): @samp{.esgdbinit} +ES-1800 (Ericsson Telecom AB M68000 emulator): @file{.esgdbinit} @end itemize You can also request the execution of a command file with the @@ -12212,6 +12233,7 @@ each value is printed in its own window. @end ignore @include annotate.texi +@include gdbmi.texinfo @node GDB Bugs @chapter Reporting Bugs in @value{GDBN} @@ -12857,5 +12879,12 @@ needed for special purposes only. % Blame: doc@cygnus.com, 1991. @end tex +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@ifinfo @contents +@end ifinfo +@ifhtml +@contents +@end ifhtml + @bye diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 25b116e16e8..532d22351b8 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -1,6 +1,6 @@ \input texinfo @setfilename gdbint.info - +@include gdb-cfg.texi @ifinfo @format START-INFO-DIR-ENTRY @@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY @end ifinfo @ifinfo -This file documents the internals of the GNU debugger GDB. +This file documents the internals of the GNU debugger @value{GDBN}. Copyright 1990-1999 Free Software Foundation, Inc. Contributed by Cygnus Solutions. Written by John Gilmore. @@ -33,10 +33,10 @@ regarded as a program in the language TeX). @end ifinfo @setchapternewpage off -@settitle GDB Internals +@settitle @value{GDBN} Internals @titlepage -@title{GDB Internals} +@title @value{GDBN} Internals @subtitle{A guide to the internals of the GNU debugger} @author John Gilmore @author Cygnus Solutions @@ -63,14 +63,19 @@ are preserved on all copies. @end titlepage +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@iftex +@contents +@end iftex + @node Top @c Perhaps this should be the title of the document (but only for info, @c not for TeX). Existing GNU manuals seem inconsistent on this point. @top Scope of this Document -This document documents the internals of the GNU debugger, GDB. It -includes description of GDB's key algorithms and operations, as well -as the mechanisms that adapt GDB to specific hosts and targets. +This document documents the internals of the GNU debugger, @value{GDBN}. It +includes description of @value{GDBN}'s key algorithms and operations, as well +as the mechanisms that adapt @value{GDBN} to specific hosts and targets. @menu * Requirements:: @@ -95,41 +100,41 @@ as the mechanisms that adapt GDB to specific hosts and targets. @chapter Requirements Before diving into the internals, you should understand the formal -requirements and other expectations for GDB. Although some of these may -seem obvious, there have been proposals for GDB that have run counter to +requirements and other expectations for @value{GDBN}. Although some of these may +seem obvious, there have been proposals for @value{GDBN} that have run counter to these requirements. -First of all, GDB is a debugger. It's not designed to be a front panel +First of all, @value{GDBN} is a debugger. It's not designed to be a front panel for embedded systems. It's not a text editor. It's not a shell. It's not a programming environment. -GDB is an interactive tool. Although a batch mode is available, GDB's +@value{GDBN} is an interactive tool. Although a batch mode is available, @value{GDBN}'s primary role is to interact with a human programmer. -GDB should be responsive to the user. A programmer hot on the trail of +@value{GDBN} should be responsive to the user. A programmer hot on the trail of a nasty bug, and operating under a looming deadline, is going to be very impatient of everything, including the response time to debugger commands. -GDB should be relatively permissive, such as for expressions. While the +@value{GDBN} should be relatively permissive, such as for expressions. While the compiler should be picky (or have the option to be made picky), since source code lives for a long time usually, the programmer doing debugging shouldn't be spending time figuring out to mollify the debugger. -GDB will be called upon to deal with really large programs. Executable +@value{GDBN} will be called upon to deal with really large programs. Executable sizes of 50 to 100 megabytes occur regularly, and we've heard reports of programs approaching 1 gigabyte in size. -GDB should be able to run everywhere. No other debugger is available -for even half as many configurations as GDB supports. +@value{GDBN} should be able to run everywhere. No other debugger is available +for even half as many configurations as @value{GDBN} supports. @node Overall Structure @chapter Overall Structure -GDB consists of three major subsystems: user interface, symbol handling +@value{GDBN} consists of three major subsystems: user interface, symbol handling (the ``symbol side''), and target system handling (the ``target side''). Ther user interface consists of several actual interfaces, plus @@ -151,26 +156,26 @@ should fit together. @section The Symbol Side -The symbolic side of GDB can be thought of as ``everything you can do in -GDB without having a live program running''. For instance, you can look +The symbolic side of @value{GDBN} can be thought of as ``everything you can do in +@value{GDBN} without having a live program running''. For instance, you can look at the types of variables, and evaluate many kinds of expressions. @section The Target Side -The target side of GDB is the ``bits and bytes manipulator''. Although +The target side of @value{GDBN} is the ``bits and bytes manipulator''. Although it may make reference to symbolic info here and there, most of the target side will run with only a stripped executable available -- or even no executable at all, in remote debugging cases. Operations such as disassembly, stack frame crawls, and register display, are able to work with no symbolic info at all. In some cases, -such as disassembly, GDB will use symbolic info to present addresses +such as disassembly, @value{GDBN} will use symbolic info to present addresses relative to symbols rather than as raw numbers, but it will work either way. @section Configurations -@dfn{Host} refers to attributes of the system where GDB runs. +@dfn{Host} refers to attributes of the system where @value{GDBN} runs. @dfn{Target} refers to the system where the program being debugged executes. In most cases they are the same machine, in which case a third type of @dfn{Native} attributes come into play. @@ -196,7 +201,7 @@ are really part of the target environment, but which require @code{#include} files that are only available on the host system. Core file handling and @code{setjmp} handling are two common cases. -When you want to make GDB work ``native'' on a particular machine, you +When you want to make @value{GDBN} work ``native'' on a particular machine, you have to include all three kinds of information. @@ -204,18 +209,18 @@ have to include all three kinds of information. @chapter Algorithms -GDB uses a number of debugging-specific algorithms. They are often not +@value{GDBN} uses a number of debugging-specific algorithms. They are often not very complicated, but get lost in the thicket of special cases and real-world issues. This chapter describes the basic algorithms and mentions some of the specific target definitions that they use. @section Frames -A frame is a construct that GDB uses to keep track of calling and called +A frame is a construct that @value{GDBN} uses to keep track of calling and called functions. @code{FRAME_FP} in the machine description has no meaning to the -machine-independent part of GDB, except that it is used when setting up +machine-independent part of @value{GDBN}, except that it is used when setting up a new frame from scratch, as follows: @example @@ -229,8 +234,8 @@ any value that is convenient for the code that creates new frames. defined; that is where you should use the @code{FP_REGNUM} value, if your frames are nonstandard.) -Given a GDB frame, define @code{FRAME_CHAIN} to determine the address of -the calling function's frame. This will be used to create a new GDB +Given a @value{GDBN} frame, define @code{FRAME_CHAIN} to determine the address of +the calling function's frame. This will be used to create a new @value{GDBN} frame struct, and then @code{INIT_EXTRA_FRAME_INFO} and @code{INIT_FRAME_PC} will be called for the new frame. @@ -247,25 +252,25 @@ Hardware breakpoints are sometimes available as a builtin debugging features with some chips. Typically these work by having dedicated register into which the breakpoint address may be stored. If the PC ever matches a value in a breakpoint registers, the CPU raises an -exception and reports it to GDB. Another possibility is when an +exception and reports it to @value{GDBN}. Another possibility is when an emulator is in use; many emulators include circuitry that watches the address lines coming out from the processor, and force it to stop if the address matches a breakpoint's address. A third possibility is that the target already has the ability to do breakpoints somehow; for instance, a ROM monitor may do its own software breakpoints. So although these -are not literally ``hardware breakpoints'', from GDB's point of view -they work the same; GDB need not do nothing more than set the breakpoint +are not literally ``hardware breakpoints'', from @value{GDBN}'s point of view +they work the same; @value{GDBN} need not do nothing more than set the breakpoint and wait for something to happen. Since they depend on hardware resources, hardware breakpoints may be -limited in number; when the user asks for more, GDB will start trying to +limited in number; when the user asks for more, @value{GDBN} will start trying to set software breakpoints. -Software breakpoints require GDB to do somewhat more work. The basic -theory is that GDB will replace a program instruction with a trap, +Software breakpoints require @value{GDBN} to do somewhat more work. The basic +theory is that @value{GDBN} will replace a program instruction with a trap, illegal divide, or some other instruction that will cause an exception, -and then when it's encountered, GDB will take the exception and stop the -program. When the user says to continue, GDB will restore the original +and then when it's encountered, @value{GDBN} will take the exception and stop the +program. When the user says to continue, @value{GDBN} will restore the original instruction, single-step, re-insert the trap, and continue on. Since it literally overwrites the program being tested, the program area @@ -300,7 +305,7 @@ much of the interesting breakpoint action is in @file{infrun.c}. @section Longjmp Support -GDB has support for figuring out that the target is doing a +@value{GDBN} has support for figuring out that the target is doing a @code{longjmp} and for stopping at the target of the jump, if we are stepping. This is done with a few specialized internal breakpoints, which are visible in the @code{maint info breakpoint} command. @@ -316,12 +321,12 @@ is target specific, you will need to define it in the appropriate @chapter User Interface -GDB has several user interfaces. Although the command-line interface +@value{GDBN} has several user interfaces. Although the command-line interface is the most common and most familiar, there are others. @section Command Interpreter -The command interpreter in GDB is fairly simple. It is designed to +The command interpreter in @value{GDBN} is fairly simple. It is designed to allow for the set of commands to be augmented dynamically, and also has a recursive subcommand capability, where the first argument to a command may itself direct a lookup on a different command list. @@ -354,19 +359,19 @@ entire string the user should type at the command line. @section libgdb @code{libgdb} was an abortive project of years ago. The theory was to -provide an API to GDB's functionality. +provide an API to @value{GDBN}'s functionality. @node Symbol Handling @chapter Symbol Handling -Symbols are a key part of GDB's operation. Symbols include variables, +Symbols are a key part of @value{GDBN}'s operation. Symbols include variables, functions, and types. @section Symbol Reading -GDB reads symbols from ``symbol files''. The usual symbol file is the -file containing the program which GDB is debugging. GDB can be directed +@value{GDBN} reads symbols from ``symbol files''. The usual symbol file is the +file containing the program which @value{GDBN} is debugging. @value{GDBN} can be directed to use a different file for symbols (with the @code{symbol-file} command), and it can also read more symbols via the ``add-file'' and ``load'' commands, or while reading symbols from shared libraries. @@ -376,7 +381,7 @@ BFD library. BFD identifies the type of the file by examining its header. @code{find_sym_fns} then uses this identification to locate a set of symbol-reading functions. -Symbol reading modules identify themselves to GDB by calling +Symbol reading modules identify themselves to @value{GDBN} by calling @code{add_symtab_fns} during their module initialization. The argument to @code{add_symtab_fns} is a @code{struct sym_fns} which contains the name (or name prefix) of the symbol format, the length of the prefix, @@ -410,7 +415,7 @@ There is no result from @code{@var{xyz}_symfile_init}, but it can call Called from @code{symbol_file_add} when discarding existing symbols. This function need only handle the symbol-reading module's internal -state; the symbol table data structures visible to the rest of GDB will +state; the symbol table data structures visible to the rest of @value{GDBN} will be discarded by @code{symbol_file_add}. It has no arguments and no result. It may be called after @code{@var{xyz}_symfile_init}, if a new symbol table is being read, or may be called alone if all symbols are @@ -432,7 +437,7 @@ or dynamically loaded file) is being read.@refill In addition, if a symbol-reading module creates psymtabs when @var{xyz}_symfile_read is called, these psymtabs will contain a pointer to a function @code{@var{xyz}_psymtab_to_symtab}, which can be called -from any point in the GDB symbol-handling code. +from any point in the @value{GDBN} symbol-handling code. @table @code @item @var{xyz}_psymtab_to_symtab (struct partial_symtab *pst) @@ -447,7 +452,7 @@ zero if there were no symbols in that part of the symbol file. @section Partial Symbol Tables -GDB has three types of symbol tables. +@value{GDBN} has three types of symbol tables. @itemize @bullet @@ -469,7 +474,7 @@ A psymtab is constructed by doing a very quick pass over an executable file's debugging information. Small amounts of information are extracted -- enough to identify which parts of the symbol table will need to be re-read and fully digested later, when the user needs the -information. The speed of this pass causes GDB to start up very +information. The speed of this pass causes @value{GDBN} to start up very quickly. Later, as the detailed rereading occurs, it occurs in small pieces, at various times, and the delay therefrom is mostly invisible to the user. @@ -515,7 +520,7 @@ them anyway. Psymtabs don't have the idea of the type of a symbol, either, so types need not appear, unless they will be referenced by name. -It is a bug for GDB to behave one way when only a psymtab has been read, +It is a bug for @value{GDBN} to behave one way when only a psymtab has been read, and another way if the corresponding symtab has been read in. Such bugs are typically caused by a psymtab that does not contain all the visible symbols, or which has the wrong instruction address ranges. @@ -532,14 +537,14 @@ unless you want to do a lot more work. Fundamental Types (e.g., FT_VOID, FT_BOOLEAN). -These are the fundamental types that GDB uses internally. Fundamental +These are the fundamental types that @value{GDBN} uses internally. Fundamental types from the various debugging formats (stabs, ELF, etc) are mapped into one of these. They are basically a union of all fundamental types -that gdb knows about for all the languages that GDB knows about. +that gdb knows about for all the languages that @value{GDBN} knows about. Type Codes (e.g., TYPE_CODE_PTR, TYPE_CODE_ARRAY). -Each time GDB builds an internal type, it marks it with one of these +Each time @value{GDBN} builds an internal type, it marks it with one of these types. The type may be a fundamental type, such as TYPE_CODE_INT, or a derived type, such as TYPE_CODE_PTR which is a pointer to another type. Typically, several FT_* types map to one TYPE_CODE_* type, and are @@ -549,7 +554,7 @@ type is signed or unsigned, and how many bits it uses. Builtin Types (e.g., builtin_type_void, builtin_type_char). These are instances of type structs that roughly correspond to -fundamental types and are created as global types for GDB to use for +fundamental types and are created as global types for @value{GDBN} to use for various ugly historical reasons. We eventually want to eliminate these. Note for example that builtin_type_int initialized in gdbtypes.c is basically the same as a TYPE_CODE_INT type that is initialized in @@ -614,7 +619,7 @@ been run (or the core file has been read). Windows 95 and NT use the PE (Portable Executable) format for their executables. PE is basically COFF with additional headers. -While BFD includes special PE support, GDB needs only the basic +While BFD includes special PE support, @value{GDBN} needs only the basic COFF reader. @subsection ELF @@ -634,7 +639,7 @@ The SOM reader is in @file{hpread.c}. @subsection Other File Formats -Other file formats that have been supported by GDB include Netware +Other file formats that have been supported by @value{GDBN} include Netware Loadable Modules (@file{nlmread.c}. @section Debugging File Formats @@ -687,7 +692,7 @@ The DWARF 2 reader is in @file{dwarf2read.c}. Like COFF, the SOM definition includes debugging information. -@section Adding a New Symbol Reader to GDB +@section Adding a New Symbol Reader to @value{GDBN} If you are using an existing object file format (a.out, COFF, ELF, etc), there is probably little to be done. @@ -696,9 +701,9 @@ If you need to add a new object file format, you must first add it to BFD. This is beyond the scope of this document. You must then arrange for the BFD code to provide access to the -debugging symbols. Generally GDB will have to call swapping routines +debugging symbols. Generally @value{GDBN} will have to call swapping routines from BFD and a few other BFD internal routines to locate the debugging -information. As much as possible, GDB should not depend on the BFD +information. As much as possible, @value{GDBN} should not depend on the BFD internal data structures. For some targets (e.g., COFF), there is a special transfer vector used @@ -706,24 +711,24 @@ to call swapping routines, since the external data structures on various platforms have different sizes and layouts. Specialized routines that will only ever be implemented by one object file format may be called directly. This interface should be described in a file -@file{bfd/libxyz.h}, which is included by GDB. +@file{bfd/libxyz.h}, which is included by @value{GDBN}. @node Language Support @chapter Language Support -GDB's language support is mainly driven by the symbol reader, although +@value{GDBN}'s language support is mainly driven by the symbol reader, although it is possible for the user to set the source language manually. -GDB chooses the source language by looking at the extension of the file +@value{GDBN} chooses the source language by looking at the extension of the file recorded in the debug info; @code{.c} means C, @code{.f} means Fortran, etc. It may also use a special-purpose language identifier if the debug format supports it, such as DWARF. -@section Adding a Source Language to GDB +@section Adding a Source Language to @value{GDBN} -To add other languages to GDB's expression parser, follow the following +To add other languages to @value{GDBN}'s expression parser, follow the following steps: @table @emph @@ -760,7 +765,7 @@ various parsers from defining the same global names: At the bottom of your parser, define a @code{struct language_defn} and initialize it with the right values for your language. Define an @code{initialize_@var{lang}} routine and have it call -@samp{add_language(@var{lang}_language_defn)} to tell the rest of GDB +@samp{add_language(@var{lang}_language_defn)} to tell the rest of @value{GDBN} that your language exists. You'll need some other supporting variables and functions, which will be used via pointers from your @code{@var{lang}_language_defn}. See the declaration of @code{struct @@ -793,7 +798,7 @@ string. Update the function @code{_initialize_language} to include your language. This function picks the default language upon startup, so is -dependent upon which languages that GDB is built for. +dependent upon which languages that @value{GDBN} is built for. Update @code{allocate_symtab} in @file{symfile.c} and/or symbol-reading code so that the language of each symtab (source file) is set properly. @@ -814,18 +819,18 @@ Add a call to @code{@var{lang}_parse()} and @code{@var{lang}_error} in @item Use macros to trim code -The user has the option of building GDB for some or all of the -languages. If the user decides to build GDB for the language +The user has the option of building @value{GDBN} for some or all of the +languages. If the user decides to build @value{GDBN} for the language @var{lang}, then every file dependent on @file{language.h} will have the macro @code{_LANG_@var{lang}} defined in it. Use @code{#ifdef}s to leave out large routines that the user won't need if he or she is not using your language. -Note that you do not need to do this in your YACC parser, since if GDB +Note that you do not need to do this in your YACC parser, since if @value{GDBN} is not build for @var{lang}, then @file{@var{lang}-exp.tab.o} (the -compiled form of your parser) is not linked into GDB at all. +compiled form of your parser) is not linked into @value{GDBN} at all. -See the file @file{configure.in} for how GDB is configured for different +See the file @file{configure.in} for how @value{GDBN} is configured for different languages. @item Edit @file{Makefile.in} @@ -847,12 +852,12 @@ definition machinery anymore. @section Adding a New Host -Most of GDB's host configuration support happens via autoconf. It -should be rare to need new host-specific definitions. GDB still uses +Most of @value{GDBN}'s host configuration support happens via autoconf. It +should be rare to need new host-specific definitions. @value{GDBN} still uses the host-specific definitions and files listed below, but these mostly exist for historical reasons, and should eventually disappear. -Several files control GDB's configuration for host systems: +Several files control @value{GDBN}'s configuration for host systems: @table @file @@ -909,7 +914,7 @@ This contains generic TCP support using sockets. @section Host Conditionals -When GDB is configured and compiled, various macros are defined or left +When @value{GDBN} is configured and compiled, various macros are defined or left undefined, to control compilation based on the attributes of the host system. These macros and their meanings (or if the meaning is not documented here, then one of the source files where they are used is @@ -917,8 +922,8 @@ indicated) are: @table @code -@item GDBINIT_FILENAME -The default name of GDB's initialization file (normally @file{.gdbinit}). +@item @value{GDBN}INIT_FILENAME +The default name of @value{GDBN}'s initialization file (normally @file{.gdbinit}). @item MEM_FNS_DECLARED Your host config file defines this if it includes declarations of @@ -1065,7 +1070,7 @@ Define this to 1 if the target is using the generic inferior function call code. See @code{blockframe.c} for more information. @item USE_MMALLOC -GDB will use the @code{mmalloc} library for memory allocation for symbol +@value{GDBN} will use the @code{mmalloc} library for memory allocation for symbol reading if this symbol is defined. Be careful defining it since there are systems on which @code{mmalloc} does not work for some reason. One example is the DECstation, where its RPC library can't cope with our @@ -1105,7 +1110,7 @@ Define these to appropriate value for the system lseek(), if not already defined. @item STOP_SIGNAL -This is the signal for stopping GDB. Defaults to SIGTSTP. (Only +This is the signal for stopping @value{GDBN}. Defaults to SIGTSTP. (Only redefined for the Convex.) @item USE_O_NOCTTY @@ -1133,25 +1138,186 @@ Define this to override the defaults of @code{__volatile__} or @chapter Target Architecture Definition -GDB's target architecture defines what sort of machine-language programs -GDB can work with, and how it works with them. +@value{GDBN}'s target architecture defines what sort of machine-language programs +@value{GDBN} can work with, and how it works with them. At present, the target architecture definition consists of a number of C macros. @section Registers and Memory -GDB's model of the target machine is rather simple. GDB assumes the +@value{GDBN}'s model of the target machine is rather simple. @value{GDBN} assumes the machine includes a bank of registers and a block of memory. Each register may have a different size. -GDB does not have a magical way to match up with the compiler's idea of +@value{GDBN} does not have a magical way to match up with the compiler's idea of which registers are which; however, it is critical that they do match up accurately. The only way to make this work is to get accurate information about the order that the compiler uses, and to reflect that in the @code{REGISTER_NAME} and related macros. -GDB can handle big-endian, little-endian, and bi-endian architectures. +@value{GDBN} can handle big-endian, little-endian, and bi-endian architectures. + +@section Pointers Are Not Always Addresses +@cindex pointer representation +@cindex address representation +@cindex word-addressed machines +@cindex separate data and code address spaces +@cindex spaces, separate data and code address +@cindex address spaces, separate data and code +@cindex code pointers, word-addressed +@cindex converting between pointers and addresses +@cindex D10V addresses + +On almost all 32-bit architectures, the representation of a pointer is +indistinguishable from the representation of some fixed-length number +whose value is the byte address of the object pointed to. On such +machines, the words `pointer' and `address' can be used interchangeably. +However, architectures with smaller word sizes are often cramped for +address space, so they may choose a pointer representation that breaks this +identity, and allows a larger code address space. + +For example, the Mitsubishi D10V is a 16-bit VLIW processor whose +instructions are 32 bits long@footnote{Some D10V instructions are +actually pairs of 16-bit sub-instructions. However, since you can't +jump into the middle of such a pair, code addresses can only refer to +full 32 bit instructions, which is what matters in this explanation.}. +If the D10V used ordinary byte addresses to refer to code locations, +then the processor would only be able to address 64kb of instructions. +However, since instructions must be aligned on four-byte boundaries, the +low two bits of any valid instruction's byte address are always zero --- +byte addresses waste two bits. So instead of byte addresses, the D10V +uses word addresses --- byte addresses shifted right two bits --- to +refer to code. Thus, the D10V can use 16-bit words to address 256kb of +code space. + +However, this means that code pointers and data pointers have different +forms on the D10V. The 16-bit word @code{0xC020} refers to byte address +@code{0xC020} when used as a data address, but refers to byte address +@code{0x30080} when used as a code address. + +(The D10V also uses separate code and data address spaces, which also +affects the correspondence between pointers and addresses, but we're +going to ignore that here; this example is already too long.) + +To cope with architectures like this --- the D10V is not the only one! +--- @value{GDBN} tries to distinguish between @dfn{addresses}, which are +byte numbers, and @dfn{pointers}, which are the target's representation +of an address of a particular type of data. In the example above, +@code{0xC020} is the pointer, which refers to one of the addresses +@code{0xC020} or @code{0x30080}, depending on the type imposed upon it. +@value{GDBN} provides functions for turning a pointer into an address +and vice versa, in the appropriate way for the current architecture. + +Unfortunately, since addresses and pointers are identical on almost all +processors, this distinction tends to bit-rot pretty quickly. Thus, +each time you port @value{GDBN} to an architecture which does +distinguish between pointers and addresses, you'll probably need to +clean up some architecture-independent code. + +Here are functions which convert between pointers and addresses: + +@deftypefun CORE_ADDR extract_typed_address (void *@var{buf}, struct type *@var{type}) +Treat the bytes at @var{buf} as a pointer or reference of type +@var{type}, and return the address it represents, in a manner +appropriate for the current architecture. This yields an address +@value{GDBN} can use to read target memory, disassemble, etc. Note that +@var{buf} refers to a buffer in @value{GDBN}'s memory, not the +inferior's. + +For example, if the current architecture is the Intel x86, this function +extracts a little-endian integer of the appropriate length from +@var{buf} and returns it. However, if the current architecture is the +D10V, this function will return a 16-bit integer extracted from +@var{buf}, multiplied by four if @var{type} is a pointer to a function. + +If @var{type} is not a pointer or reference type, then this function +will signal an internal error. +@end deftypefun + +@deftypefun CORE_ADDR store_typed_address (void *@var{buf}, struct type *@var{type}, CORE_ADDR @var{addr}) +Store the address @var{addr} in @var{buf}, in the proper format for a +pointer of type @var{type} in the current architecture. Note that +@var{buf} refers to a buffer in @value{GDBN}'s memory, not the +inferior's. + +For example, if the current architecture is the Intel x86, this function +stores @var{addr} unmodified as a little-endian integer of the +appropriate length in @var{buf}. However, if the current architecture +is the D10V, this function divides @var{addr} by four if @var{type} is +a pointer to a function, and then stores it in @var{buf}. + +If @var{type} is not a pointer or reference type, then this function +will signal an internal error. +@end deftypefun + +@deftypefun CORE_ADDR value_as_pointer (value_ptr @var{val}) +Assuming that @var{val} is a pointer, return the address it represents, +as appropriate for the current architecture. + +This function actually works on integral values, as well as pointers. +For pointers, it performs architecture-specific conversions as +described above for @code{extract_typed_address}. +@end deftypefun + +@deftypefun CORE_ADDR value_from_pointer (struct type *@var{type}, CORE_ADDR @var{addr}) +Create and return a value representing a pointer of type @var{type} to +the address @var{addr}, as appropriate for the current architecture. +This function performs architecture-specific conversions as described +above for @code{store_typed_address}. +@end deftypefun + + +@value{GDBN} also provides functions that do the same tasks, but assume +that pointers are simply byte addresses; they aren't sensitive to the +current architecture, beyond knowing the appropriate endianness. + +@deftypefun CORE_ADDR extract_address (void *@var{addr}, int len) +Extract a @var{len}-byte number from @var{addr} in the appropriate +endianness for the current architecture, and return it. Note that +@var{addr} refers to @value{GDBN}'s memory, not the inferior's. + +This function should only be used in architecture-specific code; it +doesn't have enough information to turn bits into a true address in the +appropriate way for the current architecture. If you can, use +@code{extract_typed_address} instead. +@end deftypefun + +@deftypefun void store_address (void *@var{addr}, int @var{len}, LONGEST @var{val}) +Store @var{val} at @var{addr} as a @var{len}-byte integer, in the +appropriate endianness for the current architecture. Note that +@var{addr} refers to a buffer in @value{GDBN}'s memory, not the +inferior's. + +This function should only be used in architecture-specific code; it +doesn't have enough information to turn a true address into bits in the +appropriate way for the current architecture. If you can, use +@code{store_typed_address} instead. +@end deftypefun + + +Here are some macros which architectures can define to indicate the +relationship between pointers and addresses. These have default +definitions, appropriate for architectures on which all pointers are +simple byte addresses. + +@deftypefn {Target Macro} CORE_ADDR POINTER_TO_ADDRESS (struct type *@var{type}, char *@var{buf}) +Assume that @var{buf} holds a pointer of type @var{type}, in the +appropriate format for the current architecture. Return the byte +address the pointer refers to. + +This function may safely assume that @var{type} is either a pointer or a +C++ reference type. +@end deftypefn + +@deftypefn {Target Macro} void ADDRESS_TO_POINTER (struct type *@var{type}, char *@var{buf}, CORE_ADDR @var{addr}) +Store in @var{buf} a pointer of type @var{type} representing the address +@var{addr}, in the appropriate format for the current architecture. + +This function may safely assume that @var{type} is either a pointer or a +C++ reference type. +@end deftypefn + @section Using Different Register and Memory Data Representations @cindex raw representation @@ -1162,9 +1328,9 @@ GDB can handle big-endian, little-endian, and bi-endian architectures. Some architectures use one representation for a value when it lives in a register, but use a different representation when it lives in memory. -In GDB's terminology, the @dfn{raw} representation is the one used in +In @value{GDBN}'s terminology, the @dfn{raw} representation is the one used in the target registers, and the @dfn{virtual} representation is the one -used in memory, and within GDB @code{struct value} objects. +used in memory, and within @value{GDBN} @code{struct value} objects. For almost all data types on almost all architectures, the virtual and raw representations are identical, and no special handling is needed. @@ -1182,8 +1348,8 @@ type is the raw representation, and the twelve-byte loosely-packed arrangement is the virtual representation. @item -Some 64-bit MIPS targets present 32-bit registers to GDB as 64-bit -registers, with garbage in their upper bits. GDB ignores the top 32 +Some 64-bit MIPS targets present 32-bit registers to @value{GDBN} as 64-bit +registers, with garbage in their upper bits. @value{GDBN} ignores the top 32 bits. Thus, the 64-bit form, with garbage in the upper 32 bits, is the raw representation, and the trimmed 32-bit representation is the virtual representation. @@ -1191,9 +1357,9 @@ virtual representation. @end itemize In general, the raw representation is determined by the architecture, or -GDB's interface to the architecture, while the virtual representation -can be chosen for GDB's convenience. GDB's register file, -@code{registers}, holds the register contents in raw format, and the GDB +@value{GDBN}'s interface to the architecture, while the virtual representation +can be chosen for @value{GDBN}'s convenience. @value{GDBN}'s register file, +@code{registers}, holds the register contents in raw format, and the @value{GDBN} remote protocol transmits register values in raw format. Your architecture may define the following macros to request raw / @@ -1206,7 +1372,7 @@ and virtual formats. @deftypefn {Target Macro} int REGISTER_RAW_SIZE (int @var{reg}) The size of register number @var{reg}'s raw value. This is the number -of bytes the register will occupy in @code{registers}, or in a GDB +of bytes the register will occupy in @code{registers}, or in a @value{GDBN} remote protocol packet. @end deftypefn @@ -1219,7 +1385,7 @@ register's value. @deftypefn {Target Macro} struct type *REGISTER_VIRTUAL_TYPE (int @var{reg}) This is the type of the virtual representation of register number @var{reg}. Note that there is no need for a macro giving a type for the -register's raw form; once the register's value has been obtained, GDB +register's raw form; once the register's value has been obtained, @value{GDBN} always uses the virtual form. @end deftypefn @@ -1262,7 +1428,7 @@ machine. @item ADDITIONAL_OPTION_HANDLER @item ADDITIONAL_OPTION_HELP These are a set of macros that allow the addition of additional command -line options to GDB. They are currently used only for the unsupported +line options to @value{GDBN}. They are currently used only for the unsupported i960 Nindy target, and should not be used in any other configuration. @item ADDR_BITS_REMOVE (addr) @@ -1278,12 +1444,19 @@ boundaries, the processor masks out these bits to generate the actual address of the instruction. ADDR_BITS_REMOVE should filter out these bits with an expression such as @code{((addr) & ~3)}. +@item ADDRESS_TO_POINTER (@var{type}, @var{buf}, @var{addr}) +Store in @var{buf} a pointer of type @var{type} representing the address +@var{addr}, in the appropriate format for the current architecture. +This macro may safely assume that @var{type} is either a pointer or a +C++ reference type. +@xref{Target Architecture Definition, , Pointers Are Not Always Addresses}. + @item BEFORE_MAIN_LOOP_HOOK Define this to expand into any code that you want to execute before the main loop starts. Although this is not, strictly speaking, a target conditional, that is how it is currently being used. Note that if a configuration were to define it one way for a host and a different way -for the target, GDB will probably not compile, let alone run correctly. +for the target, @value{GDBN} will probably not compile, let alone run correctly. This is currently used only for the unsupported i960 Nindy target, and should not be used in any other configuration. @@ -1293,7 +1466,7 @@ still reports the parameter as its original type, rather than the promoted type. @item BELIEVE_PCC_PROMOTION_TYPE -Define this if GDB should believe the type of a short argument when +Define this if @value{GDBN} should believe the type of a short argument when compiled by pcc, but look within a full int space to get its value. Only defined for Sun-3 at present. @@ -1400,7 +1573,7 @@ from an inferior process. This is only relevant if @item CANNOT_STORE_REGISTER (regno) A C expression that should be nonzero if @var{regno} should not be written to the target. This is often the case for program counters, -status words, and other special registers. If this is not defined, GDB +status words, and other special registers. If this is not defined, @value{GDBN} will assume that all registers may be written. @item DO_DEFERRED_STORES @@ -1428,7 +1601,7 @@ The default behavior is to promote only when we have no type information for the formal parameter. This is different from the obvious behavior, which would be to promote whenever we have no prototype, just as the compiler does. It's annoying, but some older targets rely on this. If -you want GDB to follow the typical compiler behavior --- to always +you want @value{GDBN} to follow the typical compiler behavior --- to always promote when there is no prototype in scope --- your gdbarch init function can call @code{set_gdbarch_coerce_float_to_double} and select the @code{standard_coerce_float_to_double} function. @@ -1559,21 +1732,21 @@ be 2 on the VAX. @item GCC_COMPILED_FLAG_SYMBOL @item GCC2_COMPILED_FLAG_SYMBOL -If defined, these are the names of the symbols that GDB will look for to +If defined, these are the names of the symbols that @value{GDBN} will look for to detect that GCC compiled the file. The default symbols are @code{gcc_compiled.} and @code{gcc2_compiled.}, respectively. (Currently only defined for the Delta 68.) -@item GDB_MULTI_ARCH +@item @value{GDBN}_MULTI_ARCH If defined and non-zero, enables suport for multiple architectures -within GDB. +within @value{GDBN}. The support can be enabled at two levels. At level one, only definitions for previously undefined macros are provided; at level two, a multi-arch definition of all architecture dependant macros will be defined. -@item GDB_TARGET_IS_HPPA +@item @value{GDBN}_TARGET_IS_HPPA This determines whether horrible kludge code in dbxread.c and partial-stab.h is used to mangle multiple-symbol-table files from HPPA's. This should all be ripped out, and a scheme like elfread.c @@ -1607,7 +1780,7 @@ repenting at leisure. @item SYMBOLS_CAN_START_WITH_DOLLAR Some systems have routines whose names start with @samp{$}. Giving this -macro a non-zero value tells GDB's expression parser to check for such +macro a non-zero value tells @value{GDBN}'s expression parser to check for such routines when parsing tokens that begin with @samp{$}. On HP-UX, certain system routines (millicode) have names beginning with @@ -1665,39 +1838,84 @@ stepping will suffice. @item IS_TRAPPED_INTERNALVAR (name) This is an ugly hook to allow the specification of special actions that should occur as a side-effect of setting the value of a variable -internal to GDB. Currently only used by the h8500. Note that this +internal to @value{GDBN}. Currently only used by the h8500. Note that this could be either a host or target conditional. @item NEED_TEXT_START_END -Define this if GDB should determine the start and end addresses of the +Define this if @value{GDBN} should determine the start and end addresses of the text section. (Seems dubious.) @item NO_HIF_SUPPORT (Specific to the a29k.) +@item POINTER_TO_ADDRESS (@var{type}, @var{buf}) +Assume that @var{buf} holds a pointer of type @var{type}, in the +appropriate format for the current architecture. Return the byte +address the pointer refers to. +@xref{Target Architecture Definition, , Pointers Are Not Always Addresses}. + @item REGISTER_CONVERTIBLE (@var{reg}) Return non-zero if @var{reg} uses different raw and virtual formats. -@xref{Using Different Target and Host Data Representations}. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. @item REGISTER_RAW_SIZE (@var{reg}) Return the raw size of @var{reg}. -@xref{Using Different Target and Host Data Representations}. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. @item REGISTER_VIRTUAL_SIZE (@var{reg}) Return the virtual size of @var{reg}. -@xref{Using Different Target and Host Data Representations}. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. @item REGISTER_VIRTUAL_TYPE (@var{reg}) Return the virtual type of @var{reg}. -@xref{Using Different Target and Host Data Representations}. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. @item REGISTER_CONVERT_TO_VIRTUAL(@var{reg}, @var{type}, @var{from}, @var{to}) Convert the value of register @var{reg} from its raw form to its virtual -form. @xref{Using Different Target and Host Data Representations}. +form. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. @item REGISTER_CONVERT_TO_RAW(@var{type}, @var{reg}, @var{from}, @var{to}) Convert the value of register @var{reg} from its virtual form to its raw -form. @xref{Using Different Target and Host Data Representations}. +form. +@xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}. + +@item RETURN_VALUE_ON_STACK(@var{type}) +@findex RETURN_VALUE_ON_STACK +@cindex returning structures by value +@cindex structures, returning by value + +Return non-zero if values of type TYPE are returned on the stack, using +the ``struct convention'' (i.e., the caller provides a pointer to a +buffer in which the callee should store the return value). This +controls how the @samp{finish} command finds a function's return value, +and whether an inferior function call reserves space on the stack for +the return value. + +The full logic @value{GDBN} uses here is kind of odd. +@itemize @bullet + +@item +If the type being returned by value is not a structure, union, or array, +and @code{RETURN_VALUE_ON_STACK} returns zero, then @value{GDBN} +concludes the value is not returned using the struct convention. + +@item +Otherwise, @value{GDBN} calls @code{USE_STRUCT_CONVENTION} (see below). +If that returns non-zero, @value{GDBN} assumes the struct convention is +in use. + +@end itemize + +In other words, to indicate that a given type is returned by value using +the struct convention, that type must be either a struct, union, array, +or something @code{RETURN_VALUE_ON_STACK} likes, @emph{and} something +that @code{USE_STRUCT_CONVENTION} likes. + +Note that, in C and C++, arrays are never returned by value. In those +languages, these predicates will always see a pointer type, never an +array type. All the references above to arrays being returned by value +apply only to other languages. @item SOFTWARE_SINGLE_STEP_P Define this as 1 if the target does not have a hardware single-step @@ -1800,7 +2018,7 @@ call. Return the updated stack pointer value. Used in @samp{call_function_by_hand} to create an artificial stack frame. @item REGISTER_BYTES -The total amount of space needed to store GDB's copy of the machine's +The total amount of space needed to store @value{GDBN}'s copy of the machine's register state. @item REGISTER_NAME(i) @@ -1821,14 +2039,14 @@ This is the value of the @var{SP} after both the dummy frame and space for parameters/results have been allocated on the stack. @item SDB_REG_TO_REGNUM -Define this to convert sdb register numbers into GDB regnums. If not +Define this to convert sdb register numbers into @value{GDBN} regnums. If not defined, no conversion will be done. @item SHIFT_INST_REGS (Only used for m88k targets.) @item SKIP_PERMANENT_BREAKPOINT -Advance the inferior's PC past a permanent breakpoint. GDB normally +Advance the inferior's PC past a permanent breakpoint. @value{GDBN} normally steps over a breakpoint by removing it, stepping one instruction, and re-inserting the breakpoint. However, permanent breakpoints are hardwired into the inferior, and can't be removed, so this strategy @@ -1860,7 +2078,7 @@ This should only need to be defined if @code{TARGET_WRITE_SP} and @item STAB_REG_TO_REGNUM Define this to convert stab register numbers (as gotten from `r' -declarations) into GDB regnums. If not defined, no conversion will be +declarations) into @value{GDBN} regnums. If not defined, no conversion will be done. @item STACK_ALIGN (addr) @@ -1870,7 +2088,7 @@ processor's stack. @item STEP_SKIPS_DELAY (addr) Define this to return true if the address is of an instruction with a delay slot. If a breakpoint has been placed in the instruction's delay -slot, GDB will single-step over that instruction before resuming +slot, @value{GDBN} will single-step over that instruction before resuming normally. Currently only defined for the Mips. @item STORE_RETURN_VALUE (type, valbuf) @@ -1940,7 +2158,7 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}. @item TARGET_WRITE_FP These change the behavior of @code{read_pc}, @code{write_pc}, @code{read_sp}, @code{write_sp}, @code{read_fp} and @code{write_fp}. -For most targets, these may be left undefined. GDB will call the read +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 @@ -1965,7 +2183,7 @@ other compilers. For dbx-style debugging information, if the compiler puts variable declarations inside LBRAC/RBRAC blocks, this should be defined to be nonzero. @var{desc} is the value of @code{n_desc} from the -@code{N_RBRAC} symbol, and @var{gcc_p} is true if GDB has noticed the +@code{N_RBRAC} symbol, and @var{gcc_p} is true if @value{GDBN} has noticed the presence of either the @code{GCC_COMPILED_SYMBOL} or the @code{GCC2_COMPILED_SYMBOL}. By default, this is 0. @@ -1989,7 +2207,7 @@ Defaults to @code{1}. @section Adding a New Target -The following files define a target to GDB: +The following files define a target to @value{GDBN}: @table @file @@ -2002,7 +2220,7 @@ tm-@var{ttt}.h}. You can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS}, but these are now deprecated, replaced by autoconf, and may go away in -future versions of GDB. +future versions of @value{GDBN}. @item gdb/config/@var{arch}/tm-@var{ttt}.h (@file{tm.h} is a link to this file, created by configure). Contains @@ -2041,10 +2259,10 @@ that just @code{#include}s @file{tm-@var{arch}.h} and @chapter Target Vector Definition -The target vector defines the interface between GDB's abstract handling +The target vector defines the interface between @value{GDBN}'s abstract handling of target systems, and the nitty-gritty code that actually exercises -control over a process or a serial port. GDB includes some 30-40 -different target vectors; however, each configuration of GDB includes +control over a process or a serial port. @value{GDBN} includes some 30-40 +different target vectors; however, each configuration of @value{GDBN} includes only a few of them. @section File Targets @@ -2053,12 +2271,12 @@ Both executables and core files have target vectors. @section Standard Protocol and Remote Stubs -GDB's file @file{remote.c} talks a serial protocol to code that runs in -the target system. GDB provides several sample ``stubs'' that can be +@value{GDBN}'s file @file{remote.c} talks a serial protocol to code that runs in +the target system. @value{GDBN} provides several sample ``stubs'' that can be integrated into target programs or operating systems for this purpose; they are named @file{*-stub.c}. -The GDB user's manual describes how to put such a stub into your target +The @value{GDBN} user's manual describes how to put such a stub into your target code. What follows is a discussion of integrating the SPARC stub into a complicated operating system (rather than a simple program), by Stu Grossman, the author of this stub. @@ -2093,7 +2311,7 @@ do breakpoints. Everything else is unnecessary for the proper operation of the debugger/stub. From reading the stub, it's probably not obvious how breakpoints work. -They are simply done by deposit/examine operations from GDB. +They are simply done by deposit/examine operations from @value{GDBN}. @section ROM Monitor Interface @@ -2108,7 +2326,7 @@ They are simply done by deposit/examine operations from GDB. @chapter Native Debugging -Several files control GDB's configuration for native support: +Several files control @value{GDBN}'s configuration for native support: @table @file @@ -2177,7 +2395,7 @@ just provide @code{fetch_core_registers} in @code{@var{xyz}-nat.c} (or @item core-aout.c::register_addr() If your @code{nm-@var{xyz}.h} file defines the macro @code{REGISTER_U_ADDR(addr, blockend, regno)}, it should be defined to -set @code{addr} to the offset within the @samp{user} struct of GDB +set @code{addr} to the offset within the @samp{user} struct of @value{GDBN} register number @code{regno}. @code{blockend} is the offset within the ``upage'' of @code{u.u_ar0}. If @code{REGISTER_U_ADDR} is defined, @file{core-aout.c} will define the @code{register_addr()} function and @@ -2192,7 +2410,7 @@ implementations simply locate the registers themselves.@refill @end table -When making GDB run native on a new operating system, to make it +When making @value{GDBN} run native on a new operating system, to make it possible to debug core files, you will need to either write specific code for parsing your OS's core files, or customize @file{bfd/trad-core.c}. First, use whatever @code{#include} files your @@ -2209,13 +2427,13 @@ section information basically delimits areas in the core file in a standard way, which the section-reading routines in BFD know how to seek around in. -Then back in GDB, you need a matching routine called +Then back in @value{GDBN}, you need a matching routine called @code{fetch_core_registers()}. If you can use the generic one, it's in @file{core-aout.c}; if not, it's in your @file{@var{xyz}-nat.c} file. It will be passed a char pointer to the entire ``registers'' segment, its length, and a zero; or a char pointer to the entire ``regs2'' segment, its length, and a 2. The routine should suck out the supplied -register values and install them into GDB's ``registers'' array. +register values and install them into @value{GDBN}'s ``registers'' array. If your system uses @file{/proc} to control processes, and uses ELF format core files, then you may be able to use the same routines for @@ -2231,7 +2449,7 @@ reading the registers out of processes and out of core files. @section Native Conditionals -When GDB is configured and compiled, various macros are defined or left +When @value{GDBN} is configured and compiled, various macros are defined or left undefined, to control compilation when the host and target systems are the same. These macros should be defined (or left undefined) in @file{nm-@var{system}.h}. @@ -2239,7 +2457,7 @@ the same. These macros should be defined (or left undefined) in @table @code @item ATTACH_DETACH -If defined, then GDB will include support for the @code{attach} and +If defined, then @value{GDBN} will include support for the @code{attach} and @code{detach} commands. @item CHILD_PREPARE_TO_STORE @@ -2278,18 +2496,18 @@ pointer. It examines the current state of the machine as needed. @item KERNEL_U_ADDR Define this to the address of the @code{u} structure (the ``user -struct'', also known as the ``u-page'') in kernel virtual memory. GDB +struct'', also known as the ``u-page'') in kernel virtual memory. @value{GDBN} needs to know this so that it can subtract this address from absolute addresses in the upage, that are obtained via ptrace or from core files. On systems that don't need this value, set it to zero. @item KERNEL_U_ADDR_BSD -Define this to cause GDB to determine the address of @code{u} at +Define this to cause @value{GDBN} to determine the address of @code{u} at runtime, by using Berkeley-style @code{nlist} on the kernel's image in the root directory. @item KERNEL_U_ADDR_HPUX -Define this to cause GDB to determine the address of @code{u} at +Define this to cause @value{GDBN} to determine the address of @code{u} at runtime, by using HP-style @code{nlist} on the kernel's image in the root directory. @@ -2305,7 +2523,7 @@ threads. In a multi-threaded task we may select another thread and then continue or step. But if the old thread was stopped at a breakpoint, it will immediately cause another breakpoint stop without any execution (i.e. it -will report a breakpoint hit incorrectly). So GDB must step over it +will report a breakpoint hit incorrectly). So @value{GDBN} must step over it first. If defined, @code{PREPARE_TO_PROCEED} should check the current thread @@ -2338,14 +2556,14 @@ Defaults to @code{"/bin/sh"}. @item SOLIB_ADD (filename, from_tty, targ) Define this to expand into an expression that will cause the symbols in -@var{filename} to be added to GDB's symbol table. +@var{filename} to be added to @value{GDBN}'s symbol table. @item SOLIB_CREATE_INFERIOR_HOOK Define this to expand into any shared-library-relocation code that you want to be run just after the child process has been forked. @item START_INFERIOR_TRAPS_EXPECTED -When starting an inferior, GDB normally expects to trap twice; once when +When starting an inferior, @value{GDBN} normally expects to trap twice; once when the shell execs, and once when the program itself execs. If the actual number of traps is something other than 2, then define this macro to expand into the number expected. @@ -2355,7 +2573,7 @@ Define this to indicate that SVR4-style shared libraries are in use. @item USE_PROC_FS This determines whether small routines in @file{*-tdep.c}, which -translate register values between GDB's internal representation and the +translate register values between @value{GDBN}'s internal representation and the /proc representation, are compiled. @item U_REGS_OFFSET @@ -2385,7 +2603,7 @@ Define this to debug ptrace calls. @section BFD -BFD provides support for GDB in several ways: +BFD provides support for @value{GDBN} in several ways: @table @emph @@ -2396,7 +2614,7 @@ several variants thereof, as well as several kinds of core files. @item access to sections of files BFD parses the file headers to determine the names, virtual addresses, sizes, and file locations of all the various named sections in files -(such as the text section or the data section). GDB simply calls BFD to +(such as the text section or the data section). @value{GDBN} simply calls BFD to read or write section X at byte offset Y for length Z. @item specialized core file support @@ -2406,17 +2624,17 @@ file matches (i.e. could be a core dump of) a particular executable file. @item locating the symbol information -GDB uses an internal interface of BFD to determine where to find the -symbol information in an executable file or symbol-file. GDB itself +@value{GDBN} uses an internal interface of BFD to determine where to find the +symbol information in an executable file or symbol-file. @value{GDBN} itself handles the reading of symbols, since BFD does not ``understand'' debug -symbols, but GDB uses BFD's cached information to find the symbols, +symbols, but @value{GDBN} uses BFD's cached information to find the symbols, string table, etc. @end table @section opcodes -The opcodes library provides GDB's disassembler. (It's a separate +The opcodes library provides @value{GDBN}'s disassembler. (It's a separate library because it's also used in binutils, for @file{objdump}). @section readline @@ -2456,7 +2674,7 @@ Regex conditionals. @chapter Coding This chapter covers topics that are lower-level than the major -algorithms of GDB. +algorithms of @value{GDBN}. @section Cleanups @@ -2536,19 +2754,19 @@ finish by printing a newline, to flush the wrap buffer, before switching to unfiltered (``@code{printf}'') output. Symbol reading routines that print warnings are a good example. -@section GDB Coding Standards +@section @value{GDBN} Coding Standards -GDB follows the GNU coding standards, as described in +@value{GDBN} follows the GNU coding standards, as described in @file{etc/standards.texi}. This file is also available for anonymous -FTP from GNU archive sites. GDB takes a strict interpretation of the +FTP from GNU archive sites. @value{GDBN} takes a strict interpretation of the standard; in general, when the GNU standard recommends a practice but -does not require it, GDB requires it. +does not require it, @value{GDBN} requires it. -GDB follows an additional set of coding standards specific to GDB, +@value{GDBN} follows an additional set of coding standards specific to @value{GDBN}, as described in the following sections. You can configure with @samp{--enable-build-warnings} to get GCC to -check on a number of these rules. GDB sources ought not to engender any +check on a number of these rules. @value{GDBN} sources ought not to engender any complaints, unless they are caused by bogus host systems. (The exact set of enabled warnings is currently @samp{-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations}. @@ -2585,7 +2803,7 @@ Block comments must appear in the following form, with no `/*'- or gets a signal, we may decide to start it up again instead of returning. That is why there is a loop in this function. When this function actually returns it means the inferior should be left - stopped and GDB should read more commands. */ + stopped and @value{GDBN} should read more commands. */ @end example (Note that this format is encouraged by Emacs; tabbing for a multi-line @@ -2606,8 +2824,8 @@ host's floating point numbers, the alignment of anything, or the order of evaluation of expressions. Use functions freely. There are only a handful of compute-bound areas -in GDB that might be affected by the overhead of a function call, mainly -in symbol reading. Most of GDB's performance is limited by the target +in @value{GDBN} that might be affected by the overhead of a function call, mainly +in symbol reading. Most of @value{GDBN}'s performance is limited by the target interface (whether serial line or system call). However, use functions with moderation. A thousand one-line functions @@ -2616,7 +2834,7 @@ are just as hard to understand as a single thousand-line function. @subsection Function Prototypes Prototypes must be used to @emph{declare} functions, and may be used to -@emph{define} them. Prototypes for GDB functions must include both the +@emph{define} them. Prototypes for @value{GDBN} functions must include both the argument type and name, with the name matching that used in the actual function definition. @@ -2631,13 +2849,13 @@ source file. @subsection Clean Design In addition to getting the syntax right, there's the little question of -semantics. Some things are done in certain ways in GDB because long +semantics. Some things are done in certain ways in @value{GDBN} because long experience has shown that the more obvious ways caused various kinds of trouble. You can't assume the byte order of anything that comes from a target (including @var{value}s, object files, and instructions). Such things -must be byte-swapped using @code{SWAP_TARGET_AND_HOST} in GDB, or one of +must be byte-swapped using @code{SWAP_TARGET_AND_HOST} in @value{GDBN}, or one of the swap routines defined in @file{bfd.h}, such as @code{bfd_get_32}. You can't assume that you know what interface is being used to talk to @@ -2696,7 +2914,7 @@ where the macro is used or in an appropriate header file. Whether to include a @dfn{small} hook, a hook around the exact pieces of code which are system-dependent, or whether to replace a whole function with a hook depends on the case. A good example of this dilemma can be -found in @code{get_saved_register}. All machines that GDB 2.8 ran on +found in @code{get_saved_register}. All machines that @value{GDBN} 2.8 ran on just needed the @code{FRAME_FIND_SAVED_REGS} hook to find the saved registers. Then the SPARC and Pyramid came along, and @code{HAVE_REGISTER_WINDOWS} and @code{REGISTER_IN_WINDOW_P} were @@ -2708,8 +2926,8 @@ with @code{GET_SAVED_REGISTER}, since that would result in much duplicated code. Other times, duplicating a few lines of code here or there is much cleaner than introducing a large number of small hooks. -Another way to generalize GDB along a particular interface is with an -attribute struct. For example, GDB has been generalized to handle +Another way to generalize @value{GDBN} along a particular interface is with an +attribute struct. For example, @value{GDBN} has been generalized to handle multiple kinds of remote interfaces -- not by #ifdef's everywhere, but by defining the "target_ops" structure and having a current target (as well as a stack of targets below it, for memory references). Whenever @@ -2720,11 +2938,11 @@ current target_ops structure. In this way, when a new remote interface is added, only one module needs to be touched -- the one that actually implements the new remote interface. Other examples of attribute-structs are BFD access to multiple kinds of object file -formats, or GDB's access to multiple source languages. +formats, or @value{GDBN}'s access to multiple source languages. -Please avoid duplicating code. For example, in GDB 3.x all the code -interfacing between @code{ptrace} and the rest of GDB was duplicated in -@file{*-dep.c}, and so changing something was very painful. In GDB 4.x, +Please avoid duplicating code. For example, in @value{GDBN} 3.x all the code +interfacing between @code{ptrace} and the rest of @value{GDBN} was duplicated in +@file{*-dep.c}, and so changing something was very painful. In @value{GDBN} 4.x, these have all been consolidated into @file{infptrace.c}. @file{infptrace.c} can deal with variations between systems the same way any system-independent file would (hooks, #if defined, etc.), and @@ -2735,9 +2953,9 @@ Don't put debugging printfs in the code. @node Porting GDB -@chapter Porting GDB +@chapter Porting @value{GDBN} -Most of the work in making GDB compile on a new machine is in specifying +Most of the work in making @value{GDBN} compile on a new machine is in specifying the configuration of the machine. This is done in a dizzying variety of header files and configuration scripts, which we hope to make more sensible soon. Let's say your new host is called an @var{xyz} (e.g. @@ -2767,17 +2985,17 @@ and no error messages. You need to port BFD, if that hasn't been done already. Porting BFD is beyond the scope of this manual. -To configure GDB itself, edit @file{gdb/configure.host} to recognize +To configure @value{GDBN} itself, edit @file{gdb/configure.host} to recognize your system and set @code{gdb_host} to @var{xyz}, and (unless your desired target is already available) also edit @file{gdb/configure.tgt}, setting @code{gdb_target} to something appropriate (for instance, @var{xyz}). -Finally, you'll need to specify and define GDB's host-, native-, and +Finally, you'll need to specify and define @value{GDBN}'s host-, native-, and target-dependent @file{.h} and @file{.c} files used for your configuration. -@section Configuring GDB for Release +@section Configuring @value{GDBN} for Release From the top level directory (containing @file{gdb}, @file{bfd}, @file{libiberty}, and so on): @@ -2820,20 +3038,20 @@ or so included files. @chapter Testsuite -The testsuite is an important component of the GDB package. While it is +The testsuite is an important component of the @value{GDBN} package. While it is always worthwhile to encourage user testing, in practice this is rarely sufficient; users typically use only a small subset of the available commands, and it has proven all too common for a change to cause a significant regression that went unnoticed for some time. -The GDB testsuite uses the DejaGNU testing framework. DejaGNU is built +The @value{GDBN} testsuite uses the DejaGNU testing framework. DejaGNU is built using tcl and expect. The tests themselves are calls to various tcl procs; the framework runs all the procs and summarizes the passes and fails. @section Using the Testsuite -To run the testsuite, simply go to the GDB object directory (or to the +To run the testsuite, simply go to the @value{GDBN} object directory (or to the testsuite's objdir) and type @code{make check}. This just sets up some environment variables and invokes DejaGNU's @code{runtest} script. While the testsuite is running, you'll get mentions of which test file is in use, @@ -2851,17 +3069,17 @@ finished, you'll get a summary that looks like this: @end example The ideal test run consists of expected passes only; however, reality conspires to keep us from this ideal. Unexpected failures indicate -real problems, whether in GDB or in the testsuite. Expected failures +real problems, whether in @value{GDBN} or in the testsuite. Expected failures are still failures, but ones which have been decided are too hard to deal with at the time; for instance, a test case might work everywhere except on AIX, and there is no prospect of the AIX case being fixed in the near future. Expected failures should not be added lightly, since -you may be masking serious bugs in GDB. Unexpected successes are expected +you may be masking serious bugs in @value{GDBN}. Unexpected successes are expected fails that are passing for some reason, while unresolved and untested cases often indicate some minor catastrophe, such as the compiler being unable to deal with a test program. -When making any significant change to GDB, you should run the testsuite +When making any significant change to @value{GDBN}, you should run the testsuite before and after the change, to confirm that there are no regressions. Note that truly complete testing would require that you run the testsuite with all supported configurations and a variety of compilers; @@ -2871,8 +3089,8 @@ one big-endian (Sparc) and one little-endian (x86) host, a cross config with a builtin simulator (powerpc-eabi, mips-elf), or a 64-bit host (Alpha). -If you add new functionality to GDB, please consider adding tests for it -as well; this way future GDB hackers can detect and fix their changes +If you add new functionality to @value{GDBN}, please consider adding tests for it +as well; this way future @value{GDBN} hackers can detect and fix their changes that break the functionality you added. Similarly, if you fix a bug that was not previously reported as a test failure, please add a test case for it. Some cases are extremely difficult to test, such as code @@ -2884,9 +3102,9 @@ compilers, and it's OK not to try to write tests for all of those. The testsuite is entirely contained in @file{gdb/testsuite}. While the testsuite includes some makefiles and configury, these are very minimal, and used for little besides cleaning up, since the tests themselves -handle the compilation of the programs that GDB will run. The file +handle the compilation of the programs that @value{GDBN} will run. The file @file{testsuite/lib/gdb.exp} contains common utility procs useful for -all GDB tests, while the directory @file{testsuite/config} contains +all @value{GDBN} tests, while the directory @file{testsuite/config} contains configuration-specific files, typically used for special-purpose definitions of procs like @code{gdb_load} and @code{gdb_start}. @@ -2907,7 +3125,7 @@ intelligibility. @item gdb.base This is the base testsuite. The tests in it should apply to all -configurations of GDB (but generic native-only tests may live here). +configurations of @value{GDBN} (but generic native-only tests may live here). The test programs should be in the subset of C that is valid K&R, ANSI/ISO, and C++ (ifdefs are allowed if necessary, for instance for prototypes). @@ -2928,11 +3146,11 @@ HP-UX. Tests specific to a particular compiler. As of this writing (June 1999), there aren't currently any groups of tests in this category that couldn't just as sensibly be made platform-specific, but one could -imagine a gdb.gcc, for tests of GDB's handling of GCC extensions. +imagine a gdb.gcc, for tests of @value{GDBN}'s handling of GCC extensions. @item gdb.@var{subsystem} -Tests that exercise a specific GDB subsystem in more depth. For +Tests that exercise a specific @value{GDBN} subsystem in more depth. For instance, @file{gdb.disasm} exercises various disassemblers, while @file{gdb.stabs} tests pathways through the stabs symbol reader. @@ -2940,7 +3158,7 @@ instance, @file{gdb.disasm} exercises various disassemblers, while @section Writing Tests -In many areas, the GDB tests are already quite comprehensive; you +In many areas, the @value{GDBN} tests are already quite comprehensive; you should be able to copy existing tests to handle new cases. You should try to use @code{gdb_test} whenever possible, since it @@ -2950,12 +3168,12 @@ instance, @file{gdb.base/exprs.exp} defines a @code{test_expr} that calls @code{gdb_test} multiple times. Only use @code{send_gdb} and @code{gdb_expect} when absolutely -necessary, such as when GDB has several valid responses to a command. +necessary, such as when @value{GDBN} has several valid responses to a command. The source language programs do @emph{not} need to be in a consistent -style. Since GDB is used to debug programs written in many different +style. Since @value{GDBN} is used to debug programs written in many different styles, it's worth having a mix of styles in the testsuite; for -instance, some GDB bugs involving the display of source lines would +instance, some @value{GDBN} bugs involving the display of source lines would never manifest themselves if the programs used GNU coding style uniformly. @@ -2967,25 +3185,25 @@ Check the @file{README} file, it often has useful information that does not appear anywhere else in the directory. @menu -* Getting Started:: Getting started working on GDB -* Debugging GDB:: Debugging GDB with itself +* Getting Started:: Getting started working on @value{GDBN} +* Debugging GDB:: Debugging @value{GDBN} with itself @end menu @node Getting Started,,, Hints @section Getting Started -GDB is a large and complicated program, and if you first starting to +@value{GDBN} is a large and complicated program, and if you first starting to work on it, it can be hard to know where to start. Fortunately, if you know how to go about it, there are ways to figure out what is going on. -This manual, the GDB Internals manual, has information which applies -generally to many parts of GDB. +This manual, the @value{GDBN} Internals manual, has information which applies +generally to many parts of @value{GDBN}. Information about particular functions or data structures are located in comments with those functions or data structures. If you run across a function or a global variable which does not have a comment correctly -explaining what is does, this can be thought of as a bug in GDB; feel +explaining what is does, this can be thought of as a bug in @value{GDBN}; feel free to submit a bug report, with a suggested comment if you can figure out what the comment should say. If you find a comment which is actually wrong, be especially sure to report that. @@ -3000,20 +3218,20 @@ also documents all the available macros. @c Conditionals}, @pxref{Native Conditionals}, and @pxref{Obsolete @c Conditionals}) -Start with the header files. Once you have some idea of how GDB's internal +Start with the header files. Once you have some idea of how @value{GDBN}'s internal symbol tables are stored (see @file{symtab.h}, @file{gdbtypes.h}), you will find it much easier to understand the code which uses and creates those symbol tables. You may wish to process the information you are getting somehow, to enhance your understanding of it. Summarize it, translate it to another -language, add some (perhaps trivial or non-useful) feature to GDB, use +language, add some (perhaps trivial or non-useful) feature to @value{GDBN}, use the code to predict what a test case would do and write the test case and verify your prediction, etc. If you are reading code and your eyes are starting to glaze over, this is a sign you need to use a more active approach. -Once you have a part of GDB to start with, you can find more +Once you have a part of @value{GDBN} to start with, you can find more specifically the part you are looking for by stepping through each function with the @code{next} command. Do not use @code{step} or you will quickly get distracted; when the function you are stepping through @@ -3034,7 +3252,7 @@ rather than worrying about all its details. A good place to start when tracking down some particular area is with a command which invokes that feature. Suppose you want to know how -single-stepping works. As a GDB user, you know that the @code{step} +single-stepping works. As a @value{GDBN} user, you know that the @code{step} command invokes single-stepping. The command is invoked via command tables (see @file{command.h}); by convention the function which actually performs the command is formed by taking the name of the command and @@ -3042,30 +3260,30 @@ adding @samp{_command}, or in the case of an @code{info} subcommand, @samp{_info}. For example, the @code{step} command invokes the @code{step_command} function and the @code{info display} command invokes @code{display_info}. When this convention is not followed, you might -have to use @code{grep} or @kbd{M-x tags-search} in emacs, or run GDB on +have to use @code{grep} or @kbd{M-x tags-search} in emacs, or run @value{GDBN} on itself and set a breakpoint in @code{execute_command}. If all of the above fail, it may be appropriate to ask for information on @code{bug-gdb}. But @emph{never} post a generic question like ``I was wondering if anyone could give me some tips about understanding -GDB''---if we had some magic secret we would put it in this manual. +@value{GDBN}''---if we had some magic secret we would put it in this manual. Suggestions for improving the manual are always welcome, of course. @node Debugging GDB,,,Hints -@section Debugging GDB with itself +@section Debugging @value{GDBN} with itself -If GDB is limping on your machine, this is the preferred way to get it +If @value{GDBN} is limping on your machine, this is the preferred way to get it fully functional. Be warned that in some ancient Unix systems, like Ultrix 4.2, a program can't be running in one process while it is being debugged in another. Rather than typing the command @code{@w{./gdb ./gdb}}, which works on Suns and such, you can copy @file{gdb} to @file{gdb2} and then type @code{@w{./gdb ./gdb2}}. -When you run GDB in the GDB source directory, it will read a +When you run @value{GDBN} in the @value{GDBN} source directory, it will read a @file{.gdbinit} file that sets up some simple things to make debugging gdb easier. The @code{info} command, when executed without a subcommand -in a GDB being debugged by gdb, will pop you back up to the top level +in a @value{GDBN} being debugged by gdb, will pop you back up to the top level gdb. See @file{.gdbinit} for details. If you use emacs, you will probably want to do a @code{make TAGS} after @@ -3073,18 +3291,18 @@ you configure your distribution; this will put the machine dependent routines for your local machine where they will be accessed first by @kbd{M-.} -Also, make sure that you've either compiled GDB with your local cc, or +Also, make sure that you've either compiled @value{GDBN} with your local cc, or have run @code{fixincludes} if you are compiling with gcc. @section Submitting Patches Thanks for thinking of offering your changes back to the community of -GDB users. In general we like to get well designed enhancements. +@value{GDBN} users. In general we like to get well designed enhancements. Thanks also for checking in advance about the best way to transfer the changes. -The GDB maintainers will only install ``cleanly designed'' patches. -This manual summarizes what we believe to be clean design for GDB. +The @value{GDBN} maintainers will only install ``cleanly designed'' patches. +This manual summarizes what we believe to be clean design for @value{GDBN}. If the maintainers don't have time to put the patch in when it arrives, or if there is any question about a patch, it goes into a large queue @@ -3096,7 +3314,7 @@ of the changes to the Free Software Foundation. You can get the standard documents for doing this by sending mail to @code{gnu@@gnu.org} and asking for it. We recommend that people write in "All programs owned by the Free Software Foundation" as "NAME OF PROGRAM", so that -changes in many programs (not just GDB, but GAS, Emacs, GCC, etc) can be +changes in many programs (not just @value{GDBN}, but GAS, Emacs, GCC, etc) can be contributed with only one piece of legalese pushed through the bureacracy and filed with the FSF. We can't start merging changes until this paperwork is received by the FSF (their rules, which we follow @@ -3136,12 +3354,12 @@ they arrive. The others go into a queue and get installed as time permits, which, since the maintainers have many demands to meet, may not be for quite some time. -Please send patches directly to the GDB maintainers at +Please send patches directly to the @value{GDBN} maintainers at @code{gdb-patches@@sourceware.cygnus.com}. @section Obsolete Conditionals -Fragments of old code in GDB sometimes reference or set the following +Fragments of old code in @value{GDBN} sometimes reference or set the following configuration macros. They should not be used by new code, and old uses should be removed as those parts of the debugger are otherwise touched. @@ -3150,10 +3368,10 @@ should be removed as those parts of the debugger are otherwise touched. @item STACK_END_ADDR This macro used to define where the end of the stack appeared, for use in interpreting core file formats that don't record this address in the -core file itself. This information is now configured in BFD, and GDB -gets the info portably from there. The values in GDB's configuration +core file itself. This information is now configured in BFD, and @value{GDBN} +gets the info portably from there. The values in @value{GDBN}'s configuration files should be moved into BFD configuration files (if needed there), -and deleted from all of GDB's config files. +and deleted from all of @value{GDBN}'s config files. Any @file{@var{foo}-xdep.c} file that references STACK_END_ADDR is so old that it has never been converted to use BFD. Now that's old! @@ -3170,6 +3388,12 @@ exec.c @end table - +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@ifinfo @contents +@end ifinfo +@ifhtml +@contents +@end ifhtml + @bye diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo index 8239ce70045..a4ea1dc9c70 100644 --- a/gdb/doc/stabs.texinfo +++ b/gdb/doc/stabs.texinfo @@ -86,6 +86,10 @@ This document describes the stabs debugging format. @end menu @end ifinfo +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@iftex +@contents +@end iftex @node Overview @chapter Overview of Stabs @@ -4015,5 +4019,12 @@ However, no one has yet designed or implemented such a scheme. @printindex fn +@c TeX can handle the contents at the start but makeinfo 3.12 can not +@ifinfo @contents +@end ifinfo +@ifhtml +@contents +@end ifhtml + @bye diff --git a/gdb/dsrec.c b/gdb/dsrec.c index b51d857daef..31b8fc277df 100644 --- a/gdb/dsrec.c +++ b/gdb/dsrec.c @@ -23,13 +23,13 @@ #include "srec.h" #include -extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t)); +extern void report_transfer_performance (unsigned long, time_t, time_t); extern int remote_debug; -static int make_srec PARAMS ((char *srec, CORE_ADDR targ_addr, bfd * abfd, - asection * sect, int sectoff, int *maxrecsize, - int flags)); +static int make_srec (char *srec, CORE_ADDR targ_addr, bfd * abfd, + asection * sect, int sectoff, int *maxrecsize, + int flags); /* Download an executable by converting it to S records. DESC is a serial_t to send the data to. FILE is the name of the file to be @@ -51,7 +51,7 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack) int maxrecsize; int flags; int hashmark; - int (*waitack) PARAMS ((void)); + int (*waitack) (void); { bfd *abfd; asection *s; diff --git a/gdb/dstread.c b/gdb/dstread.c index c10c1fe18cc..a5f7f35289a 100644 --- a/gdb/dstread.c +++ b/gdb/dstread.c @@ -52,38 +52,27 @@ static int prev_line_number; static int line_vector_length; -static int -init_dst_sections PARAMS ((int)); +static int init_dst_sections (int); -static void -read_dst_symtab PARAMS ((struct objfile *)); +static void read_dst_symtab (struct objfile *); -static void -find_dst_sections PARAMS ((bfd *, sec_ptr, PTR)); +static void find_dst_sections (bfd *, sec_ptr, PTR); -static void -dst_symfile_init PARAMS ((struct objfile *)); +static void dst_symfile_init (struct objfile *); -static void -dst_new_init PARAMS ((struct objfile *)); +static void dst_new_init (struct objfile *); -static void -dst_symfile_read PARAMS ((struct objfile *, int)); +static void dst_symfile_read (struct objfile *, int); -static void -dst_symfile_finish PARAMS ((struct objfile *)); +static void dst_symfile_finish (struct objfile *); -static void -dst_end_symtab PARAMS ((struct objfile *)); +static void dst_end_symtab (struct objfile *); -static void -complete_symtab PARAMS ((char *, CORE_ADDR, unsigned int)); +static void complete_symtab (char *, CORE_ADDR, unsigned int); -static void -dst_start_symtab PARAMS ((void)); +static void dst_start_symtab (void); -static void -dst_record_line PARAMS ((int, CORE_ADDR)); +static void dst_record_line (int, CORE_ADDR); /* Manage the vector of line numbers. */ /* FIXME: Use record_line instead. */ @@ -288,7 +277,7 @@ dst_symfile_read (objfile, mainline) error ("\"%s\": error reading debugging symbol tables\n", name); init_minimal_symbol_collection (); - make_cleanup (discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ @@ -769,8 +758,7 @@ create_new_symbol (objfile, name) return sym; }; -static struct type * - decode_dst_type PARAMS ((struct objfile *, dst_rec_ptr_t)); +static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t); static struct type * decode_type_desc (objfile, type_desc, base) diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c index 60a177dbed1..4cd035fbf34 100644 --- a/gdb/dve3900-rom.c +++ b/gdb/dve3900-rom.c @@ -31,7 +31,7 @@ /* Type of function passed to bfd_map_over_sections. */ -typedef void (*section_map_func) PARAMS ((bfd * abfd, asection * sect, PTR obj)); +typedef void (*section_map_func) (bfd * abfd, asection * sect, PTR obj); /* Packet escape character used by Densan monitor. */ @@ -44,8 +44,7 @@ typedef void (*section_map_func) PARAMS ((bfd * abfd, asection * sect, PTR obj)) /* External functions. */ -extern void report_transfer_performance PARAMS ((unsigned long, - time_t, time_t)); +extern void report_transfer_performance (unsigned long, time_t, time_t); /* Certain registers are "bitmapped", in that the monitor can only display them or let the user modify them as a series of named bitfields. @@ -62,36 +61,32 @@ struct bit_field /* Local functions for register manipulation. */ -static void r3900_supply_register PARAMS ((char *regname, int regnamelen, - char *val, int vallen)); -static void fetch_bad_vaddr PARAMS ((void)); -static unsigned long fetch_fields PARAMS ((struct bit_field * bf)); -static void fetch_bitmapped_register PARAMS ((int regno, - struct bit_field * bf)); -static void r3900_fetch_registers PARAMS ((int regno)); -static void store_bitmapped_register PARAMS ((int regno, - struct bit_field * bf)); -static void r3900_store_registers PARAMS ((int regno)); +static void r3900_supply_register (char *regname, int regnamelen, + char *val, int vallen); +static void fetch_bad_vaddr (void); +static unsigned long fetch_fields (struct bit_field *bf); +static void fetch_bitmapped_register (int regno, struct bit_field *bf); +static void r3900_fetch_registers (int regno); +static void store_bitmapped_register (int regno, struct bit_field *bf); +static void r3900_store_registers (int regno); /* Local functions for fast binary loading. */ -static void write_long PARAMS ((char *buf, long n)); -static void write_long_le PARAMS ((char *buf, long n)); -static int debug_readchar PARAMS ((int hex)); -static void debug_write PARAMS ((unsigned char *buf, int buflen)); -static void ignore_packet PARAMS ((void)); -static void send_packet PARAMS ((char type, unsigned char *buf, int buflen, - int seq)); -static void process_read_request PARAMS ((unsigned char *buf, int buflen)); -static void count_section PARAMS ((bfd * abfd, asection * s, - unsigned int *section_count)); -static void load_section PARAMS ((bfd * abfd, asection * s, - unsigned int *data_count)); -static void r3900_load PARAMS ((char *filename, int from_tty)); +static void write_long (char *buf, long n); +static void write_long_le (char *buf, long n); +static int debug_readchar (int hex); +static void debug_write (unsigned char *buf, int buflen); +static void ignore_packet (void); +static void send_packet (char type, unsigned char *buf, int buflen, int seq); +static void process_read_request (unsigned char *buf, int buflen); +static void count_section (bfd * abfd, asection * s, + unsigned int *section_count); +static void load_section (bfd * abfd, asection * s, unsigned int *data_count); +static void r3900_load (char *filename, int from_tty); /* Miscellaneous local functions. */ -static void r3900_open PARAMS ((char *args, int from_tty)); +static void r3900_open (char *args, int from_tty); /* Pointers to static functions in monitor.c for fetching and storing @@ -100,13 +95,13 @@ static void r3900_open PARAMS ((char *args, int from_tty)); format, and those that can't be modified at all. In those cases we have to use our own functions to fetch and store their values. */ -static void (*orig_monitor_fetch_registers) PARAMS ((int regno)); -static void (*orig_monitor_store_registers) PARAMS ((int regno)); +static void (*orig_monitor_fetch_registers) (int regno); +static void (*orig_monitor_store_registers) (int regno); /* Pointer to static function in monitor. for loading programs. We use this function for loading S-records via the serial link. */ -static void (*orig_monitor_load) PARAMS ((char *file, int from_tty)); +static void (*orig_monitor_load) (char *file, int from_tty); /* This flag is set if a fast ethernet download should be used. */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b8b648ac8d0..b6a340f7f4a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -35,14 +35,15 @@ #include "buildsym.h" #include "demangle.h" #include "expression.h" + #include "language.h" #include "complaints.h" - +#include "bcache.h" #include #include "gdb_string.h" #include -/* .debug_info header for a compilation unit +/* .debug_info header for a compilation unit Because of alignment constraints, this structure has padding and cannot be mapped directly onto the beginning of the .debug_info section. */ typedef struct comp_unit_header @@ -267,6 +268,11 @@ static struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE]; static struct die_info *die_ref_table[REF_HASH_SIZE]; +#ifndef TYPE_HASH_SIZE +#define TYPE_HASH_SIZE 4096 +#endif +static struct type *dwarf2_cached_types[TYPE_HASH_SIZE]; + /* Obstack for allocating temporary storage used during symbol reading. */ static struct obstack dwarf2_tmp_obstack; @@ -333,7 +339,7 @@ static int islocal; /* Variable is at the returned offset static int frame_base_reg; static CORE_ADDR frame_base_offset; -/* This value is added to each symbol value. FIXME: Generalize to +/* This value is added to each symbol value. FIXME: Generalize to the section_offsets structure used by dbxread (once this is done, pass the appropriate section number to end_symtab). */ static CORE_ADDR baseaddr; /* Add to each symbol value */ @@ -550,211 +556,196 @@ extern int info_verbose; /* From main.c; nonzero => verbose */ /* local function prototypes */ -static void dwarf2_locate_sections PARAMS ((bfd *, asection *, PTR)); +static void dwarf2_locate_sections (bfd *, asection *, PTR); #if 0 -static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *, int)); +static void dwarf2_build_psymtabs_easy (struct objfile *, int); #endif -static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *, int)); +static void dwarf2_build_psymtabs_hard (struct objfile *, int); -static char *scan_partial_symbols PARAMS ((char *, struct objfile *, - CORE_ADDR *, CORE_ADDR *)); +static char *scan_partial_symbols (char *, struct objfile *, + CORE_ADDR *, CORE_ADDR *); -static void add_partial_symbol PARAMS ((struct partial_die_info *, - struct objfile *)); +static void add_partial_symbol (struct partial_die_info *, struct objfile *); -static void dwarf2_psymtab_to_symtab PARAMS ((struct partial_symtab *)); +static void dwarf2_psymtab_to_symtab (struct partial_symtab *); -static void psymtab_to_symtab_1 PARAMS ((struct partial_symtab *)); +static void psymtab_to_symtab_1 (struct partial_symtab *); -static char *dwarf2_read_section PARAMS ((struct objfile *, file_ptr, - unsigned int)); +static char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int); -static void dwarf2_read_abbrevs PARAMS ((bfd *, unsigned int)); +static void dwarf2_read_abbrevs (bfd *, unsigned int); -static void dwarf2_empty_abbrev_table PARAMS ((PTR)); +static void dwarf2_empty_abbrev_table (PTR); -static struct abbrev_info *dwarf2_lookup_abbrev PARAMS ((unsigned int)); +static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int); -static char *read_partial_die PARAMS ((struct partial_die_info *, - bfd *, char *, int *)); +static char *read_partial_die (struct partial_die_info *, + bfd *, char *, int *); -static char *read_full_die PARAMS ((struct die_info **, bfd *, char *)); +static char *read_full_die (struct die_info **, bfd *, char *); -static char *read_attribute PARAMS ((struct attribute *, struct attr_abbrev *, - bfd *, char *)); +static char *read_attribute (struct attribute *, struct attr_abbrev *, + bfd *, char *); -static unsigned int read_1_byte PARAMS ((bfd *, char *)); +static unsigned int read_1_byte (bfd *, char *); -static int read_1_signed_byte PARAMS ((bfd *, char *)); +static int read_1_signed_byte (bfd *, char *); -static unsigned int read_2_bytes PARAMS ((bfd *, char *)); +static unsigned int read_2_bytes (bfd *, char *); -static unsigned int read_4_bytes PARAMS ((bfd *, char *)); +static unsigned int read_4_bytes (bfd *, char *); -static unsigned int read_8_bytes PARAMS ((bfd *, char *)); +static unsigned int read_8_bytes (bfd *, char *); -static CORE_ADDR read_address PARAMS ((bfd *, char *)); +static CORE_ADDR read_address (bfd *, char *); -static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int)); +static char *read_n_bytes (bfd *, char *, unsigned int); -static char *read_string PARAMS ((bfd *, char *, unsigned int *)); +static char *read_string (bfd *, char *, unsigned int *); -static unsigned int read_unsigned_leb128 PARAMS ((bfd *, char *, - unsigned int *)); +static unsigned int read_unsigned_leb128 (bfd *, char *, unsigned int *); -static int read_signed_leb128 PARAMS ((bfd *, char *, unsigned int *)); +static int read_signed_leb128 (bfd *, char *, unsigned int *); -static void set_cu_language PARAMS ((unsigned int)); +static void set_cu_language (unsigned int); -static struct attribute *dwarf_attr PARAMS ((struct die_info *, - unsigned int)); +static struct attribute *dwarf_attr (struct die_info *, unsigned int); static int die_is_declaration (struct die_info *); -static void dwarf_decode_lines PARAMS ((unsigned int, char *, bfd *)); +static void dwarf_decode_lines (unsigned int, char *, bfd *); -static void dwarf2_start_subfile PARAMS ((char *, char *)); +static void dwarf2_start_subfile (char *, char *); -static struct symbol *new_symbol PARAMS ((struct die_info *, struct type *, - struct objfile *)); +static struct symbol *new_symbol (struct die_info *, struct type *, + struct objfile *); -static void dwarf2_const_value PARAMS ((struct attribute *, struct symbol *, - struct objfile *)); +static void dwarf2_const_value (struct attribute *, struct symbol *, + struct objfile *); static void dwarf2_const_value_data (struct attribute *attr, struct symbol *sym, int bits); -static struct type *die_type PARAMS ((struct die_info *, struct objfile *)); +static struct type *die_type (struct die_info *, struct objfile *); -static struct type *die_containing_type PARAMS ((struct die_info *, - struct objfile *)); +static struct type *die_containing_type (struct die_info *, struct objfile *); #if 0 -static struct type *type_at_offset PARAMS ((unsigned int, struct objfile *)); +static struct type *type_at_offset (unsigned int, struct objfile *); #endif -static struct type *tag_type_to_type PARAMS ((struct die_info *, - struct objfile *)); +static struct type *tag_type_to_type (struct die_info *, struct objfile *); + +static void read_type_die (struct die_info *, struct objfile *); -static void read_type_die PARAMS ((struct die_info *, struct objfile *)); +static void read_typedef (struct die_info *, struct objfile *); -static void read_typedef PARAMS ((struct die_info *, struct objfile *)); +static void read_base_type (struct die_info *, struct objfile *); -static void read_base_type PARAMS ((struct die_info *, struct objfile *)); +static void read_file_scope (struct die_info *, struct objfile *); -static void read_file_scope PARAMS ((struct die_info *, struct objfile *)); +static void read_func_scope (struct die_info *, struct objfile *); -static void read_func_scope PARAMS ((struct die_info *, struct objfile *)); +static void read_lexical_block_scope (struct die_info *, struct objfile *); -static void read_lexical_block_scope PARAMS ((struct die_info *, - struct objfile *)); +static int dwarf2_get_pc_bounds (struct die_info *, + CORE_ADDR *, CORE_ADDR *, struct objfile *); -static int dwarf2_get_pc_bounds PARAMS ((struct die_info *, - CORE_ADDR *, CORE_ADDR *, - struct objfile *)); +static void dwarf2_add_field (struct field_info *, struct die_info *, + struct objfile *); -static void dwarf2_add_field PARAMS ((struct field_info *, struct die_info *, - struct objfile *)); +static void dwarf2_attach_fields_to_type (struct field_info *, + struct type *, struct objfile *); -static void dwarf2_attach_fields_to_type PARAMS ((struct field_info *, - struct type *, - struct objfile *)); +static void dwarf2_add_member_fn (struct field_info *, + struct die_info *, struct type *, + struct objfile *objfile); -static void dwarf2_add_member_fn PARAMS ((struct field_info *, - struct die_info *, struct type *, - struct objfile * objfile)); +static void dwarf2_attach_fn_fields_to_type (struct field_info *, + struct type *, struct objfile *); -static void dwarf2_attach_fn_fields_to_type PARAMS ((struct field_info *, - struct type *, - struct objfile *)); +static void read_structure_scope (struct die_info *, struct objfile *); -static void read_structure_scope PARAMS ((struct die_info *, struct objfile *)); +static void read_common_block (struct die_info *, struct objfile *); -static void read_common_block PARAMS ((struct die_info *, struct objfile *)); +static void read_enumeration (struct die_info *, struct objfile *); -static void read_enumeration PARAMS ((struct die_info *, struct objfile *)); +static struct type *dwarf_base_type (int, int, struct objfile *); -static struct type *dwarf_base_type PARAMS ((int, int, struct objfile *)); +static CORE_ADDR decode_locdesc (struct dwarf_block *, struct objfile *); -static CORE_ADDR decode_locdesc PARAMS ((struct dwarf_block *, - struct objfile *)); +static void read_array_type (struct die_info *, struct objfile *); -static void read_array_type PARAMS ((struct die_info *, struct objfile *)); +static void read_tag_pointer_type (struct die_info *, struct objfile *); -static void read_tag_pointer_type PARAMS ((struct die_info *, - struct objfile *)); +static void read_tag_ptr_to_member_type (struct die_info *, struct objfile *); -static void read_tag_ptr_to_member_type PARAMS ((struct die_info *, - struct objfile *)); +static void read_tag_reference_type (struct die_info *, struct objfile *); -static void read_tag_reference_type PARAMS ((struct die_info *, - struct objfile *)); +static void read_tag_const_type (struct die_info *, struct objfile *); -static void read_tag_const_type PARAMS ((struct die_info *, struct objfile *)); +static void read_tag_volatile_type (struct die_info *, struct objfile *); -static void read_tag_volatile_type PARAMS ((struct die_info *, - struct objfile *)); +static void read_tag_string_type (struct die_info *, struct objfile *); -static void read_tag_string_type PARAMS ((struct die_info *, - struct objfile *)); +static void read_subroutine_type (struct die_info *, struct objfile *); -static void read_subroutine_type PARAMS ((struct die_info *, - struct objfile *)); +struct die_info *read_comp_unit (char *, bfd *); -struct die_info *read_comp_unit PARAMS ((char *, bfd *)); +static void free_die_list (struct die_info *); -static void free_die_list PARAMS ((struct die_info *)); +static struct cleanup *make_cleanup_free_die_list (struct die_info *); -static void process_die PARAMS ((struct die_info *, struct objfile *)); +static void process_die (struct die_info *, struct objfile *); -static char *dwarf2_linkage_name PARAMS ((struct die_info *)); +static char *dwarf2_linkage_name (struct die_info *); -static char *dwarf_tag_name PARAMS ((unsigned int)); +static char *dwarf_tag_name (unsigned int); -static char *dwarf_attr_name PARAMS ((unsigned int)); +static char *dwarf_attr_name (unsigned int); -static char *dwarf_form_name PARAMS ((unsigned int)); +static char *dwarf_form_name (unsigned int); -static char *dwarf_stack_op_name PARAMS ((unsigned int)); +static char *dwarf_stack_op_name (unsigned int); -static char *dwarf_bool_name PARAMS ((unsigned int)); +static char *dwarf_bool_name (unsigned int); -static char *dwarf_type_encoding_name PARAMS ((unsigned int)); +static char *dwarf_type_encoding_name (unsigned int); #if 0 -static char *dwarf_cfi_name PARAMS ((unsigned int)); +static char *dwarf_cfi_name (unsigned int); -struct die_info *copy_die PARAMS ((struct die_info *)); +struct die_info *copy_die (struct die_info *); #endif -struct die_info *sibling_die PARAMS ((struct die_info *)); +struct die_info *sibling_die (struct die_info *); -void dump_die PARAMS ((struct die_info *)); +void dump_die (struct die_info *); -void dump_die_list PARAMS ((struct die_info *)); +void dump_die_list (struct die_info *); -void store_in_ref_table PARAMS ((unsigned int, struct die_info *)); +void store_in_ref_table (unsigned int, struct die_info *); -static void dwarf2_empty_die_ref_table PARAMS ((void)); +static void dwarf2_empty_die_ref_table (void); -static unsigned int dwarf2_get_ref_die_offset PARAMS ((struct attribute *)); +static unsigned int dwarf2_get_ref_die_offset (struct attribute *); -struct die_info *follow_die_ref PARAMS ((unsigned int)); +struct die_info *follow_die_ref (unsigned int); -static struct type *dwarf2_fundamental_type PARAMS ((struct objfile *, int)); +static struct type *dwarf2_fundamental_type (struct objfile *, int); /* memory allocation interface */ -static void dwarf2_free_tmp_obstack PARAMS ((PTR)); +static void dwarf2_free_tmp_obstack (PTR); -static struct dwarf_block *dwarf_alloc_block PARAMS ((void)); +static struct dwarf_block *dwarf_alloc_block (void); -static struct abbrev_info *dwarf_alloc_abbrev PARAMS ((void)); +static struct abbrev_info *dwarf_alloc_abbrev (void); -static struct die_info *dwarf_alloc_die PARAMS ((void)); +static struct die_info *dwarf_alloc_die (void); /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ @@ -1322,7 +1313,7 @@ psymtab_to_symtab_1 (pst) dies = read_comp_unit (info_ptr, abfd); - make_cleanup ((make_cleanup_func) free_die_list, dies); + make_cleanup_free_die_list (dies); /* Do line number decoding in read_file_scope () */ process_die (dies, objfile); @@ -1998,8 +1989,7 @@ dwarf2_add_member_fn (fip, die, type, objfile) (fip->nfnfields + DW_FIELD_ALLOC_CHUNK) * sizeof (struct fnfieldlist)); if (fip->nfnfields == 0) - make_cleanup ((make_cleanup_func) free_current_contents, - &fip->fnfieldlists); + make_cleanup (free_current_contents, &fip->fnfieldlists); } flp = &fip->fnfieldlists[fip->nfnfields]; flp->name = fieldname; @@ -2506,8 +2496,7 @@ read_array_type (die, objfile) xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK) * sizeof (struct type *)); if (ndim == 0) - make_cleanup ((make_cleanup_func) free_current_contents, - &range_types); + make_cleanup (free_current_contents, &range_types); } range_types[ndim++] = create_range_type (NULL, index_type, low, high); } @@ -2958,6 +2947,19 @@ free_die_list (dies) } } +static void +do_free_die_list_cleanup (void *dies) +{ + free_die_list (dies); +} + +static struct cleanup * +make_cleanup_free_die_list (struct die_info *dies) +{ + return make_cleanup (do_free_die_list_cleanup, dies); +} + + /* Read the contents of the section at OFFSET and of size SIZE from the object file specified by OBJFILE into the psymbol_obstack and return it. */ @@ -3760,8 +3762,7 @@ dwarf_decode_lines (offset, comp_dir, abfd) line_ptr += 1; lh.standard_opcode_lengths = (unsigned char *) xmalloc (lh.opcode_base * sizeof (unsigned char)); - back_to = make_cleanup ((make_cleanup_func) free_current_contents, - &lh.standard_opcode_lengths); + back_to = make_cleanup (free_current_contents, &lh.standard_opcode_lengths); lh.standard_opcode_lengths[0] = 1; for (i = 1; i < lh.opcode_base; ++i) @@ -3780,7 +3781,7 @@ dwarf_decode_lines (offset, comp_dir, abfd) xrealloc (dirs.dirs, (dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *)); if (dirs.num_dirs == 0) - make_cleanup ((make_cleanup_func) free_current_contents, &dirs.dirs); + make_cleanup (free_current_contents, &dirs.dirs); } dirs.dirs[dirs.num_dirs++] = cur_dir; } @@ -3797,8 +3798,7 @@ dwarf_decode_lines (offset, comp_dir, abfd) (files.num_files + FILE_ALLOC_CHUNK) * sizeof (struct fileinfo)); if (files.num_files == 0) - make_cleanup ((make_cleanup_func) free_current_contents, - &files.files); + make_cleanup (free_current_contents, &files.files); } files.files[files.num_files].name = cur_file; files.files[files.num_files].dir = @@ -3873,8 +3873,7 @@ dwarf_decode_lines (offset, comp_dir, abfd) (files.num_files + FILE_ALLOC_CHUNK) * sizeof (struct fileinfo)); if (files.num_files == 0) - make_cleanup ((make_cleanup_func) free_current_contents, - &files.files); + make_cleanup (free_current_contents, &files.files); } files.files[files.num_files].name = cur_file; files.files[files.num_files].dir = @@ -3967,9 +3966,9 @@ done: DW_AT_name: /srcdir/list0.c DW_AT_comp_dir: /compdir - files.files[0].name: list0.h + files.files[0].name: list0.h files.files[0].dir: /srcdir - files.files[1].name: list0.c + files.files[1].name: list0.c files.files[1].dir: /srcdir The line number information for list0.c has to end up in a single @@ -4346,7 +4345,7 @@ dwarf2_const_value_data (struct attribute *attr, if (TYPE_UNSIGNED (SYMBOL_TYPE (sym))) l &= ((LONGEST) 1 << bits) - 1; else - l = (l << (sizeof (l) - bits)) >> (sizeof (l) - bits); + l = (l << (sizeof (l) * 8 - bits)) >> (sizeof (l) * 8 - bits); } SYMBOL_VALUE (sym) = l; @@ -4456,7 +4455,38 @@ tag_type_to_type (die, objfile) } else { - read_type_die (die, objfile); + struct attribute *attr; + attr = dwarf_attr (die, DW_AT_name); + if (attr && DW_STRING (attr)) + { + char *attrname=DW_STRING (attr); + unsigned long hashval=hash(attrname, strlen(attrname)) % TYPE_HASH_SIZE; + + if (dwarf2_cached_types[hashval] != NULL) + { + const char *nameoftype; + nameoftype = TYPE_NAME(dwarf2_cached_types[hashval]) == NULL ? TYPE_TAG_NAME(dwarf2_cached_types[hashval]) : TYPE_NAME(dwarf2_cached_types[hashval]); + if (strcmp(attrname, nameoftype) == 0) + { + die->type=dwarf2_cached_types[hashval]; + } + else + { + read_type_die (die, objfile); + dwarf2_cached_types[hashval] = die->type; + } + } + else + { + read_type_die (die, objfile); + dwarf2_cached_types[hashval] = die->type; + } + } + else + { + read_type_die (die, objfile); + } + if (!die->type) { dump_die (die); diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 18727c2b923..c56155e87c4 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -450,132 +450,95 @@ static const struct language_defn *cu_language_defn; /* Forward declarations of static functions so we don't have to worry about ordering within this file. */ -static void -free_utypes PARAMS ((PTR)); +static void free_utypes (PTR); -static int -attribute_size PARAMS ((unsigned int)); +static int attribute_size (unsigned int); -static CORE_ADDR - target_to_host PARAMS ((char *, int, int, struct objfile *)); +static CORE_ADDR target_to_host (char *, int, int, struct objfile *); -static void -add_enum_psymbol PARAMS ((struct dieinfo *, struct objfile *)); +static void add_enum_psymbol (struct dieinfo *, struct objfile *); -static void -handle_producer PARAMS ((char *)); +static void handle_producer (char *); static void -read_file_scope PARAMS ((struct dieinfo *, char *, char *, struct objfile *)); +read_file_scope (struct dieinfo *, char *, char *, struct objfile *); static void -read_func_scope PARAMS ((struct dieinfo *, char *, char *, struct objfile *)); +read_func_scope (struct dieinfo *, char *, char *, struct objfile *); static void -read_lexical_block_scope PARAMS ((struct dieinfo *, char *, char *, - struct objfile *)); +read_lexical_block_scope (struct dieinfo *, char *, char *, struct objfile *); -static void -scan_partial_symbols PARAMS ((char *, char *, struct objfile *)); +static void scan_partial_symbols (char *, char *, struct objfile *); static void -scan_compilation_units PARAMS ((char *, char *, file_ptr, - file_ptr, struct objfile *)); +scan_compilation_units (char *, char *, file_ptr, file_ptr, struct objfile *); -static void -add_partial_symbol PARAMS ((struct dieinfo *, struct objfile *)); +static void add_partial_symbol (struct dieinfo *, struct objfile *); -static void -basicdieinfo PARAMS ((struct dieinfo *, char *, struct objfile *)); +static void basicdieinfo (struct dieinfo *, char *, struct objfile *); -static void -completedieinfo PARAMS ((struct dieinfo *, struct objfile *)); +static void completedieinfo (struct dieinfo *, struct objfile *); -static void -dwarf_psymtab_to_symtab PARAMS ((struct partial_symtab *)); +static void dwarf_psymtab_to_symtab (struct partial_symtab *); -static void -psymtab_to_symtab_1 PARAMS ((struct partial_symtab *)); +static void psymtab_to_symtab_1 (struct partial_symtab *); -static void -read_ofile_symtab PARAMS ((struct partial_symtab *)); +static void read_ofile_symtab (struct partial_symtab *); -static void -process_dies PARAMS ((char *, char *, struct objfile *)); +static void process_dies (char *, char *, struct objfile *); static void -read_structure_scope PARAMS ((struct dieinfo *, char *, char *, - struct objfile *)); +read_structure_scope (struct dieinfo *, char *, char *, struct objfile *); -static struct type * - decode_array_element_type PARAMS ((char *)); +static struct type *decode_array_element_type (char *); -static struct type * - decode_subscript_data_item PARAMS ((char *, char *)); +static struct type *decode_subscript_data_item (char *, char *); -static void -dwarf_read_array_type PARAMS ((struct dieinfo *)); +static void dwarf_read_array_type (struct dieinfo *); -static void -read_tag_pointer_type PARAMS ((struct dieinfo * dip)); +static void read_tag_pointer_type (struct dieinfo *dip); -static void -read_tag_string_type PARAMS ((struct dieinfo * dip)); +static void read_tag_string_type (struct dieinfo *dip); -static void -read_subroutine_type PARAMS ((struct dieinfo *, char *, char *)); +static void read_subroutine_type (struct dieinfo *, char *, char *); static void -read_enumeration PARAMS ((struct dieinfo *, char *, char *, struct objfile *)); +read_enumeration (struct dieinfo *, char *, char *, struct objfile *); -static struct type * - struct_type PARAMS ((struct dieinfo *, char *, char *, struct objfile *)); +static struct type *struct_type (struct dieinfo *, char *, char *, + struct objfile *); -static struct type * - enum_type PARAMS ((struct dieinfo *, struct objfile *)); +static struct type *enum_type (struct dieinfo *, struct objfile *); -static void -decode_line_numbers PARAMS ((char *)); +static void decode_line_numbers (char *); -static struct type * - decode_die_type PARAMS ((struct dieinfo *)); +static struct type *decode_die_type (struct dieinfo *); -static struct type * - decode_mod_fund_type PARAMS ((char *)); +static struct type *decode_mod_fund_type (char *); -static struct type * - decode_mod_u_d_type PARAMS ((char *)); +static struct type *decode_mod_u_d_type (char *); -static struct type * - decode_modified_type PARAMS ((char *, unsigned int, int)); +static struct type *decode_modified_type (char *, unsigned int, int); -static struct type * - decode_fund_type PARAMS ((unsigned int)); +static struct type *decode_fund_type (unsigned int); -static char * - create_name PARAMS ((char *, struct obstack *)); +static char *create_name (char *, struct obstack *); -static struct type * - lookup_utype PARAMS ((DIE_REF)); +static struct type *lookup_utype (DIE_REF); -static struct type * - alloc_utype PARAMS ((DIE_REF, struct type *)); +static struct type *alloc_utype (DIE_REF, struct type *); -static struct symbol * - new_symbol PARAMS ((struct dieinfo *, struct objfile *)); +static struct symbol *new_symbol (struct dieinfo *, struct objfile *); static void -synthesize_typedef PARAMS ((struct dieinfo *, struct objfile *, - struct type *)); +synthesize_typedef (struct dieinfo *, struct objfile *, struct type *); -static int -locval PARAMS ((struct dieinfo *)); +static int locval (struct dieinfo *); -static void -set_cu_language PARAMS ((struct dieinfo *)); +static void set_cu_language (struct dieinfo *); -static struct type * - dwarf_fundamental_type PARAMS ((struct objfile *, int)); +static struct type *dwarf_fundamental_type (struct objfile *, int); /* diff --git a/gdb/elfread.c b/gdb/elfread.c index d63d16a30fa..edd4786d3ee 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -33,7 +33,7 @@ #include "complaints.h" #include "demangle.h" -extern void _initialize_elfread PARAMS ((void)); +extern void _initialize_elfread (void); /* The struct elfinfo is available only during ELF symbol table and psymtab reading. It is destroyed at the completion of psymtab-reading. @@ -64,32 +64,29 @@ struct complaint stab_info_mismatch_complaint = struct complaint stab_info_questionable_complaint = {"elf/stab section information questionable for %s", 0, 0}; -static void -elf_symfile_init PARAMS ((struct objfile *)); +static void elf_symfile_init (struct objfile *); -static void -elf_new_init PARAMS ((struct objfile *)); +static void elf_new_init (struct objfile *); -static void -elf_symfile_read PARAMS ((struct objfile *, int)); +static void elf_symfile_read (struct objfile *, int); -static void -elf_symfile_finish PARAMS ((struct objfile *)); +static void elf_symfile_finish (struct objfile *); -static void -elf_symtab_read PARAMS ((struct objfile *, int)); +static void elf_symtab_read (struct objfile *, int); -static void -free_elfinfo PARAMS ((void *)); +static void free_elfinfo (void *); -static struct minimal_symbol * - record_minimal_symbol_and_info PARAMS ((char *, CORE_ADDR, - enum minimal_symbol_type, char *, - asection * bfd_section, - struct objfile *)); +static struct minimal_symbol *record_minimal_symbol_and_info (char *, + CORE_ADDR, + enum + minimal_symbol_type, + char *, + asection * + bfd_section, + struct objfile + *); -static void -elf_locate_sections PARAMS ((bfd *, asection *, void *)); +static void elf_locate_sections (bfd *, asection *, void *); /* We are called once per section from elf_symfile_read. We need to examine each section we are passed, check to see @@ -191,18 +188,16 @@ record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section, { case mst_text: case mst_file_text: - section = SECT_OFF_TEXT; + section = bfd_section->index; #ifdef SMASH_TEXT_ADDRESS SMASH_TEXT_ADDRESS (address); #endif break; case mst_data: case mst_file_data: - section = SECT_OFF_DATA; - break; case mst_bss: case mst_file_bss: - section = SECT_OFF_BSS; + section = bfd_section->index; break; default: section = -1; @@ -293,8 +288,7 @@ elf_symtab_read (objfile, dynamic) if (number_of_symbols < 0) error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd), bfd_errmsg (bfd_get_error ())); - /* FIXME: Should use section specific offset, not SECT_OFF_TEXT. */ - offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + for (i = 0; i < number_of_symbols; i++) { sym = symbol_table[i]; @@ -305,6 +299,7 @@ elf_symtab_read (objfile, dynamic) continue; } + offset = ANOFFSET (objfile->section_offsets, sym->section->index); if (dynamic && sym->section == &bfd_und_section && (sym->flags & BSF_FUNCTION)) @@ -460,15 +455,15 @@ elf_symtab_read (objfile, dynamic) index = SECT_OFF_MAX; if (STREQ ("Bbss.bss", sym->name)) { - index = SECT_OFF_BSS; + index = SECT_OFF_BSS (objfile); } else if (STREQ ("Ddata.data", sym->name)) { - index = SECT_OFF_DATA; + index = SECT_OFF_DATA (objfile); } else if (STREQ ("Drodata.rodata", sym->name)) { - index = SECT_OFF_RODATA; + index = SECT_OFF_RODATA (objfile); } if (index != SECT_OFF_MAX) { @@ -593,7 +588,7 @@ elf_symfile_read (objfile, mainline) CORE_ADDR offset; init_minimal_symbol_collection (); - back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + back_to = make_cleanup_discard_minimal_symbols (); memset ((char *) &ei, 0, sizeof (ei)); diff --git a/gdb/environ.h b/gdb/environ.h index 0a6e848082a..b683e168aa8 100644 --- a/gdb/environ.h +++ b/gdb/environ.h @@ -34,26 +34,18 @@ struct environ char **vector; }; -extern struct environ * - make_environ PARAMS ((void)); +extern struct environ *make_environ (void); -extern void -free_environ PARAMS ((struct environ *)); +extern void free_environ (struct environ *); -extern void -init_environ PARAMS ((struct environ *)); +extern void init_environ (struct environ *); -extern char * - get_in_environ PARAMS ((const struct environ *, const char *)); +extern char *get_in_environ (const struct environ *, const char *); -extern void -set_in_environ PARAMS ((struct environ *, const char *, - const char *)); +extern void set_in_environ (struct environ *, const char *, const char *); -extern void -unset_in_environ PARAMS ((struct environ *, char *)); +extern void unset_in_environ (struct environ *, char *); -extern char ** - environ_vector PARAMS ((struct environ *)); +extern char **environ_vector (struct environ *); #endif /* defined (ENVIRON_H) */ diff --git a/gdb/eval.c b/gdb/eval.c index c2ff903d998..9cfac7b2eb6 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -43,24 +43,23 @@ extern int objectprint; /* Prototypes for local functions. */ -static value_ptr evaluate_subexp_for_sizeof PARAMS ((struct expression *, - int *)); +static value_ptr evaluate_subexp_for_sizeof (struct expression *, int *); -static value_ptr evaluate_subexp_for_address PARAMS ((struct expression *, - int *, enum noside)); +static value_ptr evaluate_subexp_for_address (struct expression *, + int *, enum noside); -static value_ptr evaluate_subexp PARAMS ((struct type *, struct expression *, - int *, enum noside)); +static value_ptr evaluate_subexp (struct type *, struct expression *, + int *, enum noside); -static char *get_label PARAMS ((struct expression *, int *)); +static char *get_label (struct expression *, int *); static value_ptr - evaluate_struct_tuple PARAMS ((value_ptr, struct expression *, int *, - enum noside, int)); +evaluate_struct_tuple (value_ptr, struct expression *, int *, + enum noside, int); static LONGEST - init_array_element PARAMS ((value_ptr, value_ptr, struct expression *, - int *, enum noside, LONGEST, LONGEST)); +init_array_element (value_ptr, value_ptr, struct expression *, + int *, enum noside, LONGEST, LONGEST); #if defined (__GNUC__) && !__STDC__ inline @@ -85,7 +84,7 @@ parse_and_eval_address (exp) struct expression *expr = parse_expression (exp); register CORE_ADDR addr; register struct cleanup *old_chain = - make_cleanup ((make_cleanup_func) free_current_contents, &expr); + make_cleanup (free_current_contents, &expr); addr = value_as_pointer (evaluate_expression (expr)); do_cleanups (old_chain); @@ -102,7 +101,7 @@ parse_and_eval_address_1 (expptr) struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0); register CORE_ADDR addr; register struct cleanup *old_chain = - make_cleanup ((make_cleanup_func) free_current_contents, &expr); + make_cleanup (free_current_contents, &expr); addr = value_as_pointer (evaluate_expression (expr)); do_cleanups (old_chain); @@ -116,7 +115,7 @@ parse_and_eval (exp) struct expression *expr = parse_expression (exp); register value_ptr val; register struct cleanup *old_chain - = make_cleanup ((make_cleanup_func) free_current_contents, &expr); + = make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); do_cleanups (old_chain); @@ -134,7 +133,7 @@ parse_to_comma_and_eval (expp) struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1); register value_ptr val; register struct cleanup *old_chain - = make_cleanup ((make_cleanup_func) free_current_contents, &expr); + = make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr); do_cleanups (old_chain); @@ -832,8 +831,9 @@ evaluate_subexp_standard (expect_type, exp, pos, noside) /* Method invocation : stuff "this" as first parameter */ /* pai: this used to have lookup_pointer_type for some reason, * but temp is already a pointer to the object */ - argvec[1] = value_from_longest (VALUE_TYPE (temp), - VALUE_ADDRESS (temp) + VALUE_OFFSET (temp)); + argvec[1] + = value_from_pointer (VALUE_TYPE (temp), + VALUE_ADDRESS (temp) + VALUE_OFFSET (temp)); /* Name of method from expression */ strcpy (tstr, &exp->elts[pc2 + 2].string); @@ -1122,7 +1122,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside) /* Now, convert these values to an address. */ arg1 = value_cast (lookup_pointer_type (TYPE_DOMAIN_TYPE (type)), arg1); - arg3 = value_from_longest (lookup_pointer_type (TYPE_TARGET_TYPE (type)), + arg3 = value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)), value_as_long (arg1) + mem_offset); return value_ind (arg3); bad_pointer_to_member: diff --git a/gdb/event-top.c b/gdb/event-top.c index 622b70f020d..34bf5dffc8c 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -487,7 +487,7 @@ command_handler (char *command) quit_flag = 0; if (instream == stdin && stdin_is_tty) reinitialize_more_filter (); - old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0); + old_chain = make_cleanup (command_loop_marker, 0); #if defined(TUI) insert_mode = 0; diff --git a/gdb/exec.c b/gdb/exec.c index 6381e63e358..76d49286647 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -45,29 +45,29 @@ #include "xcoffsolib.h" -struct vmap *map_vmap PARAMS ((bfd *, bfd *)); +struct vmap *map_vmap (bfd *, bfd *); -void (*file_changed_hook) PARAMS ((char *)); +void (*file_changed_hook) (char *); /* Prototypes for local functions */ -static void add_to_section_table PARAMS ((bfd *, sec_ptr, PTR)); +static void add_to_section_table (bfd *, sec_ptr, PTR); -static void exec_close PARAMS ((int)); +static void exec_close (int); -static void file_command PARAMS ((char *, int)); +static void file_command (char *, int); -static void set_section_command PARAMS ((char *, int)); +static void set_section_command (char *, int); -static void exec_files_info PARAMS ((struct target_ops *)); +static void exec_files_info (struct target_ops *); -static void bfdsec_to_vmap PARAMS ((bfd *, sec_ptr, PTR)); +static void bfdsec_to_vmap (bfd *, sec_ptr, PTR); -static int ignore PARAMS ((CORE_ADDR, char *)); +static int ignore (CORE_ADDR, char *); -static void init_exec_ops PARAMS ((void)); +static void init_exec_ops (void); -void _initialize_exec PARAMS ((void)); +void _initialize_exec (void); extern int info_verbose; @@ -473,7 +473,7 @@ xfer_memory (memaddr, myaddr, len, write, target) boolean res; struct section_table *p; CORE_ADDR nextsectaddr, memend; - boolean (*xfer_fn) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); + boolean (*xfer_fn) (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type); asection *section; if (len <= 0) @@ -490,49 +490,6 @@ xfer_memory (memaddr, myaddr, len, write, target) xfer_fn = write ? bfd_set_section_contents : bfd_get_section_contents; nextsectaddr = memend; -#if 0 /* Stu's implementation */ -/* If a section has been specified, try to use it. Note that we cannot use the - specified section directly. This is because it usually comes from the - symbol file, which may be different from the exec or core file. Instead, we - have to lookup the specified section by name in the bfd associated with - to_sections. */ - - if (target_memory_bfd_section) - { - asection *s; - bfd *abfd; - asection *target_section; - bfd *target_bfd; - - s = target_memory_bfd_section; - abfd = s->owner; - - target_bfd = target->to_sections->bfd; - target_section = bfd_get_section_by_name (target_bfd, bfd_section_name (abfd, s)); - - if (target_section) - { - bfd_vma sec_addr; - bfd_size_type sec_size; - - sec_addr = bfd_section_vma (target_bfd, target_section); - sec_size = target_section->_raw_size; - - /* Make sure the requested memory starts inside the section. */ - - if (memaddr >= sec_addr - && memaddr < sec_addr + sec_size) - { - /* Cut back length in case request overflows the end of the section. */ - len = min (len, sec_addr + sec_size - memaddr); - - res = xfer_fn (target_bfd, target_section, myaddr, memaddr - sec_addr, len); - - return res ? len : 0; - } - } - } -#endif /* 0, Stu's implementation */ for (p = target->to_sections; p < target->to_sections_end; p++) { if (overlay_debugging && section && p->the_bfd_section && diff --git a/gdb/expprint.c b/gdb/expprint.c index 4b5245cd64f..edf4f8c7fd7 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -504,7 +504,7 @@ op_string (op) /* Support for dumping the raw data from expressions in a human readable form. */ -static char *op_name PARAMS ((int opcode)); +static char *op_name (int opcode); static char * op_name (opcode) @@ -736,7 +736,8 @@ dump_prefix_expression (exp, stream, note) } } -static int dump_subexp PARAMS ((struct expression * exp, struct ui_file * stream, int elt)); +static int dump_subexp (struct expression *exp, struct ui_file *stream, + int elt); static int dump_subexp (exp, stream, elt) diff --git a/gdb/expression.h b/gdb/expression.h index 16dbb154500..1320643bb0d 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -333,9 +333,9 @@ struct expression /* From parse.c */ -extern struct expression *parse_expression PARAMS ((char *)); +extern struct expression *parse_expression (char *); -extern struct expression *parse_exp_1 PARAMS ((char **, struct block *, int)); +extern struct expression *parse_exp_1 (char **, struct block *, int); /* The innermost context required by the stack and register variables we've encountered so far. To use this, set it to NULL, then call @@ -362,13 +362,13 @@ enum noside }; extern struct value *evaluate_subexp_standard - PARAMS ((struct type *, struct expression *, int *, enum noside)); + (struct type *, struct expression *, int *, enum noside); /* From expprint.c */ extern void print_expression (struct expression *, struct ui_file *); -extern char *op_string PARAMS ((enum exp_opcode)); +extern char *op_string (enum exp_opcode); extern void dump_prefix_expression (struct expression *, struct ui_file *, diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 4a1f747605c..9e67561d34f 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -103,15 +103,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define YYDEBUG 1 /* Default to no yydebug support */ #endif -int yyparse PARAMS ((void)); +int yyparse (void); -static int yylex PARAMS ((void)); +static int yylex (void); -void yyerror PARAMS ((char *)); +void yyerror (char *); -static void growbuf_by_size PARAMS ((int)); +static void growbuf_by_size (int); -static int match_string_literal PARAMS ((void)); +static int match_string_literal (void); %} @@ -143,7 +143,7 @@ static int match_string_literal PARAMS ((void)); %{ /* YYSTYPE gets defined by %union */ -static int parse_number PARAMS ((char *, int, int, YYSTYPE *)); +static int parse_number (char *, int, int, YYSTYPE *); %} %type exp type_exp start variable diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 53d92ec1509..7a5f86109c5 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -68,23 +68,23 @@ typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR; /* Local functions */ -extern void _initialize_f_language PARAMS ((void)); +extern void _initialize_f_language (void); #if 0 -static void clear_function_list PARAMS ((void)); -static long get_bf_for_fcn PARAMS ((long)); -static void clear_bf_list PARAMS ((void)); -static void patch_all_commons_by_name PARAMS ((char *, CORE_ADDR, int)); -static SAVED_F77_COMMON_PTR find_first_common_named PARAMS ((char *)); -static void add_common_entry PARAMS ((struct symbol *)); -static void add_common_block PARAMS ((char *, CORE_ADDR, int, char *)); -static SAVED_FUNCTION *allocate_saved_function_node PARAMS ((void)); -static SAVED_BF_PTR allocate_saved_bf_node PARAMS ((void)); -static COMMON_ENTRY_PTR allocate_common_entry_node PARAMS ((void)); -static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node PARAMS ((void)); -static void patch_common_entries PARAMS ((SAVED_F77_COMMON_PTR, CORE_ADDR, int)); +static void clear_function_list (void); +static long get_bf_for_fcn (long); +static void clear_bf_list (void); +static void patch_all_commons_by_name (char *, CORE_ADDR, int); +static SAVED_F77_COMMON_PTR find_first_common_named (char *); +static void add_common_entry (struct symbol *); +static void add_common_block (char *, CORE_ADDR, int, char *); +static SAVED_FUNCTION *allocate_saved_function_node (void); +static SAVED_BF_PTR allocate_saved_bf_node (void); +static COMMON_ENTRY_PTR allocate_common_entry_node (void); +static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void); +static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int); #endif -static struct type *f_create_fundamental_type PARAMS ((struct objfile *, int)); +static struct type *f_create_fundamental_type (struct objfile *, int); static void f_printstr (struct ui_file * stream, char *string, unsigned int length, int width, int force_ellipses); diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 0dbe55f3aee..8b3fa6b5a3c 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern int f_parse PARAMS ((void)); +extern int f_parse (void); -extern void f_error PARAMS ((char *)); /* Defined in f-exp.y */ +extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, char *, struct ui_file *, int, int); @@ -60,7 +60,7 @@ extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */ extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */ extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */ -extern SAVED_F77_COMMON_PTR find_common_for_function PARAMS ((char *, char *)); +extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *); #define UNINITIALIZED_SECNUM -1 #define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM) @@ -83,13 +83,13 @@ extern SAVED_F77_COMMON_PTR find_common_for_function PARAMS ((char *, char *)); extern char *real_main_name; /* Name of main function */ extern int real_main_c_value; /* C_value field of main function */ -extern int f77_get_dynamic_upperbound PARAMS ((struct type *, int *)); +extern int f77_get_dynamic_upperbound (struct type *, int *); -extern int f77_get_dynamic_lowerbound PARAMS ((struct type *, int *)); +extern int f77_get_dynamic_lowerbound (struct type *, int *); -extern void f77_get_dynamic_array_length PARAMS ((struct type *)); +extern void f77_get_dynamic_array_length (struct type *); -extern int calc_f77_array_dims PARAMS ((struct type *)); +extern int calc_f77_array_dims (struct type *); #define DEFAULT_DOTMAIN_NAME_IN_MF77 ".MAIN_" #define DEFAULT_MAIN_NAME_IN_MF77 "MAIN_" diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index a007c871c1e..a91766d8a5b 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -35,12 +35,12 @@ #include "command.h" #if 0 -static int there_is_a_visible_common_named PARAMS ((char *)); +static int there_is_a_visible_common_named (char *); #endif -extern void _initialize_f_valprint PARAMS ((void)); -static void info_common_command PARAMS ((char *, int)); -static void list_all_visible_commons PARAMS ((char *)); +extern void _initialize_f_valprint (void); +static void info_common_command (char *, int); +static void list_all_visible_commons (char *); static void f77_print_array (struct type *, char *, CORE_ADDR, struct ui_file *, int, int, int, enum val_prettyprint); @@ -49,7 +49,7 @@ static void f77_print_array_1 (int, int, struct type *, char *, enum val_prettyprint); static void f77_create_arrayprint_offset_tbl (struct type *, struct ui_file *); -static void f77_get_dynamic_length_of_aggregate PARAMS ((struct type *)); +static void f77_get_dynamic_length_of_aggregate (struct type *); int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; @@ -564,7 +564,7 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, fputs_filtered ("(", stream); print_floating (valaddr, type, stream); fputs_filtered (",", stream); - print_floating (valaddr, type, stream); + print_floating (valaddr + TYPE_LENGTH (type), type, stream); fputs_filtered (")", stream); break; diff --git a/gdb/findvar.c b/gdb/findvar.c index 98a7133b79f..5571ede4a66 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -42,9 +42,12 @@ const struct floatformat floatformat_unknown; #define CANNOT_STORE_REGISTER(regno) 0 #endif -static void write_register_gen PARAMS ((int, char *)); +void write_register_gen (int, char *); -static int read_relative_register_raw_bytes_for_frame PARAMS ((int regnum, char *myaddr, struct frame_info * frame)); +static int +read_relative_register_raw_bytes_for_frame (int regnum, + char *myaddr, + struct frame_info *frame); /* Basic byte-swapping routines. GDB has needed these for a long time... All extract a target-format integer at ADDR which is LEN bytes long. */ @@ -169,6 +172,20 @@ extract_long_unsigned_integer (void *addr, int orig_len, LONGEST *pval) return 0; } + +/* Treat the LEN bytes at ADDR as a target-format address, and return + that address. ADDR is a buffer in the GDB process, not in the + inferior. + + This function should only be used by target-specific code. It + assumes that a pointer has the same representation as that thing's + address represented as an integer. Some machines use word + addresses, or similarly munged things, for certain types of + pointers, so that assumption doesn't hold everywhere. + + Common code should use extract_typed_address instead, or something + else based on POINTER_TO_ADDRESS. */ + CORE_ADDR extract_address (void *addr, int len) { @@ -177,6 +194,21 @@ extract_address (void *addr, int len) return (CORE_ADDR) extract_unsigned_integer (addr, len); } + +/* Treat the bytes at BUF as a pointer of type TYPE, and return the + address it represents. */ +CORE_ADDR +extract_typed_address (void *buf, struct type *type) +{ + if (TYPE_CODE (type) != TYPE_CODE_PTR + && TYPE_CODE (type) != TYPE_CODE_REF) + internal_error ("findvar.c (extract_typed_address): " + "type is not a pointer or reference"); + + return POINTER_TO_ADDRESS (type, buf); +} + + void store_signed_integer (void *addr, int len, LONGEST val) { @@ -231,14 +263,39 @@ store_unsigned_integer (void *addr, int len, ULONGEST val) } } -/* Store the literal address "val" into - gdb-local memory pointed to by "addr" - for "len" bytes. */ +/* Store the address VAL as a LEN-byte value in target byte order at + ADDR. ADDR is a buffer in the GDB process, not in the inferior. + + This function should only be used by target-specific code. It + assumes that a pointer has the same representation as that thing's + address represented as an integer. Some machines use word + addresses, or similarly munged things, for certain types of + pointers, so that assumption doesn't hold everywhere. + + Common code should use store_typed_address instead, or something else + based on ADDRESS_TO_POINTER. */ void store_address (void *addr, int len, LONGEST val) { store_unsigned_integer (addr, len, val); } + + +/* Store the address ADDR as a pointer of type TYPE at BUF, in target + form. */ +void +store_typed_address (void *buf, struct type *type, CORE_ADDR addr) +{ + if (TYPE_CODE (type) != TYPE_CODE_PTR + && TYPE_CODE (type) != TYPE_CODE_REF) + internal_error ("findvar.c (store_typed_address): " + "type is not a pointer or reference"); + + ADDRESS_TO_POINTER (type, buf, addr); +} + + + /* Extract a floating-point number from a target-order byte-stream at ADDR. Returns the value as type DOUBLEST. @@ -445,7 +502,8 @@ default_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) if (raw_buffer != NULL) { /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), (LONGEST) addr); + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), + (LONGEST) addr); } if (addrp != NULL) *addrp = 0; @@ -722,7 +780,7 @@ read_register_gen (regno, myaddr) /* Write register REGNO at MYADDR to the target. MYADDR points at REGISTER_RAW_BYTES(REGNO), which must be in target byte-order. */ -static void +void write_register_gen (regno, myaddr) int regno; char *myaddr; @@ -831,8 +889,9 @@ read_register (regno) if (!register_valid[regno]) target_fetch_registers (regno); - return (CORE_ADDR) extract_address (®isters[REGISTER_BYTE (regno)], - REGISTER_RAW_SIZE (regno)); + return ((CORE_ADDR) + extract_unsigned_integer (®isters[REGISTER_BYTE (regno)], + REGISTER_RAW_SIZE (regno))); } CORE_ADDR @@ -1023,14 +1082,10 @@ generic_target_write_pc (pc, pid) #ifdef PC_REGNUM if (PC_REGNUM >= 0) write_register_pid (PC_REGNUM, pc, pid); -#ifdef NPC_REGNUM if (NPC_REGNUM >= 0) write_register_pid (NPC_REGNUM, pc + 4, pid); -#ifdef NNPC_REGNUM if (NNPC_REGNUM >= 0) write_register_pid (NNPC_REGNUM, pc + 8, pid); -#endif -#endif #else internal_error ("generic_target_write_pc"); #endif @@ -1150,6 +1205,35 @@ write_fp (val) { TARGET_WRITE_FP (val); } + + +/* Given a pointer of type TYPE in target form in BUF, return the + address it represents. */ +CORE_ADDR +unsigned_pointer_to_address (struct type *type, void *buf) +{ + return extract_address (buf, TYPE_LENGTH (type)); +} + +CORE_ADDR +signed_pointer_to_address (struct type *type, void *buf) +{ + return extract_signed_integer (buf, TYPE_LENGTH (type)); +} + +/* Given an address, store it as a pointer of type TYPE in target + format in BUF. */ +void +unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) +{ + store_address (buf, TYPE_LENGTH (type), addr); +} + +void +address_to_signed_pointer (struct type *type, void *buf, CORE_ADDR addr) +{ + store_signed_integer (buf, TYPE_LENGTH (type), addr); +} /* Will calling read_var_value or locate_var_value on SYM end up caring what frame it is being evaluated relative to? SYM must @@ -1231,12 +1315,15 @@ read_var_value (var, frame) case LOC_LABEL: /* Put the constant back in target format. */ if (overlay_debugging) - store_address (VALUE_CONTENTS_RAW (v), len, - (LONGEST) symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), - SYMBOL_BFD_SECTION (var))); + { + CORE_ADDR addr + = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), + SYMBOL_BFD_SECTION (var)); + store_typed_address (VALUE_CONTENTS_RAW (v), type, addr); + } else - store_address (VALUE_CONTENTS_RAW (v), len, - (LONGEST) SYMBOL_VALUE_ADDRESS (var)); + store_typed_address (VALUE_CONTENTS_RAW (v), type, + SYMBOL_VALUE_ADDRESS (var)); VALUE_LVAL (v) = not_lval; return v; @@ -1399,7 +1486,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i } /* Return a value of type TYPE, stored in register REGNUM, in frame - FRAME. + FRAME. NOTE: returns NULL if register value is not available. Caller will check return value or die! */ @@ -1423,7 +1510,8 @@ value_from_register (type, regnum, frame) CHECK_TYPEDEF (type); len = TYPE_LENGTH (type); - /* Pointers on D10V are really only 16 bits, but we lie to gdb elsewhere... */ + /* Pointers on D10V are really only 16 bits, + but we lie to gdb elsewhere... */ if (GDB_TARGET_IS_D10V && TYPE_CODE (type) == TYPE_CODE_PTR) len = 2; @@ -1626,25 +1714,20 @@ value_from_register (type, regnum, frame) } if (GDB_TARGET_IS_D10V - && TYPE_CODE (type) == TYPE_CODE_PTR - && TYPE_TARGET_TYPE (type) - && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)) + && TYPE_CODE (type) == TYPE_CODE_PTR) { - /* pointer to function */ unsigned long num; unsigned short snum; - snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2); - num = D10V_MAKE_IADDR (snum); - store_address (VALUE_CONTENTS_RAW (v), 4, num); - } - else if (GDB_TARGET_IS_D10V - && TYPE_CODE (type) == TYPE_CODE_PTR) - { - /* pointer to data */ - unsigned long num; - unsigned short snum; - snum = (unsigned short) extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2); - num = D10V_MAKE_DADDR (snum); + + snum = (unsigned short) + extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2); + + if (TYPE_TARGET_TYPE (type) /* pointer to function */ + && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)) + num = D10V_MAKE_IADDR (snum); + else /* pointer to data */ + num = D10V_MAKE_DADDR (snum); + store_address (VALUE_CONTENTS_RAW (v), 4, num); } @@ -1678,7 +1761,7 @@ locate_var_value (var, frame) value_ptr val; addr = VALUE_ADDRESS (lazy_value); - val = value_from_longest (lookup_pointer_type (type), (LONGEST) addr); + val = value_from_pointer (lookup_pointer_type (type), addr); VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (lazy_value); return val; } @@ -1701,7 +1784,7 @@ locate_var_value (var, frame) } -static void build_findvar PARAMS ((void)); +static void build_findvar (void); static void build_findvar () { @@ -1715,7 +1798,7 @@ build_findvar () memset (register_valid, 0, sizeof_register_valid); } -void _initialize_findvar PARAMS ((void)); +void _initialize_findvar (void); void _initialize_findvar () { diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 1acb28ad422..0996fbd4590 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -103,9 +103,9 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun, char *exec_file; char *allargs; char **env; - void (*traceme_fun) PARAMS ((void)); - void (*init_trace_fun) PARAMS ((int)); - void (*pre_trace_fun) PARAMS ((void)); + void (*traceme_fun) (void); + void (*init_trace_fun) (int); + void (*pre_trace_fun) (void); char *shell_file; { int pid; diff --git a/gdb/fr30-tdep.c b/gdb/fr30-tdep.c index 55b713a1359..c35201d3372 100644 --- a/gdb/fr30-tdep.c +++ b/gdb/fr30-tdep.c @@ -242,7 +242,7 @@ fr30_push_arguments (nargs, args, sp, struct_return, struct_addr) return sp; } -void _initialize_fr30_tdep PARAMS ((void)); +void _initialize_fr30_tdep (void); void _initialize_fr30_tdep () diff --git a/gdb/frame.h b/gdb/frame.h index f82ae362d30..37fa97ccc34 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -118,8 +118,8 @@ enum print_what #ifndef SIZEOF_FRAME_SAVED_REGS #define SIZEOF_FRAME_SAVED_REGS (sizeof (CORE_ADDR) * (NUM_REGS)) #endif -extern void *frame_obstack_alloc PARAMS ((unsigned long size)); -extern void frame_saved_regs_zalloc PARAMS ((struct frame_info *)); +extern void *frame_obstack_alloc (unsigned long size); +extern void frame_saved_regs_zalloc (struct frame_info *); /* Return the frame address from FR. Except in the machine-dependent *FRAME* macros, a frame address has no defined meaning other than @@ -148,10 +148,10 @@ extern void frame_saved_regs_zalloc PARAMS ((struct frame_info *)); extern int file_frame_chain_valid (CORE_ADDR, struct frame_info *); extern int func_frame_chain_valid (CORE_ADDR, struct frame_info *); -extern int nonnull_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); +extern int nonnull_frame_chain_valid (CORE_ADDR, struct frame_info *); extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *); extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *); -extern void generic_save_dummy_frame_tos PARAMS ((CORE_ADDR sp)); +extern void generic_save_dummy_frame_tos (CORE_ADDR sp); #if !defined (FRAME_CHAIN_VALID) #if !defined (FRAME_CHAIN_VALID_ALTERNATE) @@ -175,94 +175,94 @@ extern struct frame_info *selected_frame; extern int selected_frame_level; -extern struct frame_info *create_new_frame PARAMS ((CORE_ADDR, CORE_ADDR)); +extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR); -extern void flush_cached_frames PARAMS ((void)); +extern void flush_cached_frames (void); -extern void reinit_frame_cache PARAMS ((void)); +extern void reinit_frame_cache (void); #ifdef FRAME_FIND_SAVED_REGS /* XXX - deprecated */ #define FRAME_INIT_SAVED_REGS(FI) get_frame_saved_regs (FI, NULL) -extern void get_frame_saved_regs PARAMS ((struct frame_info *, - struct frame_saved_regs *)); +extern void get_frame_saved_regs (struct frame_info *, + struct frame_saved_regs *); #endif -extern void set_current_frame PARAMS ((struct frame_info *)); +extern void set_current_frame (struct frame_info *); -extern struct frame_info *get_prev_frame PARAMS ((struct frame_info *)); +extern struct frame_info *get_prev_frame (struct frame_info *); -extern struct frame_info *get_current_frame PARAMS ((void)); +extern struct frame_info *get_current_frame (void); -extern struct frame_info *get_next_frame PARAMS ((struct frame_info *)); +extern struct frame_info *get_next_frame (struct frame_info *); -extern struct block *get_frame_block PARAMS ((struct frame_info *)); +extern struct block *get_frame_block (struct frame_info *); -extern struct block *get_current_block PARAMS ((void)); +extern struct block *get_current_block (void); -extern struct block *get_selected_block PARAMS ((void)); +extern struct block *get_selected_block (void); -extern struct symbol *get_frame_function PARAMS ((struct frame_info *)); +extern struct symbol *get_frame_function (struct frame_info *); -extern CORE_ADDR get_frame_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR get_frame_pc (struct frame_info *); -extern CORE_ADDR get_pc_function_start PARAMS ((CORE_ADDR)); +extern CORE_ADDR get_pc_function_start (CORE_ADDR); -extern struct block *block_for_pc PARAMS ((CORE_ADDR)); +extern struct block *block_for_pc (CORE_ADDR); -extern struct block *block_for_pc_sect PARAMS ((CORE_ADDR, asection *)); +extern struct block *block_for_pc_sect (CORE_ADDR, asection *); -extern int frameless_look_for_prologue PARAMS ((struct frame_info *)); +extern int frameless_look_for_prologue (struct frame_info *); -extern void print_frame_args PARAMS ((struct symbol *, struct frame_info *, - int, struct ui_file *)); +extern void print_frame_args (struct symbol *, struct frame_info *, + int, struct ui_file *); -extern struct frame_info *find_relative_frame PARAMS ((struct frame_info *, int *)); +extern struct frame_info *find_relative_frame (struct frame_info *, int *); -extern void show_and_print_stack_frame PARAMS ((struct frame_info * fi, int level, int source)); +extern void show_and_print_stack_frame (struct frame_info *fi, int level, + int source); -extern void print_stack_frame PARAMS ((struct frame_info *, int, int)); +extern void print_stack_frame (struct frame_info *, int, int); -extern void print_only_stack_frame PARAMS ((struct frame_info *, int, int)); +extern void print_only_stack_frame (struct frame_info *, int, int); -extern void show_stack_frame PARAMS ((struct frame_info *)); +extern void show_stack_frame (struct frame_info *); -extern void select_frame PARAMS ((struct frame_info *, int)); +extern void select_frame (struct frame_info *, int); -extern void record_selected_frame PARAMS ((CORE_ADDR *, int *)); +extern void record_selected_frame (CORE_ADDR *, int *); -extern void select_and_print_frame PARAMS ((struct frame_info *, int)); +extern void select_and_print_frame (struct frame_info *, int); -extern void print_frame_info PARAMS ((struct frame_info *, int, int, int)); +extern void print_frame_info (struct frame_info *, int, int, int); -extern void show_frame_info PARAMS ((struct frame_info *, int, int, int)); +extern void show_frame_info (struct frame_info *, int, int, int); -extern CORE_ADDR find_saved_register PARAMS ((struct frame_info *, int)); +extern CORE_ADDR find_saved_register (struct frame_info *, int); -extern struct frame_info *block_innermost_frame PARAMS ((struct block *)); +extern struct frame_info *block_innermost_frame (struct block *); -extern struct frame_info *find_frame_addr_in_frame_chain PARAMS ((CORE_ADDR)); +extern struct frame_info *find_frame_addr_in_frame_chain (CORE_ADDR); -extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *)); +extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); -extern CORE_ADDR generic_read_register_dummy PARAMS ((CORE_ADDR pc, - CORE_ADDR fp, - int)); -extern void generic_push_dummy_frame PARAMS ((void)); -extern void generic_pop_current_frame PARAMS ((void (*)(struct frame_info *))); -extern void generic_pop_dummy_frame PARAMS ((void)); +extern CORE_ADDR generic_read_register_dummy (CORE_ADDR pc, + CORE_ADDR fp, int); +extern void generic_push_dummy_frame (void); +extern void generic_pop_current_frame (void (*)(struct frame_info *)); +extern void generic_pop_dummy_frame (void); -extern int generic_pc_in_call_dummy PARAMS ((CORE_ADDR pc, - CORE_ADDR sp, - CORE_ADDR fp)); -extern char *generic_find_dummy_frame PARAMS ((CORE_ADDR pc, - CORE_ADDR fp)); +extern int generic_pc_in_call_dummy (CORE_ADDR pc, + CORE_ADDR sp, CORE_ADDR fp); +extern char *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp); -extern void generic_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, - int nargs, struct value ** args, - struct type * type, int gcc_p)); +extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, + int nargs, struct value **args, + struct type *type, int gcc_p); -extern void generic_get_saved_register PARAMS ((char *, int *, CORE_ADDR *, struct frame_info *, int, enum lval_type *)); +extern void generic_get_saved_register (char *, int *, CORE_ADDR *, + struct frame_info *, int, + enum lval_type *); #endif /* !defined (FRAME_H) */ diff --git a/gdb/gdb-stabs.h b/gdb/gdb-stabs.h index 92301f14123..3ec13930f5d 100644 --- a/gdb/gdb-stabs.h +++ b/gdb/gdb-stabs.h @@ -28,16 +28,7 @@ #if !defined (GDBSTABS_H) #define GDBSTABS_H -/* Offsets in the psymtab's section_offsets array for various kinds of - stabs symbols. Every psymtab built from stabs will have these offsets - filled in by these guidelines, so that when actually reading symbols, the - proper offset can simply be selected and added to the symbol value. */ - -#define SECT_OFF_TEXT 0 -#define SECT_OFF_DATA 1 -#define SECT_OFF_BSS 2 -#define SECT_OFF_RODATA 3 -#define SECT_OFF_MAX 16 /* Count of possible values */ +#define SECT_OFF_MAX 40 /* Count of possible values */ /* The stab_section_info chain remembers info from the ELF symbol table, while psymtabs are being built for the other symbol tables in the diff --git a/gdb/gdb_dirent.h b/gdb/gdb_dirent.h new file mode 100644 index 00000000000..9cb40061420 --- /dev/null +++ b/gdb/gdb_dirent.h @@ -0,0 +1,40 @@ +/* Portable + Copyright 2000 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#if !defined(GDB_DIRENT_H) +#define GDB_DIRENT_H + +/* From bfd/hpux-core.c. */ + +#ifdef HAVE_DIRENT_H +# include +#else +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +#endif + +#endif /* !defined(GDB_DIRENT_H) */ diff --git a/gdb/gdb_string.h b/gdb/gdb_string.h index 9824f1f8c92..e6417b59078 100644 --- a/gdb/gdb_string.h +++ b/gdb/gdb_string.h @@ -31,15 +31,15 @@ #endif #ifndef strchr -extern char *strchr PARAMS ((const char *, int)); /* X3.159-1989 4.11.5.2 */ +extern char *strchr (const char *, int); /* X3.159-1989 4.11.5.2 */ #endif #ifndef strrchr -extern char *strrchr PARAMS ((const char *, int)); /* X3.159-1989 4.11.5.5 */ +extern char *strrchr (const char *, int); /* X3.159-1989 4.11.5.5 */ #endif #ifndef strtok -extern char *strtok PARAMS ((char *, const char *)); /* X3.159-1989 4.11.5.8 */ +extern char *strtok (char *, const char *); /* X3.159-1989 4.11.5.8 */ #endif #ifdef HAVE_MEMORY_H @@ -54,7 +54,7 @@ extern int memcmp (); #ifdef NEED_DECLARATION_STRERROR #ifndef strerror -extern char *strerror PARAMS ((int)); /* X3.159-1989 4.11.6.2 */ +extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ #endif #endif @@ -64,7 +64,7 @@ extern char *strdup (); /* full prototype collides w/ some OSes (AIX 3.2.5) */ #ifdef NEED_DECLARATION_STRSTR #ifndef strstr -extern char *strstr PARAMS ((const char *, const char *)); /* X3.159-1989 4.11.5.7 */ +extern char *strstr (const char *, const char *); /* X3.159-1989 4.11.5.7 */ #endif #endif diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 98e0743374b..55afe114e6a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -58,6 +58,7 @@ #endif #include "symcat.h" +#include "floatformat.h" /* Static function declarations */ @@ -135,6 +136,7 @@ struct gdbarch int float_bit; int double_bit; int long_double_bit; + int ieee_float; gdbarch_read_pc_ftype *read_pc; gdbarch_write_pc_ftype *write_pc; gdbarch_read_fp_ftype *read_fp; @@ -145,6 +147,9 @@ struct gdbarch int sp_regnum; int fp_regnum; int pc_regnum; + int fp0_regnum; + int npc_regnum; + int nnpc_regnum; gdbarch_register_name_ftype *register_name; int register_size; int register_bytes; @@ -175,6 +180,9 @@ struct gdbarch gdbarch_register_convertible_ftype *register_convertible; gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual; gdbarch_register_convert_to_raw_ftype *register_convert_to_raw; + gdbarch_pointer_to_address_ftype *pointer_to_address; + gdbarch_address_to_pointer_ftype *address_to_pointer; + gdbarch_return_value_on_stack_ftype *return_value_on_stack; gdbarch_extract_return_value_ftype *extract_return_value; gdbarch_push_arguments_ftype *push_arguments; gdbarch_push_dummy_frame_ftype *push_dummy_frame; @@ -193,6 +201,7 @@ struct gdbarch gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs; gdbarch_init_extra_frame_info_ftype *init_extra_frame_info; gdbarch_skip_prologue_ftype *skip_prologue; + gdbarch_prologue_frameless_p_ftype *prologue_frameless_p; gdbarch_inner_than_ftype *inner_than; gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; @@ -209,6 +218,12 @@ struct gdbarch gdbarch_frame_locals_address_ftype *frame_locals_address; gdbarch_saved_pc_after_call_ftype *saved_pc_after_call; gdbarch_frame_num_args_ftype *frame_num_args; + gdbarch_stack_align_ftype *stack_align; + gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr; + gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos; + const struct floatformat * float_format; + const struct floatformat * double_format; + const struct floatformat * long_double_format; }; @@ -271,6 +286,10 @@ struct gdbarch startup_gdbarch = { 0, 0, 0, + 0, + 0, + 0, + 0, generic_get_saved_register, 0, 0, @@ -309,6 +328,16 @@ struct gdbarch startup_gdbarch = { 0, 0, 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, /* startup_gdbarch() */ }; struct gdbarch *current_gdbarch = &startup_gdbarch; @@ -335,6 +364,9 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->sp_regnum = -1; gdbarch->fp_regnum = -1; gdbarch->pc_regnum = -1; + gdbarch->fp0_regnum = -1; + gdbarch->npc_regnum = -1; + gdbarch->nnpc_regnum = -1; gdbarch->register_name = legacy_register_name; gdbarch->register_size = -1; gdbarch->register_bytes = -1; @@ -351,6 +383,10 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->call_dummy_stack_adjust_p = -1; gdbarch->coerce_float_to_double = default_coerce_float_to_double; gdbarch->register_convertible = generic_register_convertible_not; + gdbarch->pointer_to_address = unsigned_pointer_to_address; + gdbarch->address_to_pointer = unsigned_address_to_pointer; + gdbarch->return_value_on_stack = generic_return_value_on_stack_not; + gdbarch->prologue_frameless_p = generic_prologue_frameless_p; gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc; gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; @@ -417,6 +453,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH >= 1) && (gdbarch->long_double_bit == 0)) internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid"); + /* Skip verify of ieee_float, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->read_pc == 0)) internal_error ("gdbarch: verify_gdbarch: read_pc invalid"); @@ -447,6 +484,9 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pc_regnum == -1)) internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid"); + /* Skip verify of fp0_regnum, invalid_p == 0 */ + /* Skip verify of npc_regnum, invalid_p == 0 */ + /* Skip verify of nnpc_regnum, invalid_p == 0 */ /* Skip verify of register_name, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_size == -1)) @@ -517,6 +557,9 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of register_convertible, invalid_p == 0 */ /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ /* Skip verify of register_convert_to_raw, invalid_p == 0 */ + /* Skip verify of pointer_to_address, invalid_p == 0 */ + /* Skip verify of address_to_pointer, invalid_p == 0 */ + /* Skip verify of return_value_on_stack, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->extract_return_value == 0)) internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid"); @@ -534,18 +577,10 @@ verify_gdbarch (struct gdbarch *gdbarch) internal_error ("gdbarch: verify_gdbarch: pop_frame invalid"); /* Skip verify of d10v_make_daddr, invalid_p == 0 */ /* Skip verify of d10v_make_iaddr, invalid_p == 0 */ - if ((GDB_MULTI_ARCH >= 2) - && (gdbarch->d10v_daddr_p == 0)) - internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid"); - if ((GDB_MULTI_ARCH >= 2) - && (gdbarch->d10v_iaddr_p == 0)) - internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid"); - if ((GDB_MULTI_ARCH >= 2) - && (gdbarch->d10v_convert_daddr_to_raw == 0)) - internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid"); - if ((GDB_MULTI_ARCH >= 2) - && (gdbarch->d10v_convert_iaddr_to_raw == 0)) - internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid"); + /* Skip verify of d10v_daddr_p, invalid_p == 0 */ + /* Skip verify of d10v_iaddr_p, invalid_p == 0 */ + /* Skip verify of d10v_convert_daddr_to_raw, invalid_p == 0 */ + /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->store_struct_return == 0)) internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid"); @@ -567,6 +602,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH >= 2) && (gdbarch->skip_prologue == 0)) internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid"); + /* Skip verify of prologue_frameless_p, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->inner_than == 0)) internal_error ("gdbarch: verify_gdbarch: inner_than invalid"); @@ -605,6 +641,15 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_num_args == 0)) internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid"); + /* Skip verify of stack_align, has predicate */ + /* Skip verify of reg_struct_has_addr, has predicate */ + /* Skip verify of save_dummy_frame_tos, has predicate */ + if (gdbarch->float_format == 0) + gdbarch->float_format = default_float_format (gdbarch); + if (gdbarch->double_format == 0) + gdbarch->double_format = default_double_format (gdbarch); + if (gdbarch->long_double_format == 0) + gdbarch->long_double_format = &floatformat_unknown; } @@ -613,155 +658,263 @@ verify_gdbarch (struct gdbarch *gdbarch) void gdbarch_dump (void) { +#ifdef TARGET_ARCHITECTURE if (TARGET_ARCHITECTURE != NULL) fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_ARCHITECTURE = %s\n", TARGET_ARCHITECTURE->printable_name); +#endif +#ifdef TARGET_BYTE_ORDER fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_BYTE_ORDER = %ld\n", (long) TARGET_BYTE_ORDER); +#endif +#ifdef TARGET_BFD_VMA_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_BFD_VMA_BIT = %ld\n", (long) TARGET_BFD_VMA_BIT); +#endif +#ifdef TARGET_PTR_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_PTR_BIT = %ld\n", (long) TARGET_PTR_BIT); +#endif +#ifdef TARGET_SHORT_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_SHORT_BIT = %ld\n", (long) TARGET_SHORT_BIT); +#endif +#ifdef TARGET_INT_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_INT_BIT = %ld\n", (long) TARGET_INT_BIT); +#endif +#ifdef TARGET_LONG_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_LONG_BIT = %ld\n", (long) TARGET_LONG_BIT); +#endif +#ifdef TARGET_LONG_LONG_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_LONG_LONG_BIT = %ld\n", (long) TARGET_LONG_LONG_BIT); +#endif +#ifdef TARGET_FLOAT_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_FLOAT_BIT = %ld\n", (long) TARGET_FLOAT_BIT); +#endif +#ifdef TARGET_DOUBLE_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_DOUBLE_BIT = %ld\n", (long) TARGET_DOUBLE_BIT); +#endif +#ifdef TARGET_LONG_DOUBLE_BIT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_LONG_DOUBLE_BIT = %ld\n", (long) TARGET_LONG_DOUBLE_BIT); +#endif +#ifdef IEEE_FLOAT + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: IEEE_FLOAT = %ld\n", + (long) IEEE_FLOAT); +#endif +#ifdef TARGET_READ_PC fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_READ_PC = 0x%08lx\n", (long) current_gdbarch->read_pc /*TARGET_READ_PC ()*/); +#endif +#ifdef TARGET_WRITE_PC fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_WRITE_PC = 0x%08lx\n", (long) current_gdbarch->write_pc /*TARGET_WRITE_PC ()*/); +#endif +#ifdef TARGET_READ_FP fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_READ_FP = 0x%08lx\n", (long) current_gdbarch->read_fp /*TARGET_READ_FP ()*/); +#endif +#ifdef TARGET_WRITE_FP fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_WRITE_FP = 0x%08lx\n", (long) current_gdbarch->write_fp /*TARGET_WRITE_FP ()*/); +#endif +#ifdef TARGET_READ_SP fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_READ_SP = 0x%08lx\n", (long) current_gdbarch->read_sp /*TARGET_READ_SP ()*/); +#endif +#ifdef TARGET_WRITE_SP fprintf_unfiltered (gdb_stdlog, "gdbarch_update: TARGET_WRITE_SP = 0x%08lx\n", (long) current_gdbarch->write_sp /*TARGET_WRITE_SP ()*/); +#endif +#ifdef NUM_REGS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: NUM_REGS = %ld\n", (long) NUM_REGS); +#endif +#ifdef SP_REGNUM fprintf_unfiltered (gdb_stdlog, "gdbarch_update: SP_REGNUM = %ld\n", (long) SP_REGNUM); +#endif +#ifdef FP_REGNUM fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FP_REGNUM = %ld\n", (long) FP_REGNUM); +#endif +#ifdef PC_REGNUM fprintf_unfiltered (gdb_stdlog, "gdbarch_update: PC_REGNUM = %ld\n", (long) PC_REGNUM); +#endif +#ifdef FP0_REGNUM + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: FP0_REGNUM = %ld\n", + (long) FP0_REGNUM); +#endif +#ifdef NPC_REGNUM + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: NPC_REGNUM = %ld\n", + (long) NPC_REGNUM); +#endif +#ifdef NNPC_REGNUM + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: NNPC_REGNUM = %ld\n", + (long) NNPC_REGNUM); +#endif +#ifdef REGISTER_NAME fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_NAME = 0x%08lx\n", (long) current_gdbarch->register_name /*REGISTER_NAME ()*/); +#endif +#ifdef REGISTER_SIZE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_SIZE = %ld\n", (long) REGISTER_SIZE); +#endif +#ifdef REGISTER_BYTES fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_BYTES = %ld\n", (long) REGISTER_BYTES); +#endif +#ifdef REGISTER_BYTE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_BYTE = 0x%08lx\n", (long) current_gdbarch->register_byte /*REGISTER_BYTE ()*/); +#endif +#ifdef REGISTER_RAW_SIZE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_RAW_SIZE = 0x%08lx\n", (long) current_gdbarch->register_raw_size /*REGISTER_RAW_SIZE ()*/); +#endif +#ifdef MAX_REGISTER_RAW_SIZE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: MAX_REGISTER_RAW_SIZE = %ld\n", (long) MAX_REGISTER_RAW_SIZE); +#endif +#ifdef REGISTER_VIRTUAL_SIZE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_VIRTUAL_SIZE = 0x%08lx\n", (long) current_gdbarch->register_virtual_size /*REGISTER_VIRTUAL_SIZE ()*/); +#endif +#ifdef MAX_REGISTER_VIRTUAL_SIZE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: MAX_REGISTER_VIRTUAL_SIZE = %ld\n", (long) MAX_REGISTER_VIRTUAL_SIZE); +#endif +#ifdef REGISTER_VIRTUAL_TYPE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_VIRTUAL_TYPE = 0x%08lx\n", (long) current_gdbarch->register_virtual_type /*REGISTER_VIRTUAL_TYPE ()*/); +#endif +#ifdef USE_GENERIC_DUMMY_FRAMES fprintf_unfiltered (gdb_stdlog, "gdbarch_update: USE_GENERIC_DUMMY_FRAMES = %ld\n", (long) USE_GENERIC_DUMMY_FRAMES); +#endif +#ifdef CALL_DUMMY_LOCATION fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_LOCATION = %ld\n", (long) CALL_DUMMY_LOCATION); +#endif +#ifdef CALL_DUMMY_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_ADDRESS = 0x%08lx\n", (long) current_gdbarch->call_dummy_address /*CALL_DUMMY_ADDRESS ()*/); +#endif +#ifdef CALL_DUMMY_START_OFFSET fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_START_OFFSET = 0x%08lx\n", (long) CALL_DUMMY_START_OFFSET); +#endif +#ifdef CALL_DUMMY_BREAKPOINT_OFFSET fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n", (long) CALL_DUMMY_BREAKPOINT_OFFSET); +#endif +#ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_BREAKPOINT_OFFSET_P = %ld\n", (long) CALL_DUMMY_BREAKPOINT_OFFSET_P); +#endif +#ifdef CALL_DUMMY_LENGTH if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END) fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_LENGTH = %ld\n", (long) CALL_DUMMY_LENGTH); +#endif +#ifdef PC_IN_CALL_DUMMY fprintf_unfiltered (gdb_stdlog, "gdbarch_update: PC_IN_CALL_DUMMY = 0x%08lx\n", (long) current_gdbarch->pc_in_call_dummy /*PC_IN_CALL_DUMMY ()*/); +#endif +#ifdef CALL_DUMMY_P fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_P = %ld\n", (long) CALL_DUMMY_P); +#endif +#ifdef CALL_DUMMY_WORDS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_WORDS = 0x%08lx\n", (long) CALL_DUMMY_WORDS); +#endif +#ifdef SIZEOF_CALL_DUMMY_WORDS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", (long) SIZEOF_CALL_DUMMY_WORDS); +#endif +#ifdef CALL_DUMMY_STACK_ADJUST_P fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_STACK_ADJUST_P = 0x%08lx\n", (long) CALL_DUMMY_STACK_ADJUST_P); +#endif +#ifdef CALL_DUMMY_STACK_ADJUST if (CALL_DUMMY_STACK_ADJUST_P) fprintf_unfiltered (gdb_stdlog, "gdbarch_update: CALL_DUMMY_STACK_ADJUST = 0x%08lx\n", (long) CALL_DUMMY_STACK_ADJUST); +#endif +#ifdef FIX_CALL_DUMMY fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FIX_CALL_DUMMY = 0x%08lx\n", (long) current_gdbarch->fix_call_dummy /*FIX_CALL_DUMMY ()*/); +#endif #ifdef BELIEVE_PCC_PROMOTION fprintf_unfiltered (gdb_stdlog, "gdbarch_update: BELIEVE_PCC_PROMOTION = %ld\n", @@ -772,159 +925,297 @@ gdbarch_dump (void) "gdbarch_update: BELIEVE_PCC_PROMOTION_TYPE = %ld\n", (long) BELIEVE_PCC_PROMOTION_TYPE); #endif +#ifdef COERCE_FLOAT_TO_DOUBLE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", (long) current_gdbarch->coerce_float_to_double /*COERCE_FLOAT_TO_DOUBLE ()*/); +#endif +#ifdef GET_SAVED_REGISTER fprintf_unfiltered (gdb_stdlog, "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n", (long) current_gdbarch->get_saved_register /*GET_SAVED_REGISTER ()*/); +#endif +#ifdef REGISTER_CONVERTIBLE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_CONVERTIBLE = 0x%08lx\n", (long) current_gdbarch->register_convertible /*REGISTER_CONVERTIBLE ()*/); +#endif +#ifdef REGISTER_CONVERT_TO_VIRTUAL fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n", (long) current_gdbarch->register_convert_to_virtual /*REGISTER_CONVERT_TO_VIRTUAL ()*/); +#endif +#ifdef REGISTER_CONVERT_TO_RAW fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REGISTER_CONVERT_TO_RAW = 0x%08lx\n", (long) current_gdbarch->register_convert_to_raw /*REGISTER_CONVERT_TO_RAW ()*/); +#endif +#ifdef POINTER_TO_ADDRESS + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: POINTER_TO_ADDRESS = 0x%08lx\n", + (long) current_gdbarch->pointer_to_address + /*POINTER_TO_ADDRESS ()*/); +#endif +#ifdef ADDRESS_TO_POINTER + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: ADDRESS_TO_POINTER = 0x%08lx\n", + (long) current_gdbarch->address_to_pointer + /*ADDRESS_TO_POINTER ()*/); +#endif +#ifdef RETURN_VALUE_ON_STACK + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: RETURN_VALUE_ON_STACK = 0x%08lx\n", + (long) current_gdbarch->return_value_on_stack + /*RETURN_VALUE_ON_STACK ()*/); +#endif +#ifdef EXTRACT_RETURN_VALUE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: EXTRACT_RETURN_VALUE = 0x%08lx\n", (long) current_gdbarch->extract_return_value /*EXTRACT_RETURN_VALUE ()*/); +#endif +#ifdef PUSH_ARGUMENTS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: PUSH_ARGUMENTS = 0x%08lx\n", (long) current_gdbarch->push_arguments /*PUSH_ARGUMENTS ()*/); +#endif +#ifdef PUSH_DUMMY_FRAME fprintf_unfiltered (gdb_stdlog, "gdbarch_update: PUSH_DUMMY_FRAME = 0x%08lx\n", (long) current_gdbarch->push_dummy_frame /*PUSH_DUMMY_FRAME ()*/); +#endif +#ifdef PUSH_RETURN_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: PUSH_RETURN_ADDRESS = 0x%08lx\n", (long) current_gdbarch->push_return_address /*PUSH_RETURN_ADDRESS ()*/); +#endif +#ifdef POP_FRAME fprintf_unfiltered (gdb_stdlog, "gdbarch_update: POP_FRAME = 0x%08lx\n", (long) current_gdbarch->pop_frame /*POP_FRAME ()*/); +#endif +#ifdef D10V_MAKE_DADDR fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_MAKE_DADDR = 0x%08lx\n", (long) current_gdbarch->d10v_make_daddr /*D10V_MAKE_DADDR ()*/); +#endif +#ifdef D10V_MAKE_IADDR fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_MAKE_IADDR = 0x%08lx\n", (long) current_gdbarch->d10v_make_iaddr /*D10V_MAKE_IADDR ()*/); +#endif +#ifdef D10V_DADDR_P fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_DADDR_P = 0x%08lx\n", (long) current_gdbarch->d10v_daddr_p /*D10V_DADDR_P ()*/); +#endif +#ifdef D10V_IADDR_P fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_IADDR_P = 0x%08lx\n", (long) current_gdbarch->d10v_iaddr_p /*D10V_IADDR_P ()*/); +#endif +#ifdef D10V_CONVERT_DADDR_TO_RAW fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_CONVERT_DADDR_TO_RAW = 0x%08lx\n", (long) current_gdbarch->d10v_convert_daddr_to_raw /*D10V_CONVERT_DADDR_TO_RAW ()*/); +#endif +#ifdef D10V_CONVERT_IADDR_TO_RAW fprintf_unfiltered (gdb_stdlog, "gdbarch_update: D10V_CONVERT_IADDR_TO_RAW = 0x%08lx\n", (long) current_gdbarch->d10v_convert_iaddr_to_raw /*D10V_CONVERT_IADDR_TO_RAW ()*/); +#endif +#ifdef STORE_STRUCT_RETURN fprintf_unfiltered (gdb_stdlog, "gdbarch_update: STORE_STRUCT_RETURN = 0x%08lx\n", (long) current_gdbarch->store_struct_return /*STORE_STRUCT_RETURN ()*/); +#endif +#ifdef STORE_RETURN_VALUE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: STORE_RETURN_VALUE = 0x%08lx\n", (long) current_gdbarch->store_return_value /*STORE_RETURN_VALUE ()*/); +#endif +#ifdef EXTRACT_STRUCT_VALUE_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", (long) current_gdbarch->extract_struct_value_address /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); +#endif +#ifdef USE_STRUCT_CONVENTION fprintf_unfiltered (gdb_stdlog, "gdbarch_update: USE_STRUCT_CONVENTION = 0x%08lx\n", (long) current_gdbarch->use_struct_convention /*USE_STRUCT_CONVENTION ()*/); +#endif +#ifdef FRAME_INIT_SAVED_REGS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_INIT_SAVED_REGS = 0x%08lx\n", (long) current_gdbarch->frame_init_saved_regs /*FRAME_INIT_SAVED_REGS ()*/); +#endif +#ifdef INIT_EXTRA_FRAME_INFO fprintf_unfiltered (gdb_stdlog, "gdbarch_update: INIT_EXTRA_FRAME_INFO = 0x%08lx\n", (long) current_gdbarch->init_extra_frame_info /*INIT_EXTRA_FRAME_INFO ()*/); +#endif +#ifdef SKIP_PROLOGUE fprintf_unfiltered (gdb_stdlog, "gdbarch_update: SKIP_PROLOGUE = 0x%08lx\n", (long) current_gdbarch->skip_prologue /*SKIP_PROLOGUE ()*/); +#endif +#ifdef PROLOGUE_FRAMELESS_P + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: PROLOGUE_FRAMELESS_P = 0x%08lx\n", + (long) current_gdbarch->prologue_frameless_p + /*PROLOGUE_FRAMELESS_P ()*/); +#endif +#ifdef INNER_THAN fprintf_unfiltered (gdb_stdlog, "gdbarch_update: INNER_THAN = 0x%08lx\n", (long) current_gdbarch->inner_than /*INNER_THAN ()*/); +#endif +#ifdef BREAKPOINT_FROM_PC fprintf_unfiltered (gdb_stdlog, "gdbarch_update: BREAKPOINT_FROM_PC = 0x%08lx\n", (long) current_gdbarch->breakpoint_from_pc /*BREAKPOINT_FROM_PC ()*/); +#endif +#ifdef MEMORY_INSERT_BREAKPOINT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n", (long) current_gdbarch->memory_insert_breakpoint /*MEMORY_INSERT_BREAKPOINT ()*/); +#endif +#ifdef MEMORY_REMOVE_BREAKPOINT fprintf_unfiltered (gdb_stdlog, "gdbarch_update: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n", (long) current_gdbarch->memory_remove_breakpoint /*MEMORY_REMOVE_BREAKPOINT ()*/); +#endif +#ifdef DECR_PC_AFTER_BREAK fprintf_unfiltered (gdb_stdlog, "gdbarch_update: DECR_PC_AFTER_BREAK = %ld\n", (long) DECR_PC_AFTER_BREAK); +#endif +#ifdef FUNCTION_START_OFFSET fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FUNCTION_START_OFFSET = %ld\n", (long) FUNCTION_START_OFFSET); +#endif +#ifdef REMOTE_TRANSLATE_XFER_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n", (long) current_gdbarch->remote_translate_xfer_address /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); +#endif +#ifdef FRAME_ARGS_SKIP fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_ARGS_SKIP = %ld\n", (long) FRAME_ARGS_SKIP); +#endif +#ifdef FRAMELESS_FUNCTION_INVOCATION fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n", (long) current_gdbarch->frameless_function_invocation /*FRAMELESS_FUNCTION_INVOCATION ()*/); +#endif +#ifdef FRAME_CHAIN fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_CHAIN = 0x%08lx\n", (long) current_gdbarch->frame_chain /*FRAME_CHAIN ()*/); +#endif +#ifdef FRAME_CHAIN_VALID fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_CHAIN_VALID = 0x%08lx\n", (long) current_gdbarch->frame_chain_valid /*FRAME_CHAIN_VALID ()*/); +#endif +#ifdef FRAME_SAVED_PC fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_SAVED_PC = 0x%08lx\n", (long) current_gdbarch->frame_saved_pc /*FRAME_SAVED_PC ()*/); +#endif +#ifdef FRAME_ARGS_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_ARGS_ADDRESS = 0x%08lx\n", (long) current_gdbarch->frame_args_address /*FRAME_ARGS_ADDRESS ()*/); +#endif +#ifdef FRAME_LOCALS_ADDRESS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_LOCALS_ADDRESS = 0x%08lx\n", (long) current_gdbarch->frame_locals_address /*FRAME_LOCALS_ADDRESS ()*/); +#endif +#ifdef SAVED_PC_AFTER_CALL fprintf_unfiltered (gdb_stdlog, "gdbarch_update: SAVED_PC_AFTER_CALL = 0x%08lx\n", (long) current_gdbarch->saved_pc_after_call /*SAVED_PC_AFTER_CALL ()*/); +#endif +#ifdef FRAME_NUM_ARGS fprintf_unfiltered (gdb_stdlog, "gdbarch_update: FRAME_NUM_ARGS = 0x%08lx\n", (long) current_gdbarch->frame_num_args /*FRAME_NUM_ARGS ()*/); +#endif +#ifdef STACK_ALIGN + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: STACK_ALIGN = 0x%08lx\n", + (long) current_gdbarch->stack_align + /*STACK_ALIGN ()*/); +#endif +#ifdef REG_STRUCT_HAS_ADDR + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: REG_STRUCT_HAS_ADDR = 0x%08lx\n", + (long) current_gdbarch->reg_struct_has_addr + /*REG_STRUCT_HAS_ADDR ()*/); +#endif +#ifdef SAVE_DUMMY_FRAME_TOS + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n", + (long) current_gdbarch->save_dummy_frame_tos + /*SAVE_DUMMY_FRAME_TOS ()*/); +#endif +#ifdef TARGET_FLOAT_FORMAT + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: TARGET_FLOAT_FORMAT = %ld\n", + (long) TARGET_FLOAT_FORMAT); +#endif +#ifdef TARGET_DOUBLE_FORMAT + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: TARGET_DOUBLE_FORMAT = %ld\n", + (long) TARGET_DOUBLE_FORMAT); +#endif +#ifdef TARGET_LONG_DOUBLE_FORMAT + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: TARGET_LONG_DOUBLE_FORMAT = %ld\n", + (long) TARGET_LONG_DOUBLE_FORMAT); +#endif + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: GDB_MULTI_ARCH = %d\n", + GDB_MULTI_ARCH); } struct gdbarch_tdep * @@ -1104,6 +1395,22 @@ set_gdbarch_long_double_bit (struct gdbarch *gdbarch, gdbarch->long_double_bit = long_double_bit; } +int +gdbarch_ieee_float (struct gdbarch *gdbarch) +{ + /* Skip verify of ieee_float, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n"); + return gdbarch->ieee_float; +} + +void +set_gdbarch_ieee_float (struct gdbarch *gdbarch, + int ieee_float) +{ + gdbarch->ieee_float = ieee_float; +} + CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid) { @@ -1274,6 +1581,54 @@ set_gdbarch_pc_regnum (struct gdbarch *gdbarch, gdbarch->pc_regnum = pc_regnum; } +int +gdbarch_fp0_regnum (struct gdbarch *gdbarch) +{ + /* Skip verify of fp0_regnum, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); + return gdbarch->fp0_regnum; +} + +void +set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, + int fp0_regnum) +{ + gdbarch->fp0_regnum = fp0_regnum; +} + +int +gdbarch_npc_regnum (struct gdbarch *gdbarch) +{ + /* Skip verify of npc_regnum, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n"); + return gdbarch->npc_regnum; +} + +void +set_gdbarch_npc_regnum (struct gdbarch *gdbarch, + int npc_regnum) +{ + gdbarch->npc_regnum = npc_regnum; +} + +int +gdbarch_nnpc_regnum (struct gdbarch *gdbarch) +{ + /* Skip verify of nnpc_regnum, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n"); + return gdbarch->nnpc_regnum; +} + +void +set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, + int nnpc_regnum) +{ + gdbarch->nnpc_regnum = nnpc_regnum; +} + char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr) { @@ -1778,6 +2133,57 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch->register_convert_to_raw = register_convert_to_raw; } +CORE_ADDR +gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) +{ + if (gdbarch->pointer_to_address == 0) + internal_error ("gdbarch: gdbarch_pointer_to_address invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); + return gdbarch->pointer_to_address (type, buf); +} + +void +set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, + gdbarch_pointer_to_address_ftype pointer_to_address) +{ + gdbarch->pointer_to_address = pointer_to_address; +} + +void +gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) +{ + if (gdbarch->address_to_pointer == 0) + internal_error ("gdbarch: gdbarch_address_to_pointer invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); + gdbarch->address_to_pointer (type, buf, addr); +} + +void +set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, + gdbarch_address_to_pointer_ftype address_to_pointer) +{ + gdbarch->address_to_pointer = address_to_pointer; +} + +int +gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) +{ + if (gdbarch->return_value_on_stack == 0) + internal_error ("gdbarch: gdbarch_return_value_on_stack invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); + return gdbarch->return_value_on_stack (type); +} + +void +set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, + gdbarch_return_value_on_stack_ftype return_value_on_stack) +{ + gdbarch->return_value_on_stack = return_value_on_stack; +} + void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) { @@ -2084,6 +2490,23 @@ set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch->skip_prologue = skip_prologue; } +int +gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) +{ + if (gdbarch->prologue_frameless_p == 0) + internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); + return gdbarch->prologue_frameless_p (ip); +} + +void +set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, + gdbarch_prologue_frameless_p_ftype prologue_frameless_p) +{ + gdbarch->prologue_frameless_p = prologue_frameless_p; +} + int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) { @@ -2356,6 +2779,120 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch->frame_num_args = frame_num_args; } +int +gdbarch_stack_align_p (struct gdbarch *gdbarch) +{ + return gdbarch->stack_align != 0; +} + +CORE_ADDR +gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) +{ + if (gdbarch->stack_align == 0) + internal_error ("gdbarch: gdbarch_stack_align invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); + return gdbarch->stack_align (sp); +} + +void +set_gdbarch_stack_align (struct gdbarch *gdbarch, + gdbarch_stack_align_ftype stack_align) +{ + gdbarch->stack_align = stack_align; +} + +int +gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) +{ + return gdbarch->reg_struct_has_addr != 0; +} + +int +gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) +{ + if (gdbarch->reg_struct_has_addr == 0) + internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); + return gdbarch->reg_struct_has_addr (gcc_p, type); +} + +void +set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, + gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr) +{ + gdbarch->reg_struct_has_addr = reg_struct_has_addr; +} + +int +gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch) +{ + return gdbarch->save_dummy_frame_tos != 0; +} + +void +gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) +{ + if (gdbarch->save_dummy_frame_tos == 0) + internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); + gdbarch->save_dummy_frame_tos (sp); +} + +void +set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, + gdbarch_save_dummy_frame_tos_ftype save_dummy_frame_tos) +{ + gdbarch->save_dummy_frame_tos = save_dummy_frame_tos; +} + +const struct floatformat * +gdbarch_float_format (struct gdbarch *gdbarch) +{ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); + return gdbarch->float_format; +} + +void +set_gdbarch_float_format (struct gdbarch *gdbarch, + const struct floatformat * float_format) +{ + gdbarch->float_format = float_format; +} + +const struct floatformat * +gdbarch_double_format (struct gdbarch *gdbarch) +{ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); + return gdbarch->double_format; +} + +void +set_gdbarch_double_format (struct gdbarch *gdbarch, + const struct floatformat * double_format) +{ + gdbarch->double_format = double_format; +} + +const struct floatformat * +gdbarch_long_double_format (struct gdbarch *gdbarch) +{ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); + return gdbarch->long_double_format; +} + +void +set_gdbarch_long_double_format (struct gdbarch *gdbarch, + const struct floatformat * long_double_format) +{ + gdbarch->long_double_format = long_double_format; +} + /* Keep a registrary of per-architecture data-pointers required by GDB modules. */ @@ -3093,6 +3630,7 @@ generic_register_convertible_not (num) return 0; } + /* Disassembler */ /* Pointer to the target-dependent disassembly function. */ @@ -3121,13 +3659,6 @@ set_gdbarch_from_file (abfd) } -#if defined (CALL_DUMMY) -/* FIXME - this should go away */ -LONGEST call_dummy_words[] = CALL_DUMMY; -int sizeof_call_dummy_words = sizeof (call_dummy_words); -#endif - - /* Initialize the current architecture. */ void initialize_current_architecture () diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index e7b4e014d6e..1875774e4e7 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -53,18 +53,6 @@ extern struct gdbarch *current_gdbarch; /* If any of the following are defined, the target wasn't correctly converted. */ -#if GDB_MULTI_ARCH -#if defined (CALL_DUMMY) -#error "CALL_DUMMY: replaced by CALL_DUMMY_WORDS/SIZEOF_CALL_DUMMY_WORDS" -#endif -#endif - -#if GDB_MULTI_ARCH -#if defined (REGISTER_NAMES) -#error "REGISTER_NAMES: replaced by REGISTER_NAME" -#endif -#endif - #if GDB_MULTI_ARCH #if defined (EXTRA_FRAME_INFO) #error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info" @@ -99,6 +87,11 @@ extern int gdbarch_byte_order (struct gdbarch *gdbarch); /* The following are initialized by the target dependant code. */ +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (TARGET_BFD_VMA_BIT) +#define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address) +#endif + extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch); extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); #if GDB_MULTI_ARCH @@ -171,6 +164,19 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (IEEE_FLOAT) +#define IEEE_FLOAT (0) +#endif + +extern int gdbarch_ieee_float (struct gdbarch *gdbarch); +extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (IEEE_FLOAT) +#define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch)) +#endif +#endif + typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid); extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid); extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); @@ -257,6 +263,50 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (FP0_REGNUM) +#define FP0_REGNUM (-1) +#endif + +extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (FP0_REGNUM) +#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) +#endif +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (NPC_REGNUM) +#define NPC_REGNUM (-1) +#endif + +extern int gdbarch_npc_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (NPC_REGNUM) +#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) +#endif +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (NNPC_REGNUM) +#define NNPC_REGNUM (-1) +#endif + +extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (NNPC_REGNUM) +#define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REGISTER_NAME) +#define REGISTER_NAME(regnr) (legacy_register_name (regnr)) +#endif + typedef char * (gdbarch_register_name_ftype) (int regnr); extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); @@ -408,6 +458,11 @@ extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p) #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (CALL_DUMMY_WORDS) +#define 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 @@ -416,6 +471,11 @@ extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * cal #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (SIZEOF_CALL_DUMMY_WORDS) +#define 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 @@ -465,6 +525,11 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (COERCE_FLOAT_TO_DOUBLE) +#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (default_coerce_float_to_double (formal, actual)) +#endif + typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual); extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual); extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double); @@ -483,6 +548,11 @@ extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REGISTER_CONVERTIBLE) +#define REGISTER_CONVERTIBLE(nr) (generic_register_convertible_not (nr)) +#endif + typedef int (gdbarch_register_convertible_ftype) (int nr); extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); @@ -492,6 +562,11 @@ extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_r #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REGISTER_CONVERT_TO_VIRTUAL) +#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error ("REGISTER_CONVERT_TO_VIRTUAL"), 0) +#endif + typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); @@ -501,6 +576,11 @@ extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gd #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REGISTER_CONVERT_TO_RAW) +#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error ("REGISTER_CONVERT_TO_RAW"), 0) +#endif + typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); @@ -510,6 +590,48 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (POINTER_TO_ADDRESS) +#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf)) +#endif + +typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf); +extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); +extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (POINTER_TO_ADDRESS) +#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (ADDRESS_TO_POINTER) +#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr)) +#endif + +typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); +extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); +extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (ADDRESS_TO_POINTER) +#define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) +#endif +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (RETURN_VALUE_ON_STACK) +#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type)) +#endif + +typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); +extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); +extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (RETURN_VALUE_ON_STACK) +#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) +#endif +#endif + typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); @@ -555,6 +677,11 @@ extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ft #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_MAKE_DADDR) +#define D10V_MAKE_DADDR(x) (internal_error ("D10V_MAKE_DADDR"), 0) +#endif + typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr); @@ -564,6 +691,11 @@ extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_m #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_MAKE_IADDR) +#define D10V_MAKE_IADDR(x) (internal_error ("D10V_MAKE_IADDR"), 0) +#endif + typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr); @@ -573,6 +705,11 @@ extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_m #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_DADDR_P) +#define D10V_DADDR_P(x) (internal_error ("D10V_DADDR_P"), 0) +#endif + typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x); extern int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p); @@ -582,6 +719,11 @@ extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_dadd #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_IADDR_P) +#define D10V_IADDR_P(x) (internal_error ("D10V_IADDR_P"), 0) +#endif + typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x); extern int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p); @@ -591,6 +733,11 @@ extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iadd #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_CONVERT_DADDR_TO_RAW) +#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_DADDR_TO_RAW"), 0) +#endif + typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw); @@ -600,6 +747,11 @@ extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdba #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (D10V_CONVERT_IADDR_TO_RAW) +#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_IADDR_TO_RAW"), 0) +#endif + typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw); @@ -672,6 +824,20 @@ extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_pro #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (PROLOGUE_FRAMELESS_P) +#define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip)) +#endif + +typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip); +extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip); +extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (PROLOGUE_FRAMELESS_P) +#define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) +#endif +#endif + typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); @@ -681,6 +847,11 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (BREAKPOINT_FROM_PC) +#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr)) +#endif + typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); @@ -690,6 +861,11 @@ extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_bre #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (MEMORY_INSERT_BREAKPOINT) +#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache)) +#endif + typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint); @@ -699,6 +875,11 @@ extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbar #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (MEMORY_REMOVE_BREAKPOINT) +#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache)) +#endif + typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint); @@ -724,6 +905,11 @@ 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 == 0) && !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); extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); @@ -741,6 +927,11 @@ extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR fram #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (FRAMELESS_FUNCTION_INVOCATION) +#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi)) +#endif + typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); @@ -813,6 +1004,132 @@ extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_n #endif #endif +#if defined (STACK_ALIGN) +/* Legacy for systems yet to multi-arch STACK_ALIGN */ +#define STACK_ALIGN_P() (1) +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (GDB_MULTI_ARCH == 0) && !defined (STACK_ALIGN_P) +#define STACK_ALIGN_P() (0) +#endif + +extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > 1) || !defined (STACK_ALIGN_P) +#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (STACK_ALIGN) +#define STACK_ALIGN(sp) (internal_error ("STACK_ALIGN"), 0) +#endif + +typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); +extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp); +extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (STACK_ALIGN) +#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) +#endif +#endif + +#if defined (REG_STRUCT_HAS_ADDR) +/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */ +#define REG_STRUCT_HAS_ADDR_P() (1) +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REG_STRUCT_HAS_ADDR_P) +#define REG_STRUCT_HAS_ADDR_P() (0) +#endif + +extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > 1) || !defined (REG_STRUCT_HAS_ADDR_P) +#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (REG_STRUCT_HAS_ADDR) +#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error ("REG_STRUCT_HAS_ADDR"), 0) +#endif + +typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); +extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); +extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (REG_STRUCT_HAS_ADDR) +#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) +#endif +#endif + +#if defined (SAVE_DUMMY_FRAME_TOS) +/* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */ +#define SAVE_DUMMY_FRAME_TOS_P() (1) +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (GDB_MULTI_ARCH == 0) && !defined (SAVE_DUMMY_FRAME_TOS_P) +#define SAVE_DUMMY_FRAME_TOS_P() (0) +#endif + +extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > 1) || !defined (SAVE_DUMMY_FRAME_TOS_P) +#define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (SAVE_DUMMY_FRAME_TOS) +#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error ("SAVE_DUMMY_FRAME_TOS"), 0) +#endif + +typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); +extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); +extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (SAVE_DUMMY_FRAME_TOS) +#define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) +#endif +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (TARGET_FLOAT_FORMAT) +#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch)) +#endif + +extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch); +extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_FLOAT_FORMAT) +#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) +#endif +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (TARGET_DOUBLE_FORMAT) +#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch)) +#endif + +extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch); +extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_DOUBLE_FORMAT) +#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) +#endif +#endif + +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (TARGET_LONG_DOUBLE_FORMAT) +#define TARGET_LONG_DOUBLE_FORMAT (&floatformat_unknown) +#endif + +extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch); +extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_DOUBLE_FORMAT) +#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) +#endif +#endif + extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); @@ -1061,31 +1378,6 @@ extern disassemble_info tm_print_insn_info; USE of these macro's is *STRONGLY* discouraged. */ #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) -#ifndef D10V_MAKE_DADDR -#define D10V_MAKE_DADDR(X) (internal_error ("gdbarch: D10V_MAKE_DADDR"), 0) -#endif -#ifndef D10V_MAKE_IADDR -#define D10V_MAKE_IADDR(X) (internal_error ("gdbarch: D10V_MAKE_IADDR"), 0) -#endif - - -/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */ -#ifndef FRAMELESS_FUNCTION_INVOCATION -#define FRAMELESS_FUNCTION_INVOCATION(FI) (0) -#endif - - -/* Fallback definition of REGISTER_CONVERTIBLE etc */ -extern int generic_register_convertible_not (int reg_nr); -#ifndef REGISTER_CONVERTIBLE -#define REGISTER_CONVERTIBLE(x) (0) -#endif -#ifndef REGISTER_CONVERT_TO_VIRTUAL -#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a) -#endif -#ifndef REGISTER_CONVERT_TO_RAW -#define REGISTER_CONVERT_TO_RAW(x, y, z, a) -#endif /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ @@ -1099,14 +1391,6 @@ extern int generic_register_convertible_not (int reg_nr); #endif -/* Fallback definition for REGISTER_NAME for systems still defining - REGISTER_NAMES. */ -#ifndef REGISTER_NAME -extern char *gdb_register_names[]; -#define REGISTER_NAME(i) gdb_register_names[i] -#endif - - /* Set the dynamic target-system-dependant parameters (architecture, byte-order, ...) using information found in the BFD */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 8a907cc37db..bf7b47c1e5d 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1,4 +1,4 @@ -#!/usr/local/bin/bash +#!/usr/local/bin/bash -u # Architecture commands for GDB, the GNU debugger. # Copyright 1998-2000 Free Software Foundation, Inc. @@ -34,26 +34,50 @@ compare_new () } -# DEFAULT is a valid fallback definition of a MACRO when -# multi-arch is not enabled. -default_is_fallback_p () -{ - [ "${default}" != "" -a "${invalid_p}" = "0" ] - # FIXME: cagney - not until after 5.0 - false -} - # Format of the input table -read="class level macro returntype function formal actual attrib startup default invalid_p fmt print print_p description" +read="class level macro returntype function formal actual attrib staticdefault predefault postdefault invalid_p fmt print print_p description" do_read () { if eval read $read then - test "${startup}" || startup=0 + test "${staticdefault}" || staticdefault=0 + # NOT YET: Breaks BELIEVE_PCC_PROMOTION and confuses non- + # multi-arch defaults. + # test "${predefault}" || predefault=0 test "${fmt}" || fmt="%ld" test "${print}" || print="(long) ${macro}" - #test "${default}" || default=0 + case "${invalid_p}" in + 0 ) valid_p=1 ;; + "" ) + if [ "${predefault}" ] + then + #invalid_p="gdbarch->${function} == ${predefault}" + valid_p="gdbarch->${function} != ${predefault}" + else + #invalid_p="gdbarch->${function} == 0" + valid_p="gdbarch->${function} != 0" + fi + ;; + * ) valid_p="!(${invalid_p})" + esac + + # PREDEFAULT is a valid fallback definition of MEMBER when + # multi-arch is not enabled. This ensures that the default + # value, when multi-arch is the same as the default value when + # not multi-arch. POSTDEFAULT is always a valid definition of + # MEMBER as this again ensures consistency. + if [ "${postdefault}" != "" ] + then + fallbackdefault="${postdefault}" + elif [ "${predefault}" != "" ] + then + fallbackdefault="${predefault}" + else + fallbackdefault="" + fi + #NOT YET: + # See gdbarch.log for basic verification of database : else false @@ -61,6 +85,33 @@ do_read () } +fallback_default_p () +{ + [ "${postdefault}" != "" -a "${invalid_p}" != "0" ] \ + || [ "${predefault}" != "" -a "${invalid_p}" = "0" ] +} + +class_is_variable_p () +{ + [ "${class}" = "v" -o "${class}" = "V" ] +} + +class_is_function_p () +{ + [ "${class}" = "f" -o "${class}" = "F" ] +} + +class_is_predicate_p () +{ + [ "${class}" = "F" -o "${class}" = "V" ] +} + +class_is_info_p () +{ + [ "${class}" = "i" ] +} + + # dump out/verify the doco for field in ${read} do @@ -71,8 +122,12 @@ do # # -> line disable # f -> function # hiding a function + # F -> function + predicate + # hiding a function + predicate to test function validity # v -> variable # hiding a variable + # V -> variable + predicate + # hiding a variable + predicate to test variables validity # i -> set from info # hiding something from the ``struct info'' object @@ -114,32 +169,66 @@ do # Any GCC attributes that should be attached to the function # declaration. At present this field is unused. - startup ) : ;; + staticdefault ) : ;; # To help with the GDB startup a static gdbarch object is - # created. STARTUP is the value to insert into that static - # gdbarch object. + # created. STATICDEFAULT is the value to insert into that + # static gdbarch object. Since this a static object only + # simple expressions can be used. + + # If STATICDEFAULT is empty, zero is used. + + predefault ) : ;; + + # A initial value to assign to MEMBER of the freshly + # malloc()ed gdbarch object. After the gdbarch object has + # been initialized using PREDEFAULT, it is passed to the + # target code for further updates. + + # If PREDEFAULT is empty, zero is used. + + # When POSTDEFAULT is empty, a non-empty PREDEFAULT and a zero + # INVALID_P will be used as default values when when + # multi-arch is disabled. Specify a zero PREDEFAULT function + # to make that fallback call internal_error(). + + # Variable declarations can refer to ``gdbarch'' which will + # contain the current architecture. Care should be taken. + + postdefault ) : ;; + + # A value to assign to MEMBER of the new gdbarch object should + # the target code fail to change the PREDEFAULT value. Also + # use POSTDEFAULT as the fallback value for the non- + # multi-arch case. - # By default ``0'' is used. + # If POSTDEFAULT is empty, no post update is performed. - default ) : ;; + # If both INVALID_P and POSTDEFAULT are non-empty then + # INVALID_P will be used to determine if MEMBER should be + # changed to POSTDEFAULT. - # Any initial value to assign to a new gdbarch object after it - # as been malloc()ed. Zero is used by default. + # You cannot specify both a zero INVALID_P and a POSTDEFAULT. - # Specify a non-empty DEFAULT and a zero INVALID_P to create a - # fallback value or function for when multi-arch is disabled. - # Specify a zero DEFAULT function to make that fallback - # illegal to call. + # Variable declarations can refer to ``gdbarch'' which will + # contain the current architecture. Care should be taken. invalid_p ) : ;; - # A predicate equation that validates MEMBER. Non-zero is + # A predicate equation that validates MEMBER. Non-zero is # returned if the code creating the new architecture failed to - # initialize the MEMBER or initialized the member to something - # invalid. By default, a check that the value is no longer - # equal to DEFAULT ips performed. The equation ``0'' disables - # the invalid_p check. + # initialize MEMBER or the initialized the member is invalid. + # If POSTDEFAULT is non-empty then MEMBER will be updated to + # that value. If POSTDEFAULT is empty then internal_error() + # is called. + + # If INVALID_P is empty, a check that MEMBER is no longer + # equal to PREDEFAULT is used. + + # The expression ``0'' disables the INVALID_P check making + # PREDEFAULT a legitimate value. + + # See also PREDEFAULT and POSTDEFAULT. fmt ) : ;; @@ -147,27 +236,28 @@ do # MEMBER. Sometimes "%s" is useful. For functions, this is # ignored and the function address is printed. - # By default ```%ld'' is used. + # If FMT is empty, ``%ld'' is used. print ) : ;; # An optional equation that casts MEMBER to a value suitable # for formatting by FMT. - # By default ``(long)'' is used. + # If PRINT is empty, ``(long)'' is used. print_p ) : ;; # An optional indicator for any predicte to wrap around the # print member code. - # # -> Wrap print up in ``#ifdef MACRO'' # exp -> Wrap print up in ``if (${print_p}) ... # ``'' -> No predicate + # If PRINT_P is empty, ``1'' is always used. + description ) : ;; - # Currently unused. + # Currently unused. *) exit 1;; esac @@ -179,11 +269,11 @@ function_list () { # See below (DOCO) for description of each field cat <printable_name:TARGET_ARCHITECTURE != NULL +i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL # i:2:TARGET_BYTE_ORDER:int:byte_order::::BIG_ENDIAN # -v:1:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address:0 +v:1:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0 v:1:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):0 #v:1:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):0 v:1:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):0 @@ -193,6 +283,7 @@ v:1:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):0 v:1:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0 v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):0 v:1:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):0 +v:1:IEEE_FLOAT:int:ieee_float::::0:0::0::: # f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0 f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0 @@ -205,7 +296,10 @@ v:2:NUM_REGS:int:num_regs::::0:-1 v:2:SP_REGNUM:int:sp_regnum::::0:-1 v:2:FP_REGNUM:int:fp_regnum::::0:-1 v:2:PC_REGNUM:int:pc_regnum::::0:-1 -f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name:0 +v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0 +v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0 +v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0 +f:2:REGISTER_NAME: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::0:0 @@ -217,28 +311,32 @@ f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr: # v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1 v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0 -f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0:gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0: -v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1::0x%08lx -v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::0x%08lx +f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0 +v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx +v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1:::0x%08lx v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1 -v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END +v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END f:2:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::0:0 v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 -v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words:0:0x%08lx -v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words:0:0x%08lx -v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1::0x%08lx -v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P -f:2: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::0:0 +v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx +v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx +v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx +v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P +f:2: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:::0 # -v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::0:::::# -v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::0:::::# -f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double:0 +v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: +v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: +f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double::0 f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval::generic_get_saved_register:0 # -f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not:0 -f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0:0 -f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0:0 +f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0 +f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0 +f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0::0 +# +f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, void *buf:type, buf:::unsigned_pointer_to_address::0 +f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0 # +f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0 f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0 f:1:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr::0:0 f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0 @@ -246,12 +344,12 @@ f:1:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp f:2:POP_FRAME:void:pop_frame:void:-:::0 # # I wish that these would just go away.... -f:2:D10V_MAKE_DADDR:CORE_ADDR:d10v_make_daddr:CORE_ADDR x:x:::0:0 -f:2:D10V_MAKE_IADDR:CORE_ADDR:d10v_make_iaddr:CORE_ADDR x:x:::0:0 -f:2:D10V_DADDR_P:int:d10v_daddr_p:CORE_ADDR x:x:::0 -f:2:D10V_IADDR_P:int:d10v_iaddr_p:CORE_ADDR x:x:::0 -f:2:D10V_CONVERT_DADDR_TO_RAW:CORE_ADDR:d10v_convert_daddr_to_raw:CORE_ADDR x:x:::0 -f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:d10v_convert_iaddr_to_raw:CORE_ADDR x:x:::0 +f:2:D10V_MAKE_DADDR:CORE_ADDR:d10v_make_daddr:CORE_ADDR x:x:::0::0 +f:2:D10V_MAKE_IADDR:CORE_ADDR:d10v_make_iaddr:CORE_ADDR x:x:::0::0 +f:2:D10V_DADDR_P:int:d10v_daddr_p:CORE_ADDR x:x:::0::0 +f:2:D10V_IADDR_P:int:d10v_iaddr_p:CORE_ADDR x:x:::0::0 +f:2:D10V_CONVERT_DADDR_TO_RAW:CORE_ADDR:d10v_convert_daddr_to_raw:CORE_ADDR x:x:::0::0 +f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:d10v_convert_iaddr_to_raw:CORE_ADDR x:x:::0::0 # f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0 @@ -262,17 +360,18 @@ f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:fr f:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0 # f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0 +f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0 f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0 -f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc:0 -f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint:0 -f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint:0 +f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0 +f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0 +f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1 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 +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 # 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 +f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0 f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 f:1:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0 f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0 @@ -281,32 +380,55 @@ f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0 f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0 # +F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0 +F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0 +F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0 +# +v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch) +v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch) +v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown EOF grep -v '^#' } - -# dump it out -if true -then - exec > new-gdbarch - function_list | while do_read # eval read $read - do +# +# The .log file +# +exec > new-gdbarch.log +function_list | while do_read # eval read $read +do cat <&2 -fi + if class_is_predicate_p && fallback_default_p + then + echo "Error: predicate function can not have a non- multi-arch default" 1>&2 + kill $$ + exit 1 + fi + if [ "${invalid_p}" = "0" -a "${postdefault}" != "" ] + then + echo "Error: postdefault is useless when invalid_p=0" 1>&2 + kill $$ + exit 1 + fi +done + +exec 1>&2 +compare_new gdbarch.log + copyright () { @@ -376,18 +498,6 @@ extern struct gdbarch *current_gdbarch; /* If any of the following are defined, the target wasn't correctly converted. */ -#if GDB_MULTI_ARCH -#if defined (CALL_DUMMY) -#error "CALL_DUMMY: replaced by CALL_DUMMY_WORDS/SIZEOF_CALL_DUMMY_WORDS" -#endif -#endif - -#if GDB_MULTI_ARCH -#if defined (REGISTER_NAMES) -#error "REGISTER_NAMES: replaced by REGISTER_NAME" -#endif -#endif - #if GDB_MULTI_ARCH #if defined (EXTRA_FRAME_INFO) #error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info" @@ -407,8 +517,8 @@ echo "" echo "/* The following are pre-initialized by GDBARCH. */" function_list | while do_read # eval read $read do - case "${class}" in - "i" ) + if class_is_info_p + then echo "" echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" echo "/* set_gdbarch_${function}() - not applicable - pre-initialized. */" @@ -417,8 +527,7 @@ do echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" echo "#endif" echo "#endif" - ;; - esac + fi done # function typedef's @@ -427,8 +536,36 @@ echo "" echo "/* The following are initialized by the target dependant code. */" function_list | while do_read # eval read $read do - case "${class}" in - "v" ) + if class_is_predicate_p + then + echo "" + echo "#if defined (${macro})" + echo "/* Legacy for systems yet to multi-arch ${macro} */" +# echo "#if (GDB_MULTI_ARCH <= 2) && defined (${macro})" + echo "#define ${macro}_P() (1)" + echo "#endif" + echo "" + echo "/* Default predicate for non- multi-arch targets. */" + echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro}_P)" + echo "#define ${macro}_P() (0)" + echo "#endif" + echo "" + echo "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);" + echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro}_P)" + echo "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))" + echo "#endif" + fi + if class_is_variable_p + then + if fallback_default_p || class_is_predicate_p + then + echo "" + echo "/* Default (value) for non- multi-arch platforms. */" + echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})" + echo "#define ${macro} (${fallbackdefault})" \ + | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g' + echo "#endif" + fi echo "" echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});" @@ -437,8 +574,24 @@ do echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" echo "#endif" echo "#endif" - ;; - "f" ) + fi + if class_is_function_p + then + if fallback_default_p || class_is_predicate_p + then + echo "" + echo "/* Default (function) for non- multi-arch platforms. */" + echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})" + if [ "${fallbackdefault}" = "0" ] + then + echo "#define ${macro}(${actual}) (internal_error (\"${macro}\"), 0)" + else + # FIXME: Should be passing current_gdbarch through! + echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \ + | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g' + fi + echo "#endif" + fi echo "" echo "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});" if [ "${formal}" = "void" ] @@ -448,10 +601,7 @@ do echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});" fi echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});" - if ! default_is_fallback_p - then - echo "#if GDB_MULTI_ARCH" - fi + echo "#if GDB_MULTI_ARCH" echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})" if [ "${actual}" = "" ] then @@ -463,12 +613,8 @@ do echo "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))" fi echo "#endif" - if ! default_is_fallback_p - then - echo "#endif" - fi - ;; - esac + echo "#endif" + fi done # close it off @@ -722,31 +868,6 @@ extern disassemble_info tm_print_insn_info; USE of these macro's is *STRONGLY* discouraged. */ #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) -#ifndef D10V_MAKE_DADDR -#define D10V_MAKE_DADDR(X) (internal_error ("gdbarch: D10V_MAKE_DADDR"), 0) -#endif -#ifndef D10V_MAKE_IADDR -#define D10V_MAKE_IADDR(X) (internal_error ("gdbarch: D10V_MAKE_IADDR"), 0) -#endif - - -/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */ -#ifndef FRAMELESS_FUNCTION_INVOCATION -#define FRAMELESS_FUNCTION_INVOCATION(FI) (0) -#endif - - -/* Fallback definition of REGISTER_CONVERTIBLE etc */ -extern int generic_register_convertible_not (int reg_nr); -#ifndef REGISTER_CONVERTIBLE -#define REGISTER_CONVERTIBLE(x) (0) -#endif -#ifndef REGISTER_CONVERT_TO_VIRTUAL -#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a) -#endif -#ifndef REGISTER_CONVERT_TO_RAW -#define REGISTER_CONVERT_TO_RAW(x, y, z, a) -#endif /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ @@ -760,14 +881,6 @@ extern int generic_register_convertible_not (int reg_nr); #endif -/* Fallback definition for REGISTER_NAME for systems still defining - REGISTER_NAMES. */ -#ifndef REGISTER_NAME -extern char *gdb_register_names[]; -#define REGISTER_NAME(i) gdb_register_names[i] -#endif - - /* Set the dynamic target-system-dependant parameters (architecture, byte-order, ...) using information found in the BFD */ @@ -812,7 +925,7 @@ copyright cat <${function} = info->${function};" - esac + if class_is_info_p + then + echo " gdbarch->${function} = info->${function};" + fi done echo "" echo " /* Force the explicit initialization of these. */" function_list | while do_read # eval read $read do - case "${class}" in - "f" | "v" ) - if [ "${default}" != "" -a "${default}" != "0" ] + if class_is_function_p || class_is_variable_p + then + if [ "${predefault}" != "" -a "${predefault}" != "0" ] then - echo " gdbarch->${function} = ${default};" + echo " gdbarch->${function} = ${predefault};" fi - ;; - esac + fi done cat <${function} = ${postdefault};" + elif [ "${predefault}" -a "${postdefault}" ] + then + echo " if (gdbarch->${function} == ${predefault})" + echo " gdbarch->${function} = ${postdefault};" + elif [ "${postdefault}" ] + then + echo " if (gdbarch->${function} == 0)" + echo " gdbarch->${function} = ${postdefault};" + elif [ "${invalid_p}" ] then echo " if ((GDB_MULTI_ARCH >= ${level})" echo " && (${invalid_p}))" echo " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");" - elif [ "${default}" ] + elif [ "${predefault}" ] then echo " if ((GDB_MULTI_ARCH >= ${level})" - echo " && (gdbarch->${function} == ${default}))" + echo " && (gdbarch->${function} == ${predefault}))" echo " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");" fi - ;; - esac + fi done cat <${function}" echo " /*${macro} ()*/);" - ;; - * ) - if [ "${print_p}" = "#" ] - then - echo "#ifdef ${macro}" - echo " fprintf_unfiltered (gdb_stdlog," - echo " \"gdbarch_update: ${macro} = ${fmt}\\n\"," - echo " ${print});" - echo "#endif" - elif [ "${print_p}" ] + else + if [ "${print_p}" ] then echo " if (${print_p})" echo " fprintf_unfiltered (gdb_stdlog," @@ -1107,10 +1231,15 @@ do echo " \"gdbarch_update: ${macro} = ${fmt}\\n\"," echo " ${print});" fi - ;; - esac + fi + echo "#endif" done -echo "}" +cat <${function} == 0)" echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" echo " if (gdbarch_debug >= 2)" @@ -1170,8 +1300,8 @@ do echo "{" echo " gdbarch->${function} = ${function};" echo "}" - ;; - "v" ) + elif class_is_variable_p + then echo "" echo "${returntype}" echo "gdbarch_${function} (struct gdbarch *gdbarch)" @@ -1183,9 +1313,9 @@ do then echo " if (${invalid_p})" echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" - elif [ "${default}" ] + elif [ "${predefault}" ] then - echo " if (gdbarch->${function} == ${default})" + echo " if (gdbarch->${function} == ${predefault})" echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" fi echo " if (gdbarch_debug >= 2)" @@ -1199,8 +1329,8 @@ do echo "{" echo " gdbarch->${function} = ${function};" echo "}" - ;; - "i" ) + elif class_is_info_p + then echo "" echo "${returntype}" echo "gdbarch_${function} (struct gdbarch *gdbarch)" @@ -1209,8 +1339,7 @@ do echo " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\n\");" echo " return gdbarch->${function};" echo "}" - ;; - esac + fi done # All the trailing guff @@ -1953,6 +2082,7 @@ generic_register_convertible_not (num) return 0; } + /* Disassembler */ /* Pointer to the target-dependent disassembly function. */ @@ -1981,13 +2111,6 @@ set_gdbarch_from_file (abfd) } -#if defined (CALL_DUMMY) -/* FIXME - this should go away */ -LONGEST call_dummy_words[] = CALL_DUMMY; -int sizeof_call_dummy_words = sizeof (call_dummy_words); -#endif - - /* Initialize the current architecture. */ void initialize_current_architecture () diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h index d01e5e56743..489b31cff04 100644 --- a/gdb/gdbcmd.h +++ b/gdb/gdbcmd.h @@ -104,24 +104,21 @@ extern struct cmd_list_element *setchecklist; extern struct cmd_list_element *showchecklist; -extern void -execute_user_command PARAMS ((struct cmd_list_element *, char *)); +extern void execute_user_command (struct cmd_list_element *, char *); -extern void -execute_command PARAMS ((char *, int)); +extern void execute_command (char *, int); -enum command_control_type -execute_control_command PARAMS ((struct command_line *)); +enum command_control_type execute_control_command (struct command_line *); extern void print_command_line (struct command_line *, unsigned int, struct ui_file *); #ifdef UI_OUT -extern void print_command_lines PARAMS ((struct ui_out *, - struct command_line *, unsigned int)); +extern void print_command_lines (struct ui_out *, + struct command_line *, unsigned int); #endif -extern char **noop_completer PARAMS ((char *, char *)); +extern char **noop_completer (char *, char *); -extern char **filename_completer PARAMS ((char *, char *)); +extern char **filename_completer (char *, char *); #endif /* !defined (GDBCMD_H) */ diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index e8e395384f9..bdf14c264a8 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -29,67 +29,63 @@ ERR nonzero means get error if there is none specified; otherwise return 0 in that case. */ -extern char *get_exec_file PARAMS ((int err)); +extern char *get_exec_file (int err); /* Nonzero if there is a core file. */ -extern int have_core_file_p PARAMS ((void)); +extern int have_core_file_p (void); /* Read "memory data" from whatever target or inferior we have. Returns zero if successful, errno value if not. EIO is used for address out of bounds. If breakpoints are inserted, returns shadow contents, not the breakpoints themselves. From breakpoint.c. */ -extern int read_memory_nobpt PARAMS ((CORE_ADDR memaddr, char *myaddr, - unsigned len)); +extern int read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len); /* Report a memory error with error(). */ -extern void memory_error PARAMS ((int status, CORE_ADDR memaddr)); +extern void memory_error (int status, CORE_ADDR memaddr); /* Like target_read_memory, but report an error if can't read. */ -extern void read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); - -extern void read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr, - int len, asection * bfd_section)); +extern void read_memory (CORE_ADDR memaddr, char *myaddr, int len); /* Read an integer from debugged memory, given address and number of bytes. */ -extern LONGEST read_memory_integer PARAMS ((CORE_ADDR memaddr, int len)); +extern LONGEST read_memory_integer (CORE_ADDR memaddr, int len); /* Read an unsigned integer from debugged memory, given address and number of bytes. */ -extern ULONGEST read_memory_unsigned_integer PARAMS ((CORE_ADDR memaddr, int len)); +extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr, int len); /* Read a null-terminated string from the debuggee's memory, given address, * a buffer into which to place the string, and the maximum available space */ -extern void read_memory_string PARAMS ((CORE_ADDR, char *, int)); +extern void read_memory_string (CORE_ADDR, char *, int); /* This takes a char *, not void *. This is probably right, because passing in an int * or whatever is wrong with respect to byteswapping, alignment, different sizes for host vs. target types, etc. */ -extern void write_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); +extern void write_memory (CORE_ADDR memaddr, char *myaddr, int len); -extern void generic_search PARAMS ((int len, char *data, char *mask, - CORE_ADDR startaddr, int increment, - CORE_ADDR lorange, CORE_ADDR hirange, - CORE_ADDR * addr_found, char *data_found)); +extern void generic_search (int len, char *data, char *mask, + CORE_ADDR startaddr, int increment, + CORE_ADDR lorange, CORE_ADDR hirange, + CORE_ADDR * addr_found, char *data_found); /* Hook for `exec_file_command' command to call. */ -extern void (*exec_file_display_hook) PARAMS ((char *filename)); +extern void (*exec_file_display_hook) (char *filename); /* Hook for "file_command", which is more useful than above (because it is invoked AFTER symbols are read, not before) */ -extern void (*file_changed_hook) PARAMS ((char *filename)); +extern void (*file_changed_hook) (char *filename); -extern void specify_exec_file_hook PARAMS ((void (*hook) (char *filename))); +extern void specify_exec_file_hook (void (*hook) (char *filename)); /* Binary File Diddlers for the exec and core files */ @@ -100,17 +96,17 @@ extern bfd *exec_bfd; extern int write_files; -extern void core_file_command PARAMS ((char *filename, int from_tty)); +extern void core_file_command (char *filename, int from_tty); -extern void exec_file_attach PARAMS ((char *filename, int from_tty)); +extern void exec_file_attach (char *filename, int from_tty); -extern void exec_file_command PARAMS ((char *filename, int from_tty)); +extern void exec_file_command (char *filename, int from_tty); -extern void validate_files PARAMS ((void)); +extern void validate_files (void); -extern CORE_ADDR register_addr PARAMS ((int regno, CORE_ADDR blockend)); +extern CORE_ADDR register_addr (int regno, CORE_ADDR blockend); -extern void registers_fetched PARAMS ((void)); +extern void registers_fetched (void); #if !defined (KERNEL_U_ADDR) extern CORE_ADDR kernel_u_addr; @@ -125,7 +121,7 @@ extern struct target_ops core_ops; extern char *gnutarget; -extern void set_gnutarget PARAMS ((char *)); +extern void set_gnutarget (char *); /* Structure to keep track of core register reading functions for various core file types. */ @@ -147,13 +143,13 @@ struct core_fns another file). Returns nonzero if the handler recognizes the format, zero otherwise. */ - int (*check_format) PARAMS ((bfd *)); + int (*check_format) (bfd *); /* Core file handler function to call to ask if it can handle a given core file format or not. Returns zero if it can't, nonzero otherwise. */ - int (*core_sniffer) PARAMS ((struct core_fns *, bfd *)); + int (*core_sniffer) (struct core_fns *, bfd *); /* Extract the register values out of the core file and store them where `read_register' will find them. @@ -176,9 +172,9 @@ struct core_fns registers in a large upage-plus-stack ".reg" section. Original upage address X is at location core_reg_sect+x+reg_addr. */ - void (*core_read_registers) PARAMS ((char *core_reg_sect, - unsigned core_reg_size, - int which, CORE_ADDR reg_addr)); + void (*core_read_registers) (char *core_reg_sect, + unsigned core_reg_size, + int which, CORE_ADDR reg_addr); /* Finds the next struct core_fns. They are allocated and initialized in whatever module implements the functions pointed to; an @@ -188,8 +184,8 @@ struct core_fns }; -extern void add_core_fns PARAMS ((struct core_fns * cf)); -extern int default_core_sniffer PARAMS ((struct core_fns *cf, bfd *abfd)); -extern int default_check_format PARAMS ((bfd *abfd)); +extern void add_core_fns (struct core_fns *cf); +extern int default_core_sniffer (struct core_fns *cf, bfd * abfd); +extern int default_check_format (bfd * abfd); #endif /* !defined (GDBCORE_H) */ diff --git a/gdb/gdbserver/low-nbsd.c b/gdb/gdbserver/low-nbsd.c index 054017cebe1..4aa3409e30f 100644 --- a/gdb/gdbserver/low-nbsd.c +++ b/gdb/gdbserver/low-nbsd.c @@ -46,7 +46,30 @@ extern char **environ; extern int inferior_pid; void quit (), perror_with_name (); -#ifdef TM_I386_H +#define RF(dst, src) \ + memcpy(®isters[REGISTER_BYTE(dst)], &src, sizeof(src)) + +#define RS(src, dst) \ + memcpy(&dst, ®isters[REGISTER_BYTE(src)], sizeof(dst)) + +#ifdef __i386__ +struct env387 + { + unsigned short control; + unsigned short r0; + unsigned short status; + unsigned short r1; + unsigned short tag; + unsigned short r2; + unsigned long eip; + unsigned short code_seg; + unsigned short opcode; + unsigned long operand; + unsigned short operand_seg; + unsigned short r3; + unsigned char regs[8][10]; + }; + /* i386_register_raw_size[i] is the number of bytes of storage in the actual machine representation for register i. */ int i386_register_raw_size[MAX_NUM_REGS] = { @@ -81,8 +104,14 @@ initialize_arch() } } } +#endif /* !__i386__ */ -#endif +#ifdef __powerpc__ +static void +initialize_arch() +{ +} +#endif /* !__powerpc__ */ /* Start an inferior process and returns its pid. @@ -183,6 +212,8 @@ myresume (step, signal) perror_with_name ("ptrace"); } + +#ifdef __i386__ /* Fetch one or more registers from the inferior. REGNO == -1 to get them all. We actually fetch more than requested, when convenient, marking them as valid so we won't fetch them again. */ @@ -192,19 +223,47 @@ fetch_inferior_registers (ignored) int ignored; { struct reg inferior_registers; - struct fpreg inferior_fp_registers; + struct env387 inferior_fp_registers; ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0); - memcpy (®isters[REGISTER_BYTE(0)], &inferior_registers, - sizeof(inferior_registers)); - -#if 0 /* def FP0_REGNUM */ ptrace (PT_GETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); - memcpy (®isters[REGISTER_BYTE(FP0_REGNUM)], &inferior_fp_registers, - sizeof(inferior_fp_registers)); -#endif + + RF ( 0, inferior_registers.r_eax); + RF ( 1, inferior_registers.r_ecx); + RF ( 2, inferior_registers.r_edx); + RF ( 3, inferior_registers.r_ebx); + RF ( 4, inferior_registers.r_esp); + RF ( 5, inferior_registers.r_ebp); + RF ( 6, inferior_registers.r_esi); + RF ( 7, inferior_registers.r_edi); + RF ( 8, inferior_registers.r_eip); + RF ( 9, inferior_registers.r_eflags); + RF (10, inferior_registers.r_cs); + RF (11, inferior_registers.r_ss); + RF (12, inferior_registers.r_ds); + RF (13, inferior_registers.r_es); + RF (14, inferior_registers.r_fs); + RF (15, inferior_registers.r_gs); + + RF (FP0_REGNUM, inferior_fpregisters.regs[0]); + RF (FP0_REGNUM + 1, inferior_fpregisters.regs[1]); + RF (FP0_REGNUM + 2, inferior_fpregisters.regs[2]); + RF (FP0_REGNUM + 3, inferior_fpregisters.regs[3]); + RF (FP0_REGNUM + 4, inferior_fpregisters.regs[4]); + RF (FP0_REGNUM + 5, inferior_fpregisters.regs[5]); + RF (FP0_REGNUM + 6, inferior_fpregisters.regs[6]); + RF (FP0_REGNUM + 7, inferior_fpregisters.regs[7]); + + RF (FCTRL_REGNUM, inferior_fpregisters.control); + RF (FSTAT_REGNUM, inferior_fpregisters.status); + RF (FTAG_REGNUM, inferior_fpregisters.tag); + RF (FCS_REGNUM, inferior_fpregisters.code_seg); + RF (FCOFF_REGNUM, inferior_fpregisters.eip); + RF (FDS_REGNUM, inferior_fpregisters.operand_seg); + RF (FDOFF_REGNUM, inferior_fpregisters.operand); + RF (FOP_REGNUM, inferior_fpregisters.opcode); } /* Store our register values back into the inferior. @@ -216,20 +275,109 @@ store_inferior_registers (ignored) int ignored; { struct reg inferior_registers; - struct fpreg inferior_fp_registers; + struct env387 inferior_fp_registers; + + RS ( 0, inferior_registers.r_eax); + RS ( 1, inferior_registers.r_ecx); + RS ( 2, inferior_registers.r_edx); + RS ( 3, inferior_registers.r_ebx); + RS ( 4, inferior_registers.r_esp); + RS ( 5, inferior_registers.r_ebp); + RS ( 6, inferior_registers.r_esi); + RS ( 7, inferior_registers.r_edi); + RS ( 8, inferior_registers.r_eip); + RS ( 9, inferior_registers.r_eflags); + RS (10, inferior_registers.r_cs); + RS (11, inferior_registers.r_ss); + RS (12, inferior_registers.r_ds); + RS (13, inferior_registers.r_es); + RS (14, inferior_registers.r_fs); + RS (15, inferior_registers.r_gs); + + RS (FP0_REGNUM, inferior_fpregisters.regs[0]); + RS (FP0_REGNUM + 1, inferior_fpregisters.regs[1]); + RS (FP0_REGNUM + 2, inferior_fpregisters.regs[2]); + RS (FP0_REGNUM + 3, inferior_fpregisters.regs[3]); + RS (FP0_REGNUM + 4, inferior_fpregisters.regs[4]); + RS (FP0_REGNUM + 5, inferior_fpregisters.regs[5]); + RS (FP0_REGNUM + 6, inferior_fpregisters.regs[6]); + RS (FP0_REGNUM + 7, inferior_fpregisters.regs[7]); + + RS (FCTRL_REGNUM, inferior_fpregisters.control); + RS (FSTAT_REGNUM, inferior_fpregisters.status); + RS (FTAG_REGNUM, inferior_fpregisters.tag); + RS (FCS_REGNUM, inferior_fpregisters.code_seg); + RS (FCOFF_REGNUM, inferior_fpregisters.eip); + RS (FDS_REGNUM, inferior_fpregisters.operand_seg); + RS (FDOFF_REGNUM, inferior_fpregisters.operand); + RS (FOP_REGNUM, inferior_fpregisters.opcode); - memcpy (&inferior_registers, ®isters[REGISTER_BYTE(0)], - sizeof(inferior_registers)); ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_registers, 0); - -#if 0 /* def FP0_REGNUM */ - memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], - sizeof (inferior_fp_registers)); ptrace (PT_SETFPREGS, inferior_pid, (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); -#endif } +#endif /* !__i386__ */ + +#ifdef __powerpc__ +/* Fetch one or more registers from the inferior. REGNO == -1 to get + them all. We actually fetch more than requested, when convenient, + marking them as valid so we won't fetch them again. */ + +void +fetch_inferior_registers (regno) + int regno; +{ + struct reg inferior_registers; + struct fpreg inferior_fp_registers; + int i; + + ptrace (PT_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); + + for (i = 0; i < 32; i++) + RF (i, inferior_registers.fixreg[i]); + RF (LR_REGNUM, inferior_registers.lr); + RF (CR_REGNUM, inferior_registers.cr); + RF (XER_REGNUM, inferior_registers.xer); + RF (CTR_REGNUM, inferior_registers.ctr); + RF (PC_REGNUM, inferior_registers.pc); + + for (i = 0; i < 32; i++) + RF (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + struct reg inferior_registers; + struct fpreg inferior_fp_registers; + int i; + + for (i = 0; i < 32; i++) + RS (i, inferior_registers.fixreg[i]); + RS (LR_REGNUM, inferior_registers.lr); + RS (CR_REGNUM, inferior_registers.cr); + RS (XER_REGNUM, inferior_registers.xer); + RS (CTR_REGNUM, inferior_registers.ctr); + RS (PC_REGNUM, inferior_registers.pc); + + for (i = 0; i < 32; i++) + RS (FP0_REGNUM + i, inferior_fp_registers.r_regs[i]); + + ptrace (PT_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + ptrace (PT_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); +} +#endif /* !__powerpc__ */ /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory in the NEW_SUN_PTRACE case. diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index cd078ccddc9..2b632d6c1fd 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -33,6 +33,7 @@ #include int remote_debug = 0; +struct ui_file *gdb_stdlog; static int remote_desc; @@ -487,9 +488,8 @@ prepare_resume_reply (buf, status, signo) buf = outreg (PC_REGNUM, buf); buf = outreg (FP_REGNUM, buf); buf = outreg (SP_REGNUM, buf); -#ifdef NPC_REGNUM - buf = outreg (NPC_REGNUM, buf); -#endif + if (NPC_REGNUM >= 0) + buf = outreg (NPC_REGNUM, buf); #ifdef O7_REGNUM buf = outreg (O7_REGNUM, buf); #endif diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 21e4d68b7b5..90f9bce1b20 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -23,15 +23,15 @@ /* Target-specific functions */ -int create_inferior PARAMS ((char *program, char **allargs)); -void kill_inferior PARAMS ((void)); -void fetch_inferior_registers PARAMS ((int regno)); -void store_inferior_registers PARAMS ((int regno)); -int mythread_alive PARAMS ((int pid)); -void myresume PARAMS ((int step, int signo)); -unsigned char mywait PARAMS ((char *status)); -void read_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); -int write_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); +int create_inferior (char *program, char **allargs); +void kill_inferior (void); +void fetch_inferior_registers (int regno); +void store_inferior_registers (int regno); +int mythread_alive (int pid); +void myresume (int step, int signo); +unsigned char mywait (char *status); +void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); +int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); int create_inferior (); void initialize_low (); @@ -51,27 +51,27 @@ extern int inferior_pid; /* Functions from remote-utils.c */ -int putpkt PARAMS ((char *buf)); -int getpkt PARAMS ((char *buf)); -void remote_open PARAMS ((char *name)); -void remote_close PARAMS ((void)); -void write_ok PARAMS ((char *buf)); -void write_enn PARAMS ((char *buf)); -void enable_async_io PARAMS ((void)); -void disable_async_io PARAMS ((void)); -void convert_ascii_to_int PARAMS ((char *from, char *to, int n)); -void convert_int_to_ascii PARAMS ((char *from, char *to, int n)); -void prepare_resume_reply PARAMS ((char *buf, char status, unsigned char sig)); +int putpkt (char *buf); +int getpkt (char *buf); +void remote_open (char *name); +void remote_close (void); +void write_ok (char *buf); +void write_enn (char *buf); +void enable_async_io (void); +void disable_async_io (void); +void convert_ascii_to_int (char *from, char *to, int n); +void convert_int_to_ascii (char *from, char *to, int n); +void prepare_resume_reply (char *buf, char status, unsigned char sig); -void decode_m_packet PARAMS ((char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr)); -void decode_M_packet PARAMS ((char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr, char *to)); +void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, + unsigned int *len_ptr); +void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, + unsigned int *len_ptr, char *to); /* Functions from utils.c */ -void perror_with_name PARAMS ((char *string)); +void perror_with_name (char *string); /* Maximum number of bytes to read/write at once. The value here diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 9909871633d..0f6eef915c5 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -84,16 +84,16 @@ struct extra int len; }; /* maximum extention is 128! FIXME */ -static void add_name PARAMS ((struct extra *, char *)); -static void add_mangled_type PARAMS ((struct extra *, struct type *)); +static void add_name (struct extra *, char *); +static void add_mangled_type (struct extra *, struct type *); #if 0 -static void cfront_mangle_name PARAMS ((struct type *, int, int)); +static void cfront_mangle_name (struct type *, int, int); #endif -static void print_bit_vector PARAMS ((B_TYPE *, int)); -static void print_arg_types PARAMS ((struct type **, int)); -static void dump_fn_fieldlists PARAMS ((struct type *, int)); -static void print_cplus_stuff PARAMS ((struct type *, int)); -static void virtual_base_list_aux PARAMS ((struct type * dclass)); +static void print_bit_vector (B_TYPE *, int); +static void print_arg_types (struct type **, int); +static void dump_fn_fieldlists (struct type *, int); +static void print_cplus_stuff (struct type *, int); +static void virtual_base_list_aux (struct type *dclass); /* Alloc a new type structure and fill it with some defaults. If @@ -2885,7 +2885,7 @@ recursive_dump_type (type, spaces) obstack_free (&dont_print_type_obstack, NULL); } -static void build_gdbtypes PARAMS ((void)); +static void build_gdbtypes (void); static void build_gdbtypes () { @@ -3045,7 +3045,7 @@ build_gdbtypes () } -extern void _initialize_gdbtypes PARAMS ((void)); +extern void _initialize_gdbtypes (void); void _initialize_gdbtypes () { diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 36f775a247a..19fd152f5ed 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -654,8 +654,7 @@ struct badness_vector extern const struct cplus_struct_type cplus_struct_default; -extern void -allocate_cplus_struct_type PARAMS ((struct type *)); +extern void allocate_cplus_struct_type (struct type *); #define INIT_CPLUS_SPECIFIC(type) \ (TYPE_CPLUS_SPECIFIC(type)=(struct cplus_struct_type*)&cplus_struct_default) @@ -946,132 +945,99 @@ extern struct type *builtin_type_f_void; ? obstack_alloc (&TYPE_OBJFILE (t) -> type_obstack, size) \ : xmalloc (size)) -extern struct type * - alloc_type PARAMS ((struct objfile *)); +extern struct type *alloc_type (struct objfile *); -extern struct type * - init_type PARAMS ((enum type_code, int, int, char *, struct objfile *)); +extern struct type *init_type (enum type_code, int, int, char *, + struct objfile *); -extern struct type * - lookup_reference_type PARAMS ((struct type *)); +extern struct type *lookup_reference_type (struct type *); -extern struct type * - make_reference_type PARAMS ((struct type *, struct type **)); +extern struct type *make_reference_type (struct type *, struct type **); -extern struct type * - make_cv_type PARAMS ((int, int, struct type *, struct type **)); +extern struct type *make_cv_type (int, int, struct type *, struct type **); -extern struct type * - lookup_member_type PARAMS ((struct type *, struct type *)); +extern struct type *lookup_member_type (struct type *, struct type *); extern void -smash_to_method_type PARAMS ((struct type *, struct type *, struct type *, - struct type **)); +smash_to_method_type (struct type *, struct type *, struct type *, + struct type **); extern void -smash_to_member_type PARAMS ((struct type *, struct type *, struct type *)); +smash_to_member_type (struct type *, struct type *, struct type *); -extern struct type * - allocate_stub_method PARAMS ((struct type *)); +extern struct type *allocate_stub_method (struct type *); -extern char * - type_name_no_tag PARAMS ((const struct type *)); +extern char *type_name_no_tag (const struct type *); -extern struct type * - lookup_struct_elt_type PARAMS ((struct type *, char *, int)); +extern struct type *lookup_struct_elt_type (struct type *, char *, int); -extern struct type * - make_pointer_type PARAMS ((struct type *, struct type **)); +extern struct type *make_pointer_type (struct type *, struct type **); -extern struct type * - lookup_pointer_type PARAMS ((struct type *)); +extern struct type *lookup_pointer_type (struct type *); -extern struct type * - make_function_type PARAMS ((struct type *, struct type **)); +extern struct type *make_function_type (struct type *, struct type **); -extern struct type * - lookup_function_type PARAMS ((struct type *)); +extern struct type *lookup_function_type (struct type *); -extern struct type * - create_range_type PARAMS ((struct type *, struct type *, int, int)); +extern struct type *create_range_type (struct type *, struct type *, int, + int); -extern struct type * - create_array_type PARAMS ((struct type *, struct type *, struct type *)); +extern struct type *create_array_type (struct type *, struct type *, + struct type *); -extern struct type * - create_string_type PARAMS ((struct type *, struct type *)); +extern struct type *create_string_type (struct type *, struct type *); -extern struct type *create_set_type PARAMS ((struct type *, struct type *)); +extern struct type *create_set_type (struct type *, struct type *); -extern int chill_varying_type PARAMS ((struct type *)); +extern int chill_varying_type (struct type *); -extern struct type * - lookup_unsigned_typename PARAMS ((char *)); +extern struct type *lookup_unsigned_typename (char *); -extern struct type * - lookup_signed_typename PARAMS ((char *)); +extern struct type *lookup_signed_typename (char *); -extern struct type * - check_typedef PARAMS ((struct type *)); +extern struct type *check_typedef (struct type *); #define CHECK_TYPEDEF(TYPE) (TYPE) = check_typedef (TYPE) -extern void -check_stub_method PARAMS ((struct type *, int, int)); +extern void check_stub_method (struct type *, int, int); -extern struct type * - lookup_primitive_typename PARAMS ((char *)); +extern struct type *lookup_primitive_typename (char *); -extern char * - gdb_mangle_name PARAMS ((struct type *, int, int)); +extern char *gdb_mangle_name (struct type *, int, int); -extern struct type * - builtin_type PARAMS ((char **)); +extern struct type *builtin_type (char **); -extern struct type * - lookup_typename PARAMS ((char *, struct block *, int)); +extern struct type *lookup_typename (char *, struct block *, int); -extern struct type * - lookup_template_type PARAMS ((char *, struct type *, struct block *)); +extern struct type *lookup_template_type (char *, struct type *, + struct block *); -extern struct type * - lookup_fundamental_type PARAMS ((struct objfile *, int)); +extern struct type *lookup_fundamental_type (struct objfile *, int); -extern void -fill_in_vptr_fieldno PARAMS ((struct type *)); +extern void fill_in_vptr_fieldno (struct type *); -extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *)); +extern int get_destructor_fn_field (struct type *, int *, int *); -extern int get_discrete_bounds PARAMS ((struct type *, LONGEST *, LONGEST *)); +extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *); -extern int -is_ancestor PARAMS ((struct type *, struct type *)); +extern int is_ancestor (struct type *, struct type *); -extern int -has_vtable PARAMS ((struct type *)); +extern int has_vtable (struct type *); -extern struct type * - primary_base_class PARAMS ((struct type *)); +extern struct type *primary_base_class (struct type *); -extern struct type ** - virtual_base_list PARAMS ((struct type *)); +extern struct type **virtual_base_list (struct type *); -extern int -virtual_base_list_length PARAMS ((struct type *)); -extern int -virtual_base_list_length_skip_primaries PARAMS ((struct type *)); +extern int virtual_base_list_length (struct type *); +extern int virtual_base_list_length_skip_primaries (struct type *); -extern int -virtual_base_index PARAMS ((struct type *, struct type *)); -extern int -virtual_base_index_skip_primaries PARAMS ((struct type *, struct type *)); +extern int virtual_base_index (struct type *, struct type *); +extern int virtual_base_index_skip_primaries (struct type *, struct type *); -extern int -class_index_in_primary_list PARAMS ((struct type *)); +extern int class_index_in_primary_list (struct type *); -extern int -count_virtual_fns PARAMS ((struct type *)); +extern int count_virtual_fns (struct type *); /* Constants for HP/Taligent ANSI C++ runtime model */ @@ -1139,27 +1105,25 @@ count_virtual_fns PARAMS ((struct type *)); #define NS_POINTER_CONVERSION_BADNESS 10 -extern int -compare_badness PARAMS ((struct badness_vector *, struct badness_vector *)); +extern int compare_badness (struct badness_vector *, struct badness_vector *); -extern struct badness_vector * - rank_function PARAMS ((struct type **, int, struct type **, int)); +extern struct badness_vector *rank_function (struct type **, int, + struct type **, int); -extern int -rank_one_type PARAMS ((struct type *, struct type *)); +extern int rank_one_type (struct type *, struct type *); -extern void recursive_dump_type PARAMS ((struct type *, int)); +extern void recursive_dump_type (struct type *, int); /* printcmd.c */ extern void print_scalar_formatted (char *, struct type *, int, int, struct ui_file *); -extern int can_dereference PARAMS ((struct type *)); +extern int can_dereference (struct type *); -extern int is_integral_type PARAMS ((struct type *)); +extern int is_integral_type (struct type *); -extern void maintenance_print_type PARAMS ((char *, int)); +extern void maintenance_print_type (char *, int); /* typeprint.c */ diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index c839d11b6d9..6668f06e4e4 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -879,7 +879,7 @@ go32_handle_nonaligned_watchpoint (wp_op what, CORE_ADDR waddr, CORE_ADDR addr, else if (what == wp_count) rv++; else - status = -1; + status = EINVAL; /* We keep the loop going even after a failure, because some of the other aligned watchpoints might still succeed, e.g. if they watch addresses that are already watched, and thus just @@ -1055,7 +1055,7 @@ go32_insert_hw_breakpoint (CORE_ADDR addr, void *shadow ATTRIBUTE_UNUSED) } SHOW_DR (insert_hw, 0); - return i < 4 ? 0 : -1; + return i < 4 ? 0 : EBUSY; } /* Put the device open on handle FD into either raw or cooked diff --git a/gdb/gould-tdep.c b/gdb/gould-tdep.c deleted file mode 100644 index 3c70165a5c0..00000000000 --- a/gdb/gould-tdep.c +++ /dev/null @@ -1,310 +0,0 @@ -/* OBSOLETE /* GOULD RISC target-dependent code for GDB, the GNU debugger. */ -/* OBSOLETE Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "symtab.h" */ -/* OBSOLETE #include "frame.h" */ -/* OBSOLETE #include "gdbcore.h" */ -/* OBSOLETE #if defined GOULD_PN */ -/* OBSOLETE #include "opcode/pn.h" */ -/* OBSOLETE #else */ -/* OBSOLETE #include "opcode/np1.h" */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE /* GOULD RISC instructions are never longer than this many bytes. *x/ */ -/* OBSOLETE #define MAXLEN 4 */ -/* OBSOLETE */ -/* OBSOLETE /* Number of elements in the opcode table. *x/ */ -/* OBSOLETE #define NOPCODES (sizeof gld_opcodes / sizeof gld_opcodes[0]) */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE gould_frame_chain_valid (chain, fi) */ -/* OBSOLETE CORE_ADDR chain; */ -/* OBSOLETE struct frame_info *fi; /* not used here *x/ */ -/* OBSOLETE { */ -/* OBSOLETE return (chain != 0 && chain != (thisframe)->frame); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Both gcc and cc return small structs in registers (i.e. in GDB */ -/* OBSOLETE terminology, small structs don't use the struct return convention). *x/ */ -/* OBSOLETE int */ -/* OBSOLETE gould_use_struct_convention (gcc_p, type) */ -/* OBSOLETE int gcc_p; */ -/* OBSOLETE struct type *type; */ -/* OBSOLETE { */ -/* OBSOLETE return (TYPE_LENGTH(type) > 8); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Print the GOULD instruction at address MEMADDR in debugged memory, */ -/* OBSOLETE on STREAM. Returns length of the instruction, in bytes. *x/ */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE gould_print_insn (memaddr, stream) */ -/* OBSOLETE CORE_ADDR memaddr; */ -/* OBSOLETE FILE *stream; */ -/* OBSOLETE { */ -/* OBSOLETE unsigned char buffer[MAXLEN]; */ -/* OBSOLETE register int i; */ -/* OBSOLETE register char *d; */ -/* OBSOLETE register int bestmask; */ -/* OBSOLETE unsigned best; */ -/* OBSOLETE int temp, index, bestlen; */ -/* OBSOLETE */ -/* OBSOLETE read_memory (memaddr, buffer, MAXLEN); */ -/* OBSOLETE */ -/* OBSOLETE bestmask = 0; */ -/* OBSOLETE index = -1; */ -/* OBSOLETE best = 0xffffffff; */ -/* OBSOLETE for (i = 0; i < NOPCODES; i++) */ -/* OBSOLETE { */ -/* OBSOLETE register unsigned int opcode = gld_opcodes[i].opcode; */ -/* OBSOLETE register unsigned int mask = gld_opcodes[i].mask; */ -/* OBSOLETE register unsigned int len = gld_opcodes[i].length; */ -/* OBSOLETE register unsigned int test; */ -/* OBSOLETE */ -/* OBSOLETE /* Get possible opcode bytes into integer *x/ */ -/* OBSOLETE test = buffer[0] << 24; */ -/* OBSOLETE test |= buffer[1] << 16; */ -/* OBSOLETE test |= buffer[2] << 8; */ -/* OBSOLETE test |= buffer[3]; */ -/* OBSOLETE */ -/* OBSOLETE /* Mask with opcode and see if match *x/ */ -/* OBSOLETE if ((opcode & mask) == (test & mask)) */ -/* OBSOLETE { */ -/* OBSOLETE /* See if second or third match *x/ */ -/* OBSOLETE if (index >= 0) */ -/* OBSOLETE { */ -/* OBSOLETE /* Take new one if it looks good *x/ */ -/* OBSOLETE if (bestlen == MAXLEN && len == MAXLEN) */ -/* OBSOLETE { */ -/* OBSOLETE /* See if lower bits matched *x/ */ -/* OBSOLETE if (((bestmask & 3) == 0) && */ -/* OBSOLETE ((mask & 3) != 0)) */ -/* OBSOLETE { */ -/* OBSOLETE bestmask = mask; */ -/* OBSOLETE bestlen = len; */ -/* OBSOLETE best = test; */ -/* OBSOLETE index = i; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* First match, save it *x/ */ -/* OBSOLETE bestmask = mask; */ -/* OBSOLETE bestlen = len; */ -/* OBSOLETE best = test; */ -/* OBSOLETE index = i; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Handle undefined instructions. *x/ */ -/* OBSOLETE if (index < 0) */ -/* OBSOLETE { */ -/* OBSOLETE fprintf (stream, "undefined 0%o",(buffer[0]<<8)+buffer[1]); */ -/* OBSOLETE return 2; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Print instruction name *x/ */ -/* OBSOLETE fprintf (stream, "%-12s", gld_opcodes[index].name); */ -/* OBSOLETE */ -/* OBSOLETE /* Adjust if short instruction *x/ */ -/* OBSOLETE if (gld_opcodes[index].length < 4) */ -/* OBSOLETE { */ -/* OBSOLETE best >>= 16; */ -/* OBSOLETE i = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE i = 16; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Dump out instruction arguments *x/ */ -/* OBSOLETE for (d = gld_opcodes[index].args; *d; ++d) */ -/* OBSOLETE { */ -/* OBSOLETE switch (*d) */ -/* OBSOLETE { */ -/* OBSOLETE case 'f': */ -/* OBSOLETE fprintf (stream, "%d", (best >> (7 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'r': */ -/* OBSOLETE fprintf (stream, "r%d", (best >> (7 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'R': */ -/* OBSOLETE fprintf (stream, "r%d", (best >> (4 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'b': */ -/* OBSOLETE fprintf (stream, "b%d", (best >> (7 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'B': */ -/* OBSOLETE fprintf (stream, "b%d", (best >> (4 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'v': */ -/* OBSOLETE fprintf (stream, "b%d", (best >> (7 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'V': */ -/* OBSOLETE fprintf (stream, "b%d", (best >> (4 + i)) & 7); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'X': */ -/* OBSOLETE temp = (best >> 20) & 7; */ -/* OBSOLETE if (temp) */ -/* OBSOLETE fprintf (stream, "r%d", temp); */ -/* OBSOLETE else */ -/* OBSOLETE putc ('0', stream); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'A': */ -/* OBSOLETE temp = (best >> 16) & 7; */ -/* OBSOLETE if (temp) */ -/* OBSOLETE fprintf (stream, "(b%d)", temp); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'S': */ -/* OBSOLETE fprintf (stream, "#%d", best & 0x1f); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'I': */ -/* OBSOLETE fprintf (stream, "#%x", best & 0xffff); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'O': */ -/* OBSOLETE fprintf (stream, "%x", best & 0xffff); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'h': */ -/* OBSOLETE fprintf (stream, "%d", best & 0xfffe); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'd': */ -/* OBSOLETE fprintf (stream, "%d", best & 0xfffc); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'T': */ -/* OBSOLETE fprintf (stream, "%d", (best >> 8) & 0xff); */ -/* OBSOLETE break; */ -/* OBSOLETE case 'N': */ -/* OBSOLETE fprintf (stream, "%d", best & 0xff); */ -/* OBSOLETE break; */ -/* OBSOLETE default: */ -/* OBSOLETE putc (*d, stream); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Return length of instruction *x/ */ -/* OBSOLETE return (gld_opcodes[index].length); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Find the number of arguments to a function. */ -/* OBSOLETE *x/ */ -/* OBSOLETE findarg(frame) */ -/* OBSOLETE struct frame_info *frame; */ -/* OBSOLETE { */ -/* OBSOLETE register struct symbol *func; */ -/* OBSOLETE register unsigned pc; */ -/* OBSOLETE */ -/* OBSOLETE #ifdef notdef */ -/* OBSOLETE /* find starting address of frame function *x/ */ -/* OBSOLETE pc = get_pc_function_start (frame->pc); */ -/* OBSOLETE */ -/* OBSOLETE /* find function symbol info *x/ */ -/* OBSOLETE func = find_pc_function (pc); */ -/* OBSOLETE */ -/* OBSOLETE /* call blockframe code to look for match *x/ */ -/* OBSOLETE if (func != NULL) */ -/* OBSOLETE return (func->value.block->nsyms / sizeof(int)); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE return (-1); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * In the case of the NPL, the frame's norminal address is Br2 and the */ -/* OBSOLETE * previous routines frame is up the stack X bytes. Finding out what */ -/* OBSOLETE * 'X' is can be tricky. */ -/* OBSOLETE * */ -/* OBSOLETE * 1.) stored in the code function header xA(Br1). */ -/* OBSOLETE * 2.) must be careful of recurssion. */ -/* OBSOLETE *x/ */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE findframe(thisframe) */ -/* OBSOLETE struct frame_info *thisframe; */ -/* OBSOLETE { */ -/* OBSOLETE register CORE_ADDR pointer; */ -/* OBSOLETE CORE_ADDR framechain(); */ -/* OBSOLETE #if 0 */ -/* OBSOLETE struct frame_info *frame; */ -/* OBSOLETE */ -/* OBSOLETE /* Setup toplevel frame structure *x/ */ -/* OBSOLETE frame->pc = read_pc(); */ -/* OBSOLETE frame->next_frame = 0; */ -/* OBSOLETE frame->frame = read_register (SP_REGNUM); /* Br2 *x/ */ -/* OBSOLETE */ -/* OBSOLETE /* Search for this frame (start at current Br2) *x/ */ -/* OBSOLETE do */ -/* OBSOLETE { */ -/* OBSOLETE pointer = framechain(frame); */ -/* OBSOLETE frame->next_frame = frame->frame; */ -/* OBSOLETE frame->frame = pointer; */ -/* OBSOLETE frame->pc = FRAME_SAVED_PC(frame); */ -/* OBSOLETE } */ -/* OBSOLETE while (frame->next_frame != thisframe); */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE pointer = framechain (thisframe); */ -/* OBSOLETE */ -/* OBSOLETE /* stop gap for now, end at __base3 *x/ */ -/* OBSOLETE if (thisframe->pc == 0) */ -/* OBSOLETE return 0; */ -/* OBSOLETE */ -/* OBSOLETE return pointer; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* */ -/* OBSOLETE * Gdb front-end and internal framechain routine. */ -/* OBSOLETE * Go back up stack one level. Tricky... */ -/* OBSOLETE *x/ */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE framechain(frame) */ -/* OBSOLETE register struct frame_info *frame; */ -/* OBSOLETE { */ -/* OBSOLETE register CORE_ADDR func, prevsp; */ -/* OBSOLETE register unsigned value; */ -/* OBSOLETE */ -/* OBSOLETE /* Get real function start address from internal frame address *x/ */ -/* OBSOLETE func = get_pc_function_start(frame->pc); */ -/* OBSOLETE */ -/* OBSOLETE /* If no stack given, read register Br1 "(sp)" *x/ */ -/* OBSOLETE if (!frame->frame) */ -/* OBSOLETE prevsp = read_register (SP_REGNUM); */ -/* OBSOLETE else */ -/* OBSOLETE prevsp = frame->frame; */ -/* OBSOLETE */ -/* OBSOLETE /* Check function header, case #2 *x/ */ -/* OBSOLETE value = read_memory_integer (func, 4); */ -/* OBSOLETE if (value) */ -/* OBSOLETE { */ -/* OBSOLETE /* 32bit call push value stored in function header *x/ */ -/* OBSOLETE prevsp += value; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* read half-word from suabr at start of function *x/ */ -/* OBSOLETE prevsp += read_memory_integer (func + 10, 2); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE return (prevsp); */ -/* OBSOLETE } */ diff --git a/gdb/gould-xdep.c b/gdb/gould-xdep.c deleted file mode 100644 index 72e17d48cc9..00000000000 --- a/gdb/gould-xdep.c +++ /dev/null @@ -1,130 +0,0 @@ -/* OBSOLETE /* Low level interface to ptrace, for GDB when running under Unix. */ -/* OBSOLETE Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "frame.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE */ -/* OBSOLETE #include */ -/* OBSOLETE #include */ -/* OBSOLETE #include */ -/* OBSOLETE #include */ -/* OBSOLETE #include */ -/* OBSOLETE #include */ -/* OBSOLETE */ -/* OBSOLETE #include "gdbcore.h" */ -/* OBSOLETE */ -/* OBSOLETE #include */ -/* OBSOLETE #include "gdb_stat.h" */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Work with core dump and executable files, for GDB. */ -/* OBSOLETE This code would be in corefile.c if it weren't machine-dependent. *x/ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE core_file_command (filename, from_tty) */ -/* OBSOLETE char *filename; */ -/* OBSOLETE int from_tty; */ -/* OBSOLETE { */ -/* OBSOLETE int val; */ -/* OBSOLETE extern char registers[]; */ -/* OBSOLETE */ -/* OBSOLETE /* Discard all vestiges of any previous core file */ -/* OBSOLETE and mark data and stack spaces as empty. *x/ */ -/* OBSOLETE */ -/* OBSOLETE if (corefile) */ -/* OBSOLETE free (corefile); */ -/* OBSOLETE corefile = 0; */ -/* OBSOLETE */ -/* OBSOLETE if (corechan >= 0) */ -/* OBSOLETE close (corechan); */ -/* OBSOLETE corechan = -1; */ -/* OBSOLETE */ -/* OBSOLETE data_start = 0; */ -/* OBSOLETE data_end = 0; */ -/* OBSOLETE stack_start = STACK_END_ADDR; */ -/* OBSOLETE stack_end = STACK_END_ADDR; */ -/* OBSOLETE */ -/* OBSOLETE /* Now, if a new core file was specified, open it and digest it. *x/ */ -/* OBSOLETE */ -/* OBSOLETE if (filename) */ -/* OBSOLETE { */ -/* OBSOLETE filename = tilde_expand (filename); */ -/* OBSOLETE make_cleanup (free, filename); */ -/* OBSOLETE */ -/* OBSOLETE if (have_inferior_p ()) */ -/* OBSOLETE error ("To look at a core file, you must kill the program with \"kill\"."); */ -/* OBSOLETE corechan = open (filename, O_RDONLY, 0); */ -/* OBSOLETE if (corechan < 0) */ -/* OBSOLETE perror_with_name (filename); */ -/* OBSOLETE /* 4.2-style (and perhaps also sysV-style) core dump file. *x/ */ -/* OBSOLETE { */ -/* OBSOLETE struct user u; */ -/* OBSOLETE int reg_offset; */ -/* OBSOLETE */ -/* OBSOLETE val = myread (corechan, &u, sizeof u); */ -/* OBSOLETE if (val < 0) */ -/* OBSOLETE perror_with_name (filename); */ -/* OBSOLETE data_start = exec_data_start; */ -/* OBSOLETE */ -/* OBSOLETE data_end = data_start + NBPG * u.u_dsize; */ -/* OBSOLETE stack_start = stack_end - NBPG * u.u_ssize; */ -/* OBSOLETE data_offset = NBPG * UPAGES; */ -/* OBSOLETE stack_offset = NBPG * (UPAGES + u.u_dsize); */ -/* OBSOLETE reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; */ -/* OBSOLETE */ -/* OBSOLETE /* I don't know where to find this info. */ -/* OBSOLETE So, for now, mark it as not available. *x/ */ -/* OBSOLETE core_aouthdr.a_magic = 0; */ -/* OBSOLETE */ -/* OBSOLETE /* Read the register values out of the core file and store */ -/* OBSOLETE them where `read_register' will find them. *x/ */ -/* OBSOLETE */ -/* OBSOLETE { */ -/* OBSOLETE register int regno; */ -/* OBSOLETE */ -/* OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) */ -/* OBSOLETE { */ -/* OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; */ -/* OBSOLETE */ -/* OBSOLETE val = lseek (corechan, register_addr (regno, reg_offset), 0); */ -/* OBSOLETE if (val < 0) */ -/* OBSOLETE perror_with_name (filename); */ -/* OBSOLETE */ -/* OBSOLETE val = myread (corechan, buf, sizeof buf); */ -/* OBSOLETE if (val < 0) */ -/* OBSOLETE perror_with_name (filename); */ -/* OBSOLETE supply_register (regno, buf); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE if (filename[0] == '/') */ -/* OBSOLETE corefile = savestring (filename, strlen (filename)); */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE corefile = concat (current_directory, "/", filename, NULL); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE flush_cached_frames (); */ -/* OBSOLETE select_frame (get_current_frame (), 0); */ -/* OBSOLETE validate_files (); */ -/* OBSOLETE } */ -/* OBSOLETE else if (from_tty) */ -/* OBSOLETE printf ("No core file now.\n"); */ -/* OBSOLETE } */ diff --git a/gdb/gregset.h b/gdb/gregset.h new file mode 100644 index 00000000000..3a85397455a --- /dev/null +++ b/gdb/gregset.h @@ -0,0 +1,50 @@ +/* Interface for functions using gregset and fpregset types. + Copyright (C) 2000 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 GDB_GREGSET_T +#define GDB_GREGSET_T gregset_t +#endif + +#ifndef GDB_FPREGSET_T +#define GDB_FPREGSET_T fpregset_t +#endif + +typedef GDB_GREGSET_T gdb_gregset_t; +typedef GDB_FPREGSET_T gdb_fpregset_t; + +/* A gregset is a data structure supplied by the native OS containing + the general register values of the debugged process. Usually this + includes integer registers and control registers. An fpregset is a + data structure containing the floating point registers. These data + structures were originally a part of the /proc interface, but have + been borrowed or copied by other GDB targets, eg. Linux. */ + +/* Copy register values from the native target gregset / fpregset + into GDB's internal register cache. */ + +extern void supply_gregset (gdb_gregset_t *gregs); +extern void supply_fpregset (gdb_fpregset_t *fpregs); + +/* Copy register values from GDB's register cache into + the native target gregset / fpregset. If regno is -1, + copy all the registers. */ + +extern void fill_gregset (gdb_gregset_t *gregs, int regno); +extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index a0bea530d93..af2530cccd8 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -67,7 +67,7 @@ char **h8300_register_names = original_register_names; /* Local function declarations. */ static CORE_ADDR examine_prologue (); -static void set_machine_hook PARAMS ((char *filename)); +static void set_machine_hook (char *filename); void h8300_frame_find_saved_regs (); diff --git a/gdb/hp-psymtab-read.c b/gdb/hp-psymtab-read.c index d3d0ff2eeff..f1aa4756e92 100644 --- a/gdb/hp-psymtab-read.c +++ b/gdb/hp-psymtab-read.c @@ -38,31 +38,25 @@ /* Forward procedure declarations */ -void hpread_symfile_init - PARAMS ((struct objfile *)); +void hpread_symfile_init (struct objfile *); -void -do_pxdb PARAMS ((bfd *)); +void do_pxdb (bfd *); -void hpread_build_psymtabs - PARAMS ((struct objfile *, int)); +void hpread_build_psymtabs (struct objfile *, int); -void hpread_symfile_finish - PARAMS ((struct objfile *)); +void hpread_symfile_finish (struct objfile *); -static union dnttentry *hpread_get_gntt - PARAMS ((int, struct objfile *)); +static union dnttentry *hpread_get_gntt (int, struct objfile *); -static unsigned long hpread_get_textlow - PARAMS ((int, int, struct objfile *, int)); +static unsigned long hpread_get_textlow (int, int, struct objfile *, int); static struct partial_symtab *hpread_start_psymtab - PARAMS ((struct objfile *, char *, CORE_ADDR, int, - struct partial_symbol **, struct partial_symbol **)); + (struct objfile *, char *, CORE_ADDR, int, + struct partial_symbol **, struct partial_symbol **); static struct partial_symtab *hpread_end_psymtab - PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR, - struct partial_symtab **, int)); + (struct partial_symtab *, char **, int, int, CORE_ADDR, + struct partial_symtab **, int); /* End of forward routine declarations */ @@ -601,7 +595,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile LOC_BLOCK, /* "I am a routine" */ &objfile->global_psymbols, (qPD[curr_pd].adrStart + /* Starting address of rtn */ - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)), + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))), 0, /* core addr?? */ trans_lang ((enum hp_language) qPD[curr_pd].language), objfile); @@ -614,7 +608,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile LOC_BLOCK, /* "I am a routine" */ &objfile->static_psymbols, (qPD[curr_pd].adrStart + /* Starting address of rtn */ - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)), + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))), 0, /* core addr?? */ trans_lang ((enum hp_language) qPD[curr_pd].language), objfile); @@ -1628,7 +1622,7 @@ hpread_build_psymtabs (objfile, mainline) (struct partial_symtab **) alloca (dependencies_allocated * sizeof (struct partial_symtab *)); - old_chain = make_cleanup ((make_cleanup_func) free_objfile, objfile); + old_chain = make_cleanup_free_objfile (objfile); last_source_file = 0; @@ -1816,7 +1810,7 @@ hpread_build_psymtabs (objfile, mainline) past_first_source_file = 1; valu = hpread_get_textlow (i, hp_symnum, objfile, symcount); - valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); pst = hpread_start_psymtab (objfile, namestring, valu, (hp_symnum @@ -1850,7 +1844,7 @@ hpread_build_psymtabs (objfile, mainline) /* Now begin a new module and a new psymtab for it */ SET_NAMESTRING (dn_bufp, &namestring, objfile); valu = hpread_get_textlow (i, hp_symnum, objfile, symcount); - valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (!pst) { pst = hpread_start_psymtab (objfile, @@ -1869,11 +1863,11 @@ hpread_build_psymtabs (objfile, mainline) /* The beginning of a function. DNTT_TYPE_ENTRY may also denote a secondary entry point. */ valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT); + SECT_OFF_TEXT (objfile)); if (valu > texthigh) texthigh = valu; valu = dn_bufp->dfunc.lowaddr + - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); SET_NAMESTRING (dn_bufp, &namestring, objfile); if (dn_bufp->dfunc.global) add_psymbol_to_list (namestring, strlen (namestring), @@ -1890,11 +1884,11 @@ hpread_build_psymtabs (objfile, mainline) case DNTT_TYPE_DOC_FUNCTION: valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT); + SECT_OFF_TEXT (objfile)); if (valu > texthigh) texthigh = valu; valu = dn_bufp->ddocfunc.lowaddr + - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); SET_NAMESTRING (dn_bufp, &namestring, objfile); if (dn_bufp->ddocfunc.global) add_psymbol_to_list (namestring, strlen (namestring), @@ -1984,7 +1978,7 @@ hpread_build_psymtabs (objfile, mainline) valu = dn_bufp->dsvar.location; /* Relocate in case it's in a shared library */ if (storage == LOC_STATIC) - valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); /* Luckily, dvar, svar, typedef, and tagdef all have their "global" bit in the same place, so it works @@ -2208,7 +2202,7 @@ hpread_start_psymtab (objfile, struct partial_symbol **global_syms; struct partial_symbol **static_syms; { - int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); extern void hpread_psymtab_to_symtab (); struct partial_symtab *result = start_psymtab_common (objfile, objfile->section_offsets, @@ -2246,7 +2240,7 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset, { int i; struct objfile *objfile = pst->objfile; - int offset = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT); + int offset = ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (objfile)); #ifdef DUMPING /* Turn on to see what kind of a psymtab we've built. */ diff --git a/gdb/hp-symtab-read.c b/gdb/hp-symtab-read.c index dc045a4ef4e..e4c10f5c260 100644 --- a/gdb/hp-symtab-read.c +++ b/gdb/hp-symtab-read.c @@ -83,85 +83,73 @@ static struct complaint hpread_unhandled_blockdata_complaint = /* Forward procedure declarations */ -static unsigned long hpread_get_scope_start - PARAMS ((sltpointer, struct objfile *)); +static unsigned long hpread_get_scope_start (sltpointer, struct objfile *); -static unsigned long hpread_get_line - PARAMS ((sltpointer, struct objfile *)); +static unsigned long hpread_get_line (sltpointer, struct objfile *); -static CORE_ADDR hpread_get_location - PARAMS ((sltpointer, struct objfile *)); +static CORE_ADDR hpread_get_location (sltpointer, struct objfile *); -static void hpread_psymtab_to_symtab_1 - PARAMS ((struct partial_symtab *)); +static void hpread_psymtab_to_symtab_1 (struct partial_symtab *); -void hpread_psymtab_to_symtab - PARAMS ((struct partial_symtab *)); +void hpread_psymtab_to_symtab (struct partial_symtab *); static struct symtab *hpread_expand_symtab - PARAMS ((struct objfile *, int, int, CORE_ADDR, int, - struct section_offsets *, char *)); + (struct objfile *, int, int, CORE_ADDR, int, + struct section_offsets *, char *); -static int hpread_type_translate - PARAMS ((dnttpointer)); +static int hpread_type_translate (dnttpointer); -static struct type **hpread_lookup_type - PARAMS ((dnttpointer, struct objfile *)); +static struct type **hpread_lookup_type (dnttpointer, struct objfile *); -static struct type *hpread_alloc_type - PARAMS ((dnttpointer, struct objfile *)); +static struct type *hpread_alloc_type (dnttpointer, struct objfile *); static struct type *hpread_read_enum_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); static struct type *hpread_read_function_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *, int)); + (dnttpointer, union dnttentry *, struct objfile *, int); static struct type *hpread_read_doc_function_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *, int)); + (dnttpointer, union dnttentry *, struct objfile *, int); static struct type *hpread_read_struct_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); -static struct type *hpread_get_nth_template_arg - PARAMS ((struct objfile *, int)); +static struct type *hpread_get_nth_template_arg (struct objfile *, int); static struct type *hpread_read_templ_arg_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *, char *)); + (dnttpointer, union dnttentry *, struct objfile *, char *); static struct type *hpread_read_set_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); static struct type *hpread_read_array_type - PARAMS ((dnttpointer, union dnttentry * dn_bufp, struct objfile * objfile)); + (dnttpointer, union dnttentry *dn_bufp, struct objfile *objfile); static struct type *hpread_read_subrange_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); -static struct type *hpread_type_lookup - PARAMS ((dnttpointer, struct objfile *)); +static struct type *hpread_type_lookup (dnttpointer, struct objfile *); static sltpointer hpread_record_lines - PARAMS ((struct subfile *, sltpointer, sltpointer, - struct objfile *, CORE_ADDR)); + (struct subfile *, sltpointer, sltpointer, struct objfile *, CORE_ADDR); static void hpread_process_one_debug_symbol - PARAMS ((union dnttentry *, char *, struct section_offsets *, - struct objfile *, CORE_ADDR, int, char *, int, int *)); + (union dnttentry *, char *, struct section_offsets *, + struct objfile *, CORE_ADDR, int, char *, int, int *); -static int hpread_get_scope_depth - PARAMS ((union dnttentry *, struct objfile *, int)); +static int hpread_get_scope_depth (union dnttentry *, struct objfile *, int); static void fix_static_member_physnames - PARAMS ((struct type *, char *, struct objfile *)); + (struct type *, char *, struct objfile *); static void fixup_class_method_type - PARAMS ((struct type *, struct type *, struct objfile *)); + (struct type *, struct type *, struct objfile *); -static void hpread_adjust_bitoffsets PARAMS ((struct type *, int)); +static void hpread_adjust_bitoffsets (struct type *, int); static dnttpointer hpread_get_next_skip_over_anon_unions - PARAMS ((int, dnttpointer, union dnttentry **, struct objfile *)); + (int, dnttpointer, union dnttentry **, struct objfile *); /* Global to indicate presence of HP-compiled objects, in particular, SOM executable file with SOM debug info @@ -2823,8 +2811,8 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile, unsigned long desc; int type; CORE_ADDR valu; - int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT); - int data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA); + int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); + int data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA (objfile)); union dnttentry *dn_temp; dnttpointer hp_type; struct symbol *sym; diff --git a/gdb/hp300ux-nat.c b/gdb/hp300ux-nat.c index b6a6624e700..6a01e33b04b 100644 --- a/gdb/hp300ux-nat.c +++ b/gdb/hp300ux-nat.c @@ -35,14 +35,11 @@ #include -static void -fetch_inferior_register PARAMS ((int, unsigned int)); +static void fetch_inferior_register (int, unsigned int); -static void -store_inferior_register_1 PARAMS ((int, unsigned int, int)); +static void store_inferior_register_1 (int, unsigned int, int); -static void -store_inferior_register PARAMS ((int, unsigned int)); +static void store_inferior_register (int, unsigned int); /* Get kernel_u_addr using HPUX-style nlist(). */ CORE_ADDR kernel_u_addr; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index b9d0a5c266a..20ad6c020e4 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -62,70 +62,70 @@ #define THREAD_INITIAL_FRAME_SYMBOL "__pthread_exit" #define THREAD_INITIAL_FRAME_SYM_LEN sizeof(THREAD_INITIAL_FRAME_SYMBOL) -static int extract_5_load PARAMS ((unsigned int)); +static int extract_5_load (unsigned int); -static unsigned extract_5R_store PARAMS ((unsigned int)); +static unsigned extract_5R_store (unsigned int); -static unsigned extract_5r_store PARAMS ((unsigned int)); +static unsigned extract_5r_store (unsigned int); -static void find_dummy_frame_regs PARAMS ((struct frame_info *, - struct frame_saved_regs *)); +static void find_dummy_frame_regs (struct frame_info *, + struct frame_saved_regs *); -static int find_proc_framesize PARAMS ((CORE_ADDR)); +static int find_proc_framesize (CORE_ADDR); -static int find_return_regnum PARAMS ((CORE_ADDR)); +static int find_return_regnum (CORE_ADDR); -struct unwind_table_entry *find_unwind_entry PARAMS ((CORE_ADDR)); +struct unwind_table_entry *find_unwind_entry (CORE_ADDR); -static int extract_17 PARAMS ((unsigned int)); +static int extract_17 (unsigned int); -static unsigned deposit_21 PARAMS ((unsigned int, unsigned int)); +static unsigned deposit_21 (unsigned int, unsigned int); -static int extract_21 PARAMS ((unsigned)); +static int extract_21 (unsigned); -static unsigned deposit_14 PARAMS ((int, unsigned int)); +static unsigned deposit_14 (int, unsigned int); -static int extract_14 PARAMS ((unsigned)); +static int extract_14 (unsigned); -static void unwind_command PARAMS ((char *, int)); +static void unwind_command (char *, int); -static int low_sign_extend PARAMS ((unsigned int, unsigned int)); +static int low_sign_extend (unsigned int, unsigned int); -static int sign_extend PARAMS ((unsigned int, unsigned int)); +static int sign_extend (unsigned int, unsigned int); -static int restore_pc_queue PARAMS ((struct frame_saved_regs *)); +static int restore_pc_queue (struct frame_saved_regs *); -static int hppa_alignof PARAMS ((struct type *)); +static int hppa_alignof (struct type *); /* To support multi-threading and stepping. */ -int hppa_prepare_to_proceed PARAMS (()); +int hppa_prepare_to_proceed (); -static int prologue_inst_adjust_sp PARAMS ((unsigned long)); +static int prologue_inst_adjust_sp (unsigned long); -static int is_branch PARAMS ((unsigned long)); +static int is_branch (unsigned long); -static int inst_saves_gr PARAMS ((unsigned long)); +static int inst_saves_gr (unsigned long); -static int inst_saves_fr PARAMS ((unsigned long)); +static int inst_saves_fr (unsigned long); -static int pc_in_interrupt_handler PARAMS ((CORE_ADDR)); +static int pc_in_interrupt_handler (CORE_ADDR); -static int pc_in_linker_stub PARAMS ((CORE_ADDR)); +static int pc_in_linker_stub (CORE_ADDR); -static int compare_unwind_entries PARAMS ((const void *, const void *)); +static int compare_unwind_entries (const void *, const void *); -static void read_unwind_info PARAMS ((struct objfile *)); +static void read_unwind_info (struct objfile *); -static void internalize_unwinds PARAMS ((struct objfile *, - struct unwind_table_entry *, - asection *, unsigned int, - unsigned int, CORE_ADDR)); -static void pa_print_registers PARAMS ((char *, int, int)); +static void internalize_unwinds (struct objfile *, + struct unwind_table_entry *, + asection *, unsigned int, + unsigned int, CORE_ADDR); +static void pa_print_registers (char *, int, int); static void pa_strcat_registers (char *, int, int, struct ui_file *); -static void pa_register_look_aside PARAMS ((char *, int, long *)); -static void pa_print_fp_reg PARAMS ((int)); +static void pa_register_look_aside (char *, int, long *); +static void pa_print_fp_reg (int); static void pa_strcat_fp_reg (int, struct ui_file *, enum precision_type); -static void record_text_segment_lowaddr PARAMS ((bfd *, asection *, void *)); +static void record_text_segment_lowaddr (bfd *, asection *, void *); typedef struct { @@ -146,8 +146,7 @@ extern int hp_som_som_object_present; extern int exception_catchpoints_are_fragile; /* This is defined in valops.c. */ -extern value_ptr - find_function_in_inferior PARAMS ((char *)); +extern value_ptr find_function_in_inferior (char *); /* Should call_function allocate stack space for a struct return? */ int @@ -781,7 +780,7 @@ find_proc_framesize (pc) } /* Return offset from sp at which rp is saved, or 0 if not saved. */ -static int rp_saved PARAMS ((CORE_ADDR)); +static int rp_saved (CORE_ADDR); static int rp_saved (pc) @@ -1618,7 +1617,7 @@ hppa_pop_frame () breakpoint->silent = 1; /* So we can clean things up. */ - old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + old_chain = make_cleanup_delete_breakpoint (breakpoint); /* Start up the inferior. */ clear_proceed_status (); @@ -2005,11 +2004,11 @@ find_stub_with_shl_get (function, handle) /* now prepare the arguments for the call */ args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12); - args[1] = value_from_longest (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol)); - args[2] = value_from_longest (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr); + args[1] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol)); + args[2] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr); args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE); - args[4] = value_from_longest (TYPE_FIELD_TYPE (ftype, 4), value_return_addr); - args[5] = value_from_longest (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr); + args[4] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 4), value_return_addr); + args[5] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr); /* now call the function */ diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 67e507cc348..30e7ab9b920 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -33,7 +33,7 @@ extern CORE_ADDR text_end; -static void fetch_register PARAMS ((int)); +static void fetch_register (int); void fetch_inferior_registers (regno) @@ -492,7 +492,7 @@ startup_semaphore_t; static startup_semaphore_t startup_semaphore; -extern int parent_attach_all PARAMS ((int, PTRACE_ARG3_TYPE, int)); +extern int parent_attach_all (int, PTRACE_ARG3_TYPE, int); #ifdef PT_SETTRC /* This function causes the caller's process to be traced by its diff --git a/gdb/hpread.c b/gdb/hpread.c index 4da08e4927d..f49f01e653f 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -135,77 +135,69 @@ extern struct complaint lbrac_unmatched_complaint; extern struct complaint lbrac_mismatch_complaint; -void hpread_symfile_init PARAMS ((struct objfile *)); +void hpread_symfile_init (struct objfile *); -static struct type * - hpread_read_array_type PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); +static struct type *hpread_read_array_type (dnttpointer, union dnttentry *, + struct objfile *); -static struct type *hpread_alloc_type - PARAMS ((dnttpointer, struct objfile *)); +static struct type *hpread_alloc_type (dnttpointer, struct objfile *); -static struct type **hpread_lookup_type - PARAMS ((dnttpointer, struct objfile *)); +static struct type **hpread_lookup_type (dnttpointer, struct objfile *); static struct type *hpread_read_enum_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); static struct type *hpread_read_set_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); static struct type *hpread_read_subrange_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); static struct type *hpread_read_struct_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); -void hpread_build_psymtabs - PARAMS ((struct objfile *, int)); +void hpread_build_psymtabs (struct objfile *, int); -void hpread_symfile_finish PARAMS ((struct objfile *)); +void hpread_symfile_finish (struct objfile *); static struct partial_symtab *hpread_start_psymtab - PARAMS ((struct objfile *, char *, CORE_ADDR, int, - struct partial_symbol **, struct partial_symbol **)); + (struct objfile *, char *, CORE_ADDR, int, + struct partial_symbol **, struct partial_symbol **); static struct partial_symtab *hpread_end_psymtab - PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR, - struct partial_symtab **, int)); + (struct partial_symtab *, char **, int, int, CORE_ADDR, + struct partial_symtab **, int); static struct symtab *hpread_expand_symtab - PARAMS ((struct objfile *, int, int, CORE_ADDR, int, - struct section_offsets *, char *)); + (struct objfile *, int, int, CORE_ADDR, int, + struct section_offsets *, char *); static void hpread_process_one_debug_symbol - PARAMS ((union dnttentry *, char *, struct section_offsets *, - struct objfile *, CORE_ADDR, int, char *, int)); + (union dnttentry *, char *, struct section_offsets *, + struct objfile *, CORE_ADDR, int, char *, int); static sltpointer hpread_record_lines - PARAMS ((struct subfile *, sltpointer, sltpointer, - struct objfile *, CORE_ADDR)); + (struct subfile *, sltpointer, sltpointer, struct objfile *, CORE_ADDR); static struct type *hpread_read_function_type - PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + (dnttpointer, union dnttentry *, struct objfile *); -static struct type *hpread_type_lookup - PARAMS ((dnttpointer, struct objfile *)); +static struct type *hpread_type_lookup (dnttpointer, struct objfile *); -static unsigned long hpread_get_depth - PARAMS ((sltpointer, struct objfile *)); +static unsigned long hpread_get_depth (sltpointer, struct objfile *); -static unsigned long hpread_get_line - PARAMS ((sltpointer, struct objfile *)); +static unsigned long hpread_get_line (sltpointer, struct objfile *); -static CORE_ADDR hpread_get_location - PARAMS ((sltpointer, struct objfile *)); +static CORE_ADDR hpread_get_location (sltpointer, struct objfile *); -static int hpread_type_translate PARAMS ((dnttpointer)); -static unsigned long hpread_get_textlow PARAMS ((int, int, struct objfile *)); -static union dnttentry *hpread_get_gntt PARAMS ((int, struct objfile *)); -static union dnttentry *hpread_get_lntt PARAMS ((int, struct objfile *)); -static union sltentry *hpread_get_slt PARAMS ((int, struct objfile *)); -static void hpread_psymtab_to_symtab PARAMS ((struct partial_symtab *)); -static void hpread_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *)); -static int hpread_has_name PARAMS ((enum dntt_entry_type)); +static int hpread_type_translate (dnttpointer); +static unsigned long hpread_get_textlow (int, int, struct objfile *); +static union dnttentry *hpread_get_gntt (int, struct objfile *); +static union dnttentry *hpread_get_lntt (int, struct objfile *); +static union sltentry *hpread_get_slt (int, struct objfile *); +static void hpread_psymtab_to_symtab (struct partial_symtab *); +static void hpread_psymtab_to_symtab_1 (struct partial_symtab *); +static int hpread_has_name (enum dntt_entry_type); /* Initialization for reading native HP C debug symbols from OBJFILE. @@ -358,7 +350,7 @@ hpread_build_psymtabs (objfile, mainline) (struct partial_symtab **) alloca (dependencies_allocated * sizeof (struct partial_symtab *)); - old_chain = make_cleanup (free_objfile, objfile); + old_chain = make_cleanup_free_objfile (objfile); last_source_file = 0; @@ -466,7 +458,7 @@ hpread_build_psymtabs (objfile, mainline) past_first_source_file = 1; valu = hpread_get_textlow (i, hp_symnum, objfile); - valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); pst = hpread_start_psymtab (objfile, namestring, valu, (hp_symnum @@ -484,7 +476,7 @@ hpread_build_psymtabs (objfile, mainline) is supposed to be. */ SET_NAMESTRING (dn_bufp, &namestring, objfile); valu = hpread_get_textlow (i, hp_symnum, objfile); - valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (!pst) { pst = hpread_start_psymtab (objfile, @@ -502,11 +494,11 @@ hpread_build_psymtabs (objfile, mainline) /* The beginning of a function. DNTT_TYPE_ENTRY may also denote a secondary entry point. */ valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT); + SECT_OFF_TEXT (objfile)); if (valu > texthigh) texthigh = valu; valu = dn_bufp->dfunc.lowaddr + - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); SET_NAMESTRING (dn_bufp, &namestring, objfile); add_psymbol_to_list (namestring, strlen (namestring), VAR_NAMESPACE, LOC_BLOCK, @@ -1775,7 +1767,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile, unsigned long desc; int type; CORE_ADDR valu; - int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT); + int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); union dnttentry *dn_temp; dnttpointer hp_type; struct symbol *sym; diff --git a/gdb/hpread.h b/gdb/hpread.h index 2768294829a..dc2a06cf90d 100644 --- a/gdb/hpread.h +++ b/gdb/hpread.h @@ -139,13 +139,10 @@ extern struct complaint string_table_offset_complaint; extern struct complaint lbrac_unmatched_complaint; extern struct complaint lbrac_mismatch_complaint; -extern union sltentry *hpread_get_slt - PARAMS ((int, struct objfile *)); +extern union sltentry *hpread_get_slt (int, struct objfile *); -extern union dnttentry *hpread_get_lntt - PARAMS ((int, struct objfile *)); +extern union dnttentry *hpread_get_lntt (int, struct objfile *); -int hpread_has_name - PARAMS ((enum dntt_entry_type)); +int hpread_has_name (enum dntt_entry_type); /* end of hpread.h */ diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 28a8d2de9da..f27d12b72f2 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -46,7 +46,7 @@ extern int child_suppress_run; extern struct target_ops child_ops; /* target vector for inftarg.c */ -extern void _initialize_hpux_thread PARAMS ((void)); +extern void _initialize_hpux_thread (void); struct string_map { @@ -61,14 +61,13 @@ static int main_pid; /* Real process ID */ static CORE_ADDR P_cma__g_known_threads; static CORE_ADDR P_cma__g_current_thread; -static struct cleanup *save_inferior_pid PARAMS ((void)); +static struct cleanup *save_inferior_pid (void); -static void restore_inferior_pid PARAMS ((int pid)); +static void restore_inferior_pid (int pid); -static void hpux_thread_resume PARAMS ((int pid, int step, - enum target_signal signo)); +static void hpux_thread_resume (int pid, int step, enum target_signal signo); -static void init_hpux_thread_ops PARAMS ((void)); +static void init_hpux_thread_ops (void); static struct target_ops hpux_thread_ops; @@ -113,7 +112,7 @@ restore_inferior_pid (pid) inferior_pid = pid; } -static int find_active_thread PARAMS ((void)); +static int find_active_thread (void); static int cached_thread; static int cached_active_thread; @@ -137,7 +136,7 @@ find_active_thread () return (cma_thread_get_unique (&tcb.prolog.client_thread) << 16) | main_pid; } -static cma__t_int_tcb *find_tcb PARAMS ((int thread)); +static cma__t_int_tcb *find_tcb (int thread); static cma__t_int_tcb * find_tcb (thread) @@ -525,7 +524,7 @@ hpux_thread_create_inferior (exec_file, allargs, env) */ /* Saved pointer to previous owner of the new_objfile event. */ -static void (*target_new_objfile_chain) PARAMS ((struct objfile *)); +static void (*target_new_objfile_chain) (struct objfile *); void hpux_thread_new_objfile (objfile) diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 93ea241759f..6a375589175 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -35,6 +35,9 @@ #include #endif +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* On Linux, threads are implemented as pseudo-processes, in which case we may be tracing more than one process at a time. In that case, inferior_pid will contain the main process ID and the @@ -123,6 +126,13 @@ int have_ptrace_getxfpregs = the GETREGS request. I want to avoid changing `infptrace.c' right now. */ +#ifndef PT_READ_U +#define PT_READ_U PTRACE_PEEKUSR +#endif +#ifndef PT_WRITE_U +#define PT_WRITE_U PTRACE_POKEUSR +#endif + /* Default the type of the ptrace transfer to int. */ #ifndef PTRACE_XFER_TYPE #define PTRACE_XFER_TYPE int @@ -950,6 +960,91 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, } } + +/* The instruction for a Linux system call is: + int $0x80 + or 0xcd 0x80. */ + +static const unsigned char linux_syscall[] = { 0xcd, 0x80 }; + +#define LINUX_SYSCALL_LEN (sizeof linux_syscall) + +/* The system call number is stored in the %eax register. */ +#define LINUX_SYSCALL_REGNUM 0 /* %eax */ + +/* We are specifically interested in the sigreturn and rt_sigreturn + system calls. */ + +#ifndef SYS_sigreturn +#define SYS_sigreturn 0x77 +#endif +#ifndef SYS_rt_sigreturn +#define SYS_rt_sigreturn 0xad +#endif + +/* Offset to saved processor flags, from . */ +#define LINUX_SIGCONTEXT_EFLAGS_OFFSET (64) + +/* Resume execution of the inferior process. + If STEP is nonzero, single-step it. + If SIGNAL is nonzero, give it that signal. */ + +void +child_resume (int pid, int step, enum target_signal signal) +{ + int request = PTRACE_CONT; + + if (pid == -1) + /* Resume all threads. */ + /* I think this only gets used in the non-threaded case, where "resume + all threads" and "resume inferior_pid" are the same. */ + pid = inferior_pid; + + if (step) + { + CORE_ADDR pc = read_pc_pid (pid); + unsigned char buf[LINUX_SYSCALL_LEN]; + + request = PTRACE_SINGLESTEP; + + /* Returning from a signal trampoline is done by calling a + special system call (sigreturn or rt_sigreturn, see + i386-linux-tdep.c for more information). This system call + restores the registers that were saved when the signal was + raised, including %eflags. That means that single-stepping + won't work. Instead, we'll have to modify the signal context + that's about to be restored, and set the trace flag there. */ + + /* First check if PC is at a system call. */ + if (read_memory_nobpt (pc, (char *) buf, LINUX_SYSCALL_LEN) == 0 + && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0) + { + int syscall = read_register_pid (LINUX_SYSCALL_REGNUM, pid); + + /* Then check the system call number. */ + if (syscall == SYS_sigreturn || syscall == SYS_rt_sigreturn) + { + CORE_ADDR sp = read_register (SP_REGNUM); + CORE_ADDR addr = sp; + unsigned long int eflags; + + if (syscall == SYS_rt_sigreturn) + addr = read_memory_integer (sp + 8, 4) + 20; + + /* Set the trace flag in the context that's about to be + restored. */ + addr += LINUX_SIGCONTEXT_EFLAGS_OFFSET; + read_memory (addr, (char *) &eflags, 4); + eflags |= 0x0100; + write_memory (addr, (char *) &eflags, 4); + } + } + } + + if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1) + perror_with_name ("ptrace"); +} + /* Calling functions in shared libraries. */ /* FIXME: kettenis/2000-03-05: Doesn't this belong in a diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 39990db0688..e2ebffa62a1 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -30,21 +30,21 @@ #include "gdbcmd.h" #include "command.h" -static long i386_get_frame_setup PARAMS ((CORE_ADDR)); +static long i386_get_frame_setup (CORE_ADDR); -static void i386_follow_jump PARAMS ((void)); +static void i386_follow_jump (void); -static void codestream_read PARAMS ((unsigned char *, int)); +static void codestream_read (unsigned char *, int); -static void codestream_seek PARAMS ((CORE_ADDR)); +static void codestream_seek (CORE_ADDR); -static unsigned char codestream_fill PARAMS ((int)); +static unsigned char codestream_fill (int); -CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *)); +CORE_ADDR skip_trampoline_code (CORE_ADDR, char *); static int gdb_print_insn_i386 (bfd_vma, disassemble_info *); -void _initialize_i386_tdep PARAMS ((void)); +void _initialize_i386_tdep (void); /* i386_register_byte[i] is the offset into the register file of the start of register number i. We initialize this from @@ -84,11 +84,12 @@ static char *valid_flavors[] = }; static char *disassembly_flavor = att_flavor; -static void i386_print_register PARAMS ((char *, int, int)); +static void i386_print_register (char *, int, int); /* This is used to keep the bfd arch_info in sync with the disassembly flavor. */ -static void set_disassembly_flavor_sfunc PARAMS ((char *, int, struct cmd_list_element *)); -static void set_disassembly_flavor PARAMS ((void)); +static void set_disassembly_flavor_sfunc (char *, int, + struct cmd_list_element *); +static void set_disassembly_flavor (void); /* Stdio style buffering was used to minimize calls to ptrace, but this buffering did not take into account that the code section being accessed @@ -938,7 +939,7 @@ _initialize_i386_tdep () new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class, valid_flavors, - (char *) &disassembly_flavor, + &disassembly_flavor, "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \ and the default value is \"att\".", &setlist); diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c index d395363375f..03154d262f2 100644 --- a/gdb/i386aix-nat.c +++ b/gdb/i386aix-nat.c @@ -52,7 +52,7 @@ extern int errno; #include "target.h" -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); /* this table must line up with REGISTER_NAMES in tm-i386v.h */ diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c new file mode 100644 index 00000000000..f1182ea4e80 --- /dev/null +++ b/gdb/i386bsd-nat.c @@ -0,0 +1,237 @@ +/* Native-dependent code for modern i386 BSD's. + Copyright (C) 2000 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 "inferior.h" + +#include +#include +#include +#include + +#ifdef HAVE_SYS_PROCFS_H +#include +#endif + +#ifndef HAVE_GREGSET_T +typedef struct reg gregset_t; +#endif + +#ifndef HAVE_FPREGSET_T +typedef struct fpreg fpregset_t; +#endif + +#include "gregset.h" + + +/* In older BSD versions we cannot get at some of the segment + registers. FreeBSD for example didn't support the %fs and %gs + registers until the 3.0 release. We have autoconf checks for their + presence, and deal gracefully with their absence. */ + +/* Registers we shouldn't try to fetch. */ +#if !defined (CANNOT_FETCH_REGISTER) +#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno) +#endif + +/* Registers we shouldn't try to store. */ +#if !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regno) cannot_fetch_register (regno) +#endif + +/* Offset to the gregset_t location where REG is stored. */ +#define REG_OFFSET(reg) offsetof (gregset_t, reg) + +/* At reg_offset[REGNO] you'll find the offset to the gregset_t + location where the GDB register REGNO is stored. Unsupported + registers are marked with `-1'. */ +static int reg_offset[] = +{ + REG_OFFSET (r_eax), + REG_OFFSET (r_ecx), + REG_OFFSET (r_edx), + REG_OFFSET (r_edx), + REG_OFFSET (r_esp), + REG_OFFSET (r_ebp), + REG_OFFSET (r_esi), + REG_OFFSET (r_edi), + REG_OFFSET (r_eip), + REG_OFFSET (r_eflags), + REG_OFFSET (r_cs), + REG_OFFSET (r_ss), + REG_OFFSET (r_ds), + REG_OFFSET (r_es), +#ifdef HAVE_STRUCT_REG_R_FS + REG_OFFSET (r_fs), +#else + -1, +#endif +#ifdef HAVE_STRUCT_REG_R_GS + REG_OFFSET (r_gs) +#else + -1 +#endif +}; + +#define REG_ADDR(regset, regno) ((char *) (regset) + reg_offset[regno]) + +/* Return nonzero if we shouldn't try to fetch register REGNO. */ + +static int +cannot_fetch_register (int regno) +{ + return (reg_offset[regno] == -1); +} + + +/* Transfering the registers between GDB, inferiors and core files. */ + +/* Fill GDB's register array with the genereal-purpose register values + in *GREGSETP. */ + +void +supply_gregset (gregset_t *gregsetp) +{ + int i; + + for (i = 0; i < NUM_GREGS; i++) + { + if (CANNOT_FETCH_REGISTER (i)) + supply_register (i, NULL); + else + supply_register (i, REG_ADDR (gregsetp, i)); + } +} + +/* Fill register REGNO (if it is a general-purpose register) in + *GREGSETPS with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_gregset (gregset_t *gregsetp, int regno) +{ + int i; + + for (i = 0; i < NUM_GREGS; i++) + if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i)) + memcpy (REG_ADDR (gregsetp, i), ®isters[REGISTER_BYTE (i)], + REGISTER_RAW_SIZE (i)); +} + +#include "i387-nat.h" + +/* Fill GDB's register array with the floating-point register values + in *FPREGSETP. */ + +void +supply_fpregset (fpregset_t *fpregsetp) +{ + i387_supply_fsave ((char *) fpregsetp); +} + +/* Fill register REGNO (if it is a floating-point register) in + *FPREGSETP with the value in GDB's register array. If REGNO is -1, + do this for all registers. */ + +void +fill_fpregset (fpregset_t *fpregsetp, int regno) +{ + i387_fill_fsave ((char *) fpregsetp, regno); +} + +/* Fetch register REGNO from the inferior. If REGNO is -1, do this + for all registers (including the floating point registers). */ + +void +fetch_inferior_registers (int regno) +{ + gregset_t gregs; + + if (ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't get registers"); + + supply_gregset (&gregs); + + if (regno == -1 || regno >= FP0_REGNUM) + { + fpregset_t fpregs; + + if (ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + supply_fpregset (&fpregs); + } +} + +/* Store register REGNO back into the inferior. If REGNO is -1, do + this for all registers (including the floating point registers). */ + +void +store_inferior_registers (int regno) +{ + gregset_t gregs; + + if (ptrace (PT_GETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't get registers"); + + fill_gregset (&gregs, regno); + + if (ptrace (PT_SETREGS, inferior_pid, (PTRACE_ARG3_TYPE) &gregs, 0) == -1) + perror_with_name ("Couldn't write registers"); + + if (regno == -1 || regno >= FP0_REGNUM) + { + fpregset_t fpregs; + + if (ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't get floating point status"); + + fill_fpregset (&fpregs, regno); + + if (ptrace (PT_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + perror_with_name ("Couldn't write floating point status"); + } +} + + +/* Support for the user struct. */ + +/* Return the address register REGNO. BLOCKEND is the value of + u.u_ar0, which should point to the registers. */ + +CORE_ADDR +register_u_addr (CORE_ADDR blockend, int regno) +{ + return (CORE_ADDR) REG_ADDR (blockend, regno); +} + +#include +#include + +/* Return the size of the user struct. */ + +int +kernel_u_size (void) +{ + return (sizeof (struct user)); +} diff --git a/gdb/i386mach-nat.c b/gdb/i386mach-nat.c index 5ecb103022a..ded044b75b9 100644 --- a/gdb/i386mach-nat.c +++ b/gdb/i386mach-nat.c @@ -37,7 +37,7 @@ #include "gdb_stat.h" #include -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); void fetch_inferior_registers (regno) @@ -129,11 +129,9 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) break; case 2: -#ifdef FP0_REGNUM memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, core_reg_size); /* FIXME, probably bogus */ -#endif #ifdef FPC_REGNUM memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], &corestr.c_fpu.f_fpstatus.f_ctrl, diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c index 0bf702c368c..9ae571605b9 100644 --- a/gdb/i386v-nat.c +++ b/gdb/i386v-nat.c @@ -134,12 +134,10 @@ static int debug_control_mirror; static CORE_ADDR address_lookup[DR_LASTADDR - DR_FIRSTADDR + 1]; static int -i386_insert_aligned_watchpoint PARAMS ((int, CORE_ADDR, CORE_ADDR, int, - int)); +i386_insert_aligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, int); static int -i386_insert_nonaligned_watchpoint PARAMS ((int, CORE_ADDR, CORE_ADDR, int, - int)); +i386_insert_nonaligned_watchpoint (int, CORE_ADDR, CORE_ADDR, int, int); /* Insert a watchpoint. */ @@ -229,12 +227,12 @@ i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw) int size; int rv; - static int size_try_array[16] = + static int size_try_array[4][4] = { - 1, 1, 1, 1, /* trying size one */ - 2, 1, 2, 1, /* trying size two */ - 2, 1, 2, 1, /* trying size three */ - 4, 1, 2, 1 /* trying size four */ + { 1, 1, 1, 1 }, /* trying size one */ + { 2, 1, 2, 1 }, /* trying size two */ + { 2, 1, 2, 1 }, /* trying size three */ + { 4, 1, 2, 1 } /* trying size four */ }; rv = 0; @@ -242,8 +240,7 @@ i386_insert_nonaligned_watchpoint (pid, waddr, addr, len, rw) { align = addr % 4; /* Four is the maximum length for 386. */ - size = (len > 4) ? 3 : len - 1; - size = size_try_array[size * 4 + align]; + size = size_try_array[len > 4 ? 3 : len - 1][align]; rv = i386_insert_aligned_watchpoint (pid, waddr, addr, size, rw); if (rv) diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c index 10802cb730b..a2664233e1b 100644 --- a/gdb/i386v4-nat.c +++ b/gdb/i386v4-nat.c @@ -31,6 +31,9 @@ #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* The /proc interface divides the target machine's register set up into two different sets, the general register set (gregset) and the floating point register set (fpregset). For each set, there is an ioctl to get @@ -89,13 +92,13 @@ static int regmap[] = /* Prototypes for local functions */ -void fill_gregset PARAMS ((gregset_t *, int)); +void fill_gregset (gregset_t *, int); -void supply_gregset PARAMS ((gregset_t *)); +void supply_gregset (gregset_t *); -void supply_fpregset PARAMS ((fpregset_t *)); +void supply_fpregset (fpregset_t *); -void fill_fpregset PARAMS ((fpregset_t *, int)); +void fill_fpregset (fpregset_t *, int); /* FIXME: These routine absolutely depends upon (NUM_REGS - NUM_FREGS) @@ -142,17 +145,65 @@ fill_gregset (gregsetp, regno) #endif /* HAVE_GREGSET_T */ -#if defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T) +#if defined (HAVE_FPREGSET_T) /* Given a pointer to a floating point register set in /proc format (fpregset_t *), unpack the register contents and supply them as gdb's idea of the current floating point register values. */ +/* FIXME: Assumes that fpregsetp contains an i387 FSAVE area. */ +static const int freg_offset_map[] = +{ +#if !defined(FPREGSET_FSAVE_OFFSET) +#define FPREGSET_FSAVE_OFFSET 0 +#endif + FPREGSET_FSAVE_OFFSET + 28 + 0 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 1 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 2 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 3 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 4 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 5 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 6 * 10, + FPREGSET_FSAVE_OFFSET + 28 + 7 * 10, + FPREGSET_FSAVE_OFFSET + 0, + FPREGSET_FSAVE_OFFSET + 4, + FPREGSET_FSAVE_OFFSET + 8, + FPREGSET_FSAVE_OFFSET + 16, + FPREGSET_FSAVE_OFFSET + 12, + FPREGSET_FSAVE_OFFSET + 24, + FPREGSET_FSAVE_OFFSET + 20, + FPREGSET_FSAVE_OFFSET + 16 +}; + void supply_fpregset (fpregsetp) fpregset_t *fpregsetp; { - /* FIXME: see m68k-tdep.c for an example, for the m68k. */ + int regi; + + if (NUM_FREGS == 0) + return; + for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++) + { + char tbuf[4]; + ULONGEST tval; + char *from = (char *) fpregsetp + freg_offset_map[regi - FP0_REGNUM]; + + if (regi == FCS_REGNUM) + { + tval = extract_unsigned_integer (from, 4) & 0xffff; + store_unsigned_integer (tbuf, 4, tval); + supply_register (regi, tbuf); + } + else if (regi == FOP_REGNUM) + { + tval = (extract_unsigned_integer (from, 4) >> 16) & ((1 << 11) - 1); + store_unsigned_integer (tbuf, 4, tval); + supply_register (regi, tbuf); + } + else + supply_register (regi, from); + } } /* Given a pointer to a floating point register set in /proc format @@ -165,9 +216,41 @@ fill_fpregset (fpregsetp, regno) fpregset_t *fpregsetp; int regno; { - /* FIXME: see m68k-tdep.c for an example, for the m68k. */ + int regi; + + if (NUM_FREGS == 0) + return; + for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++) + { + if ((regno == -1) || (regno == regi)) + { + char *to = (char *) fpregsetp + freg_offset_map[regi - FP0_REGNUM]; + char *from = (char *) ®isters[REGISTER_BYTE (regi)]; + ULONGEST valto; + ULONGEST valfrom; + + if (regi == FCS_REGNUM) + { + valto = extract_unsigned_integer (to, 4); + valfrom = extract_unsigned_integer (from, 4); + valto = (valto & ~0xffff) | (valfrom & 0xffff); + store_unsigned_integer (to, 4, valto); + } + else if (regi == FOP_REGNUM) + { + valto = extract_unsigned_integer (to, 4); + valfrom = extract_unsigned_integer (from, 4); + valto = (valto & 0xffff) | ((valfrom & ((1 << 11) - 1)) << 16); + store_unsigned_integer (to, 4, valto); + } + else + { + memcpy (to, from, REGISTER_RAW_SIZE (regi)); + } + } + } } -#endif /* defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T) */ +#endif /* defined (HAVE_FPREGSET_T) */ #endif /* HAVE_SYS_PROCFS_H */ diff --git a/gdb/i387-nat.c b/gdb/i387-nat.c new file mode 100644 index 00000000000..17e67b47a32 --- /dev/null +++ b/gdb/i387-nat.c @@ -0,0 +1,125 @@ +/* Native-dependent code for the i387. + Copyright (C) 2000 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 "inferior.h" +#include "value.h" + +/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets + define their own routines to manage the floating-point registers in + GDB's register array. Most (if not all) of these targets use the + format used by the "fsave" instruction in their communication with + the OS. They should all be converted to use the routines below. */ + +/* At fsave_offset[REGNO] you'll find the offset to the location in + the data structure used by the "fsave" instruction where GDB + register REGNO is stored. */ + +static int fsave_offset[] = +{ + 28 + 0 * FPU_REG_RAW_SIZE, /* FP0_REGNUM through ... */ + 28 + 1 * FPU_REG_RAW_SIZE, + 28 + 2 * FPU_REG_RAW_SIZE, + 28 + 3 * FPU_REG_RAW_SIZE, + 28 + 4 * FPU_REG_RAW_SIZE, + 28 + 5 * FPU_REG_RAW_SIZE, + 28 + 6 * FPU_REG_RAW_SIZE, + 28 + 7 * FPU_REG_RAW_SIZE, /* ... FP7_REGNUM. */ + 0, /* FCTRL_REGNUM (16 bits). */ + 4, /* FSTAT_REGNUM (16 bits). */ + 8, /* FTAG_REGNUM (16 bits). */ + 16, /* FCS_REGNUM (16 bits). */ + 12, /* FCOFF_REGNUM. */ + 24, /* FDS_REGNUM. */ + 20, /* FDOFF_REGNUM. */ + 18 /* FOP_REGNUM (bottom 11 bits). */ +}; + +#define FSAVE_ADDR(fsave, regnum) (fsave + fsave_offset[regnum - FP0_REGNUM]) + + +/* Fill GDB's register array with the floating-point register values + in *FSAVE. This function masks off any of the reserved + bits in *FSAVE. */ + +void +i387_supply_fsave (char *fsave) +{ + int i; + + for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++) + { + /* Most of the FPU control registers occupy only 16 bits in + the fsave area. Give those a special treatment. */ + if (i >= FIRST_FPU_CTRL_REGNUM + && i != FCOFF_REGNUM && i != FDOFF_REGNUM) + { + unsigned val = *(unsigned short *) (FSAVE_ADDR (fsave, i)); + + if (i == FOP_REGNUM) + { + val &= ((1 << 11) - 1); + supply_register (i, (char *) &val); + } + else + supply_register (i, (char *) &val); + } + else + supply_register (i, FSAVE_ADDR (fsave, i)); + } +} + +/* Fill register REGNO (if it is a floating-point register) in *FSAVE + with the value in GDB's register array. If REGNO is -1, do this + for all registers. This function doesn't touch any of the reserved + bits in *FSAVE. */ + +void +i387_fill_fsave (char *fsave, int regno) +{ + int i; + + for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++) + if (regno == -1 || regno == i) + { + /* Most of the FPU control registers occupy only 16 bits in + the fsave area. Give those a special treatment. */ + if (i >= FIRST_FPU_CTRL_REGNUM + && i != FCOFF_REGNUM && i != FDOFF_REGNUM) + { + if (i == FOP_REGNUM) + { + unsigned short oldval, newval; + + /* The opcode occupies only 11 bits. */ + oldval = (*(unsigned short *) (FSAVE_ADDR (fsave, i))); + newval = *(unsigned short *) ®isters[REGISTER_BYTE (i)]; + newval &= ((1 << 11) - 1); + newval |= oldval & ~((1 << 11) - 1); + memcpy (FSAVE_ADDR (fsave, i), &newval, 2); + } + else + memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)], 2); + } + else + memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)], + REGISTER_RAW_SIZE (i)); + } +} diff --git a/gdb/i387-nat.h b/gdb/i387-nat.h new file mode 100644 index 00000000000..c23c267d8f8 --- /dev/null +++ b/gdb/i387-nat.h @@ -0,0 +1,37 @@ +/* Native-dependent code for the i387. + Copyright (C) 2000 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 I387_NAT_H +#define I387_NAT_H + +/* Fill GDB's register array with the floating-point register values + in *FSAVE. This function masks off any of the reserved + bits in *FSAVE. */ + +void i387_supply_fsave (char *fsave); + +/* Fill register REGNO (if it is a floating-point register) in *FSAVE + with the value in GDB's register array. If REGNO is -1, do this + for all registers. This function doesn't touch any of the reserved + bits in *FSAVE. */ + +void i387_fill_fsave (char *fsave, int regno); + +#endif /* i387-nat.h */ diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 20e446d2ff4..4f180fa8fa7 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -30,8 +30,8 @@ /* FIXME: Eliminate the next two functions when we have the time to change all the callers. */ -void i387_to_double PARAMS ((char *from, char *to)); -void double_to_i387 PARAMS ((char *from, char *to)); +void i387_to_double (char *from, char *to); +void double_to_i387 (char *from, char *to); void i387_to_double (from, to) @@ -56,8 +56,8 @@ double_to_i387 (from, to) use the generic implementation based on the new register file layout. */ -static void print_387_control_bits PARAMS ((unsigned int control)); -static void print_387_status_bits PARAMS ((unsigned int status)); +static void print_387_control_bits (unsigned int control); +static void print_387_status_bits (unsigned int status); static void print_387_control_bits (control) @@ -166,8 +166,22 @@ static void print_i387_value (char *raw) { DOUBLEST value; - - floatformat_to_doublest (&floatformat_i387_ext, raw, &value); + + /* Avoid call to floatformat_to_doublest if possible to preserve as + much information as possible. */ + +#ifdef HAVE_LONG_DOUBLE + if (sizeof (value) == sizeof (long double) + && HOST_LONG_DOUBLE_FORMAT == &floatformat_i387_ext) + { + /* Copy straight over, but take care of the padding. */ + memcpy (&value, raw, FPU_REG_RAW_SIZE); + memset ((char *) &value + FPU_REG_RAW_SIZE, 0, + sizeof (value) - FPU_REG_RAW_SIZE); + } + else +#endif + floatformat_to_doublest (&floatformat_i387_ext, raw, &value); /* We try to print 19 digits. The last digit may or may not contain garbage, but we'd better print one too many. We need enough room diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c index eff41361a5f..f7aab5fb8c4 100644 --- a/gdb/i960-tdep.c +++ b/gdb/i960-tdep.c @@ -29,9 +29,8 @@ #include "gdbcore.h" #include "inferior.h" -static CORE_ADDR next_insn PARAMS ((CORE_ADDR memaddr, - unsigned int *pword1, - unsigned int *pword2)); +static CORE_ADDR next_insn (CORE_ADDR memaddr, + unsigned int *pword1, unsigned int *pword2); /* Does the specified function use the "struct returning" convention or the "value returning" convention? The "value returning" convention diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 485fa4a0d72..339c58ba760 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -34,6 +34,9 @@ #include #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* These must match the order of the register names. Some sort of lookup table is needed because the offsets associated @@ -473,3 +476,174 @@ fill_fpregset (fpregsetp, regno) } } } + +#define IA64_PSR_DB (1UL << 24) +#define IA64_PSR_DD (1UL << 39) + +static void +enable_watchpoints_in_psr (int pid) +{ + CORE_ADDR psr; + + psr = read_register_pid (IA64_PSR_REGNUM, pid); + if (!(psr & IA64_PSR_DB)) + { + psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware + watchpoints and breakpoints. */ + write_register_pid (IA64_PSR_REGNUM, psr, pid); + } +} + +static long +fetch_debug_register (int pid, int idx) +{ + long val; + int tid; + + tid = TIDGET(pid); + if (tid == 0) + tid = pid; + + val = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) (PT_DBR + 8 * idx), 0); + + return val; +} + +static void +store_debug_register (int pid, int idx, long val) +{ + int tid; + + tid = TIDGET(pid); + if (tid == 0) + tid = pid; + + (void) ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) (PT_DBR + 8 * idx), val); +} + +static void +fetch_debug_register_pair (int pid, int idx, long *dbr_addr, long *dbr_mask) +{ + if (dbr_addr) + *dbr_addr = fetch_debug_register (pid, 2 * idx); + if (dbr_mask) + *dbr_mask = fetch_debug_register (pid, 2 * idx + 1); +} + +static void +store_debug_register_pair (int pid, int idx, long *dbr_addr, long *dbr_mask) +{ + if (dbr_addr) + store_debug_register (pid, 2 * idx, *dbr_addr); + if (dbr_mask) + store_debug_register (pid, 2 * idx + 1, *dbr_mask); +} + +static int +is_power_of_2 (int val) +{ + int i, onecount; + + onecount = 0; + for (i = 0; i < 8 * sizeof (val); i++) + if (val & (1 << i)) + onecount++; + + return onecount <= 1; +} + +int +ia64_linux_insert_watchpoint (int pid, CORE_ADDR addr, int len, int rw) +{ + int idx; + long dbr_addr, dbr_mask; + int max_watchpoints = 4; + + if (len <= 0 || !is_power_of_2 (len)) + return -1; + + for (idx = 0; idx < max_watchpoints; idx++) + { + fetch_debug_register_pair (pid, idx, NULL, &dbr_mask); + if ((dbr_mask & (0x3UL << 62)) == 0) + { + /* Exit loop if both r and w bits clear */ + break; + } + } + + if (idx == max_watchpoints) + return -1; + + dbr_addr = (long) addr; + dbr_mask = (~(len - 1) & 0x00ffffffffffffffL); /* construct mask to match */ + dbr_mask |= 0x0800000000000000L; /* Only match privilege level 3 */ + switch (rw) + { + case hw_write: + dbr_mask |= (1L << 62); /* Set w bit */ + break; + case hw_read: + dbr_mask |= (1L << 63); /* Set r bit */ + break; + case hw_access: + dbr_mask |= (3L << 62); /* Set both r and w bits */ + break; + default: + return -1; + } + + store_debug_register_pair (pid, idx, &dbr_addr, &dbr_mask); + enable_watchpoints_in_psr (pid); + + return 0; +} + +int +ia64_linux_remove_watchpoint (int pid, CORE_ADDR addr, int len) +{ + int idx; + long dbr_addr, dbr_mask; + int max_watchpoints = 4; + + if (len <= 0 || !is_power_of_2 (len)) + return -1; + + for (idx = 0; idx < max_watchpoints; idx++) + { + fetch_debug_register_pair (pid, idx, &dbr_addr, &dbr_mask); + if ((dbr_mask & (0x3UL << 62)) && addr == (CORE_ADDR) dbr_addr) + { + dbr_addr = 0; + dbr_mask = 0; + store_debug_register_pair (pid, idx, &dbr_addr, &dbr_mask); + return 0; + } + } + return -1; +} + +CORE_ADDR +ia64_linux_stopped_by_watchpoint (int pid) +{ + CORE_ADDR psr; + int tid; + struct siginfo siginfo; + + tid = TIDGET(pid); + if (tid == 0) + tid = pid; + + errno = 0; + ptrace (PTRACE_GETSIGINFO, tid, (PTRACE_ARG3_TYPE) 0, &siginfo); + + if (errno != 0 || siginfo.si_code != 4 /* TRAP_HWBKPT */) + return 0; + + psr = read_register_pid (IA64_PSR_REGNUM, pid); + psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint + for the next instruction */ + write_register_pid (IA64_PSR_REGNUM, psr, pid); + + return (CORE_ADDR) siginfo.si_addr; +} diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c new file mode 100644 index 00000000000..87c6af4b440 --- /dev/null +++ b/gdb/ia64-linux-tdep.c @@ -0,0 +1,87 @@ +/* Target-dependent code for the IA-64 for GDB, the GNU debugger. + Copyright 2000 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "arch-utils.h" + +/* The sigtramp code is in a non-readable (executable-only) region + of memory called the ``gate page''. The addresses in question + were determined by examining the system headers. They are + overly generous to allow for different pages sizes. */ + +#define GATE_AREA_START 0xa000000000000100LL +#define GATE_AREA_END 0xa000000000010000LL + +/* Offset to sigcontext structure from frame of handler */ +#define IA64_LINUX_SIGCONTEXT_OFFSET 160 + +int +ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name) +{ + return (pc >= (CORE_ADDR) GATE_AREA_START && pc < (CORE_ADDR) GATE_AREA_END); +} + +/* IA-64 GNU/Linux specific function which, given a frame address and + a register number, returns the address at which that register may be + found. 0 is returned for registers which aren't stored in the the + sigcontext structure. */ + +CORE_ADDR +ia64_linux_sigcontext_register_address (CORE_ADDR sp, int regno) +{ + if (IA64_GR0_REGNUM <= regno && regno <= IA64_GR31_REGNUM) + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 200 + 8 * (regno - IA64_GR0_REGNUM); + else if (IA64_BR0_REGNUM <= regno && regno <= IA64_BR7_REGNUM) + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 136 + 8 * (regno - IA64_BR0_REGNUM); + else if (IA64_FR0_REGNUM <= regno && regno <= IA64_FR127_REGNUM) + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 464 + 16 * (regno - IA64_FR0_REGNUM); + else + switch (regno) + { + case IA64_IP_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 40; + case IA64_CFM_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 48; + case IA64_PSR_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 56; /* user mask only */ + /* sc_ar_rsc is provided, from which we could compute bspstore, but + I don't think it's worth it. Anyway, if we want it, it's at offset + 64 */ + case IA64_BSP_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 72; + case IA64_RNAT_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 80; + case IA64_CCV_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 88; + case IA64_UNAT_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 96; + case IA64_FPSR_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 104; + case IA64_PFS_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 112; + case IA64_LC_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 120; + case IA64_PR_REGNUM : + return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 128; + default : + return 0; + } +} diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index ae35b73a59b..e220e27b503 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -23,10 +23,12 @@ #include "inferior.h" #include "symfile.h" /* for entry_point_address */ #include "gdbcore.h" +#include "arch-utils.h" #include "floatformat.h" #include "objfiles.h" #include "elf/common.h" /* for DT_PLTGOT value */ +#include "elf-bfd.h" typedef enum instruction_type { @@ -63,6 +65,8 @@ typedef enum instruction_type extern void _initialize_ia64_tdep (void); +extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int); + static gdbarch_init_ftype ia64_gdbarch_init; static gdbarch_register_name_ftype ia64_register_name; @@ -188,23 +192,36 @@ static char *ia64_register_names[] = }; struct frame_extra_info -{ - CORE_ADDR bsp; /* points at r32 for the current frame */ - CORE_ADDR cfm; /* cfm value for current frame */ - int sof; /* Size of frame (decoded from cfm value) */ - int sol; /* Size of locals (decoded from cfm value) */ - CORE_ADDR after_prologue; - /* Address of first instruction after the last + { + CORE_ADDR bsp; /* points at r32 for the current frame */ + CORE_ADDR cfm; /* cfm value for current frame */ + int sof; /* Size of frame (decoded from cfm value) */ + int sol; /* Size of locals (decoded from cfm value) */ + CORE_ADDR after_prologue; + /* Address of first instruction after the last prologue instruction; Note that there may be instructions from the function's body intermingled with the prologue. */ - int mem_stack_frame_size; - /* Size of the memory stack frame (may be zero), + int mem_stack_frame_size; + /* Size of the memory stack frame (may be zero), or -1 if it has not been determined yet. */ - int fp_reg; /* Register number (if any) used a frame pointer - for this frame. 0 if no register is being used + int fp_reg; /* Register number (if any) used a frame pointer + for this frame. 0 if no register is being used as the frame pointer. */ -}; + }; + +struct gdbarch_tdep + { + int os_ident; /* From the ELF header, one of the ELFOSABI_ + constants: ELFOSABI_LINUX, ELFOSABI_MONTEREY, + etc. */ + CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int); + /* OS specific function which, given a frame address + and register number, returns the offset to the + given register from the start of the frame. */ + }; + +#define SIGCONTEXT_REGISTER_ADDRESS (gdbarch_tdep (current_gdbarch)->sigcontext_register_address) static char * ia64_register_name (int reg) @@ -281,10 +298,35 @@ ia64_register_byte (int reg) (reg <= IA64_FR0_REGNUM ? 0 : 8 * ((reg > IA64_FR127_REGNUM) ? 128 : reg - IA64_FR0_REGNUM)); } +/* Read the given register from a sigcontext structure in the + specified frame. */ + +static CORE_ADDR +read_sigcontext_register (struct frame_info *frame, int regnum) +{ + CORE_ADDR regaddr; + + if (frame == NULL) + internal_error ("read_sigcontext_register: NULL frame"); + if (!frame->signal_handler_caller) + internal_error ( + "read_sigcontext_register: frame not a signal_handler_caller"); + if (SIGCONTEXT_REGISTER_ADDRESS == 0) + internal_error ( + "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); + + regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum); + if (regaddr) + return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum)); + else + internal_error ( + "read_sigcontext_register: Register %d not in struct sigcontext", regnum); +} + /* Extract ``len'' bits from an instruction bundle starting at bit ``from''. */ -long long +static long long extract_bit_field (char *bundle, int from, int len) { long long result = 0LL; @@ -320,7 +362,7 @@ extract_bit_field (char *bundle, int from, int len) /* Replace the specified bits in an instruction bundle */ -void +static void replace_bit_field (char *bundle, long long val, int from, int len) { int to = from + len; @@ -370,7 +412,7 @@ replace_bit_field (char *bundle, long long val, int from, int len) /* Return the contents of slot N (for N = 0, 1, or 2) in and instruction bundle */ -long long +static long long slotN_contents (unsigned char *bundle, int slotnum) { return extract_bit_field (bundle, 5+41*slotnum, 41); @@ -378,7 +420,7 @@ slotN_contents (unsigned char *bundle, int slotnum) /* Store an instruction in an instruction bundle */ -void +static void replace_slotN_contents (unsigned char *bundle, long long instr, int slotnum) { replace_bit_field (bundle, instr, 5+41*slotnum, 41); @@ -607,23 +649,38 @@ rse_address_add(CORE_ADDR addr, int nslots) CORE_ADDR ia64_frame_chain (struct frame_info *frame) { - FRAME_INIT_SAVED_REGS (frame); - - if (frame->saved_regs[IA64_VFP_REGNUM]) - return read_memory_integer (frame->saved_regs[IA64_VFP_REGNUM], 8); + if (frame->signal_handler_caller) + return read_sigcontext_register (frame, sp_regnum); + else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + return frame->frame; else - return frame->frame + frame->extra_info->mem_stack_frame_size; + { + FRAME_INIT_SAVED_REGS (frame); + if (frame->saved_regs[IA64_VFP_REGNUM]) + return read_memory_integer (frame->saved_regs[IA64_VFP_REGNUM], 8); + else + return frame->frame + frame->extra_info->mem_stack_frame_size; + } } CORE_ADDR ia64_frame_saved_pc (struct frame_info *frame) { - FRAME_INIT_SAVED_REGS (frame); + if (frame->signal_handler_caller) + return read_sigcontext_register (frame, pc_regnum); + else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + return generic_read_register_dummy (frame->pc, frame->frame, pc_regnum); + else + { + FRAME_INIT_SAVED_REGS (frame); - if (frame->saved_regs[IA64_VRAP_REGNUM]) - return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8); - else /* either frameless, or not far enough along in the prologue... */ - return ia64_saved_pc_after_call (frame); + if (frame->saved_regs[IA64_VRAP_REGNUM]) + return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8); + else if (frame->next && frame->next->signal_handler_caller) + return read_sigcontext_register (frame->next, IA64_BR0_REGNUM); + else /* either frameless, or not far enough along in the prologue... */ + return ia64_saved_pc_after_call (frame); + } } #define isScratch(_regnum_) ((_regnum_) == 2 || (_regnum_) == 3 \ @@ -651,6 +708,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) int mem_stack_frame_size = 0; int spill_reg = 0; CORE_ADDR spill_addr = 0; + char instores[8]; + char infpstores[8]; + + memset (instores, 0, sizeof instores); + memset (infpstores, 0, sizeof infpstores); if (frame && !frame->saved_regs) { @@ -693,7 +755,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) if (next_pc == 0) break; - if (it == I && ((instr & 0x1eff8000000LL) == 0x00188000000LL)) + if (it == B || ((instr & 0x3fLL) != 0LL)) + { + /* Exit loop upon hitting a branch instruction or a predicated + instruction. */ + break; + } + else if (it == I && ((instr & 0x1eff8000000LL) == 0x00188000000LL)) { /* Move from BR */ int b2 = (int) ((instr & 0x0000000e000LL) >> 13); @@ -843,6 +911,48 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) spill_addr = 0; /* must be done spilling */ last_prologue_pc = next_pc; } + else if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32]) + { + /* Allow up to one store of each input register. */ + instores[rM-32] = 1; + last_prologue_pc = next_pc; + } + } + else if (it == M && ((instr & 0x1ff08000000LL) == 0x08c00000000LL)) + { + /* One of + st1 [rN] = rM + st2 [rN] = rM + st4 [rN] = rM + st8 [rN] = rM + Note that the st8 case is handled in the clause above. + + Advance over stores of input registers. One store per input + register is permitted. */ + int rM = (int) ((instr & 0x000000fe000LL) >> 13); + int qp = (int) (instr & 0x0000000003fLL); + if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32]) + { + instores[rM-32] = 1; + last_prologue_pc = next_pc; + } + } + else if (it == M && ((instr & 0x1ff88000000LL) == 0x0cc80000000LL)) + { + /* Either + stfs [rN] = fM + or + stfd [rN] = fM + + Advance over stores of floating point input registers. Again + one store per register is permitted */ + int fM = (int) ((instr & 0x000000fe000LL) >> 13); + int qp = (int) (instr & 0x0000000003fLL); + if (qp == 0 && 8 <= fM && fM < 16 && !infpstores[fM - 8]) + { + infpstores[fM-8] = 1; + last_prologue_pc = next_pc; + } } else if (it == M && ( ((instr & 0x1ffc8000000LL) == 0x08ec0000000LL) @@ -869,8 +979,6 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) last_prologue_pc = next_pc; } } - else if (it == B || ((instr & 0x3fLL) != 0LL)) - break; pc = next_pc; } @@ -916,50 +1024,55 @@ ia64_skip_prologue (CORE_ADDR pc) void ia64_frame_init_saved_regs (struct frame_info *frame) { - CORE_ADDR func_start; - if (frame->saved_regs) return; - func_start = get_pc_function_start (frame->pc); - examine_prologue (func_start, frame->pc, frame); -} + if (frame->signal_handler_caller && SIGCONTEXT_REGISTER_ADDRESS) + { + int regno; -static CORE_ADDR -ia64_find_saved_register (frame, regnum) - struct frame_info *frame; - int regnum; -{ - register CORE_ADDR addr = 0; + frame_saved_regs_zalloc (frame); - if ((IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM) - || regnum == IA64_VFP_REGNUM - || regnum == IA64_VRAP_REGNUM) - { - FRAME_INIT_SAVED_REGS (frame); - return frame->saved_regs[regnum]; - } - else if (regnum == IA64_IP_REGNUM && frame->next) - { - FRAME_INIT_SAVED_REGS (frame->next); - return frame->next->saved_regs[IA64_VRAP_REGNUM]; + frame->saved_regs[IA64_VRAP_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_IP_REGNUM); + frame->saved_regs[IA64_CFM_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CFM_REGNUM); + frame->saved_regs[IA64_PSR_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PSR_REGNUM); +#if 0 + frame->saved_regs[IA64_BSP_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM); +#endif + frame->saved_regs[IA64_RNAT_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_RNAT_REGNUM); + frame->saved_regs[IA64_CCV_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CCV_REGNUM); + frame->saved_regs[IA64_UNAT_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_UNAT_REGNUM); + frame->saved_regs[IA64_FPSR_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_FPSR_REGNUM); + frame->saved_regs[IA64_PFS_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PFS_REGNUM); + frame->saved_regs[IA64_LC_REGNUM] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_LC_REGNUM); + for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++) + if (regno != sp_regnum) + frame->saved_regs[regno] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno); + for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++) + frame->saved_regs[regno] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno); + for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++) + frame->saved_regs[regno] = + SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno); } else { - struct frame_info *frame1 = NULL; - while (1) - { - QUIT; - frame1 = get_prev_frame (frame1); - if (frame1 == 0 || frame1 == frame) - break; - FRAME_INIT_SAVED_REGS (frame1); - if (frame1->saved_regs[regnum]) - addr = frame1->saved_regs[regnum]; - } - } + CORE_ADDR func_start; - return addr; + func_start = get_pc_function_start (frame->pc); + examine_prologue (func_start, frame->pc, frame); + } } void @@ -970,76 +1083,29 @@ ia64_get_saved_register (char *raw_buffer, int regnum, enum lval_type *lval) { - CORE_ADDR addr; + int is_dummy_frame; if (!target_has_registers) error ("No registers."); if (optimized != NULL) *optimized = 0; - addr = ia64_find_saved_register (frame, regnum); - if (addr != 0) - { - if (lval != NULL) - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer != NULL) - { - /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), (LONGEST) addr); - } - if (addrp != NULL) - *addrp = 0; - return; - } - if (raw_buffer != NULL) - read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); - } - else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM) - { - /* r32 - r127 must be fetchable via memory. If they aren't, - then the register is unavailable */ - addr = 0; - if (lval != NULL) - *lval = not_lval; - memset (raw_buffer, 0, REGISTER_RAW_SIZE (regnum)); - } - else if (regnum == IA64_IP_REGNUM) - { - CORE_ADDR pc; - if (frame->next) - { - /* This case will normally be handled above, except when it's - frameless or we haven't advanced far enough into the prologue - of the top frame to save the register. */ - addr = REGISTER_BYTE (regnum); - if (lval != NULL) - *lval = lval_register; - pc = ia64_saved_pc_after_call (frame); - } - else - { - addr = 0; - if (lval != NULL) - *lval = not_lval; - pc = read_pc (); - } - store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); - } - else if (regnum == SP_REGNUM && frame->next) + + if (addrp != NULL) + *addrp = 0; + + if (lval != NULL) + *lval = not_lval; + + is_dummy_frame = PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame); + + if (regnum == SP_REGNUM && frame->next) { /* Handle SP values for all frames but the topmost. */ - addr = 0; - if (lval != NULL) - *lval = not_lval; store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame); } else if (regnum == IA64_BSP_REGNUM) { - addr = 0; - if (lval != NULL) - *lval = not_lval; store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->extra_info->bsp); } @@ -1050,9 +1116,6 @@ ia64_get_saved_register (char *raw_buffer, above. If the function lacks one of these frame pointers, we can still provide a value since we know the size of the frame */ CORE_ADDR vfp = frame->frame + frame->extra_info->mem_stack_frame_size; - addr = 0; - if (lval != NULL) - *lval = not_lval; store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); } else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM) @@ -1067,9 +1130,6 @@ ia64_get_saved_register (char *raw_buffer, prN_val = extract_bit_field ((unsigned char *) pr_raw_buffer, regnum - IA64_PR0_REGNUM, 1); store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), prN_val); - addr = 0; - if (lval != NULL) - *lval = not_lval; } else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM) { @@ -1084,18 +1144,20 @@ ia64_get_saved_register (char *raw_buffer, regnum - IA64_NAT0_REGNUM, 1); store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), unatN_val); - addr = 0; - if (lval != NULL) - *lval = not_lval; } else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM) { int natval = 0; /* Find address of general register corresponding to nat bit we're interested in. */ - CORE_ADDR gr_addr = - ia64_find_saved_register (frame, - regnum - IA64_NAT0_REGNUM + IA64_GR0_REGNUM); + CORE_ADDR gr_addr = 0; + + if (!is_dummy_frame) + { + FRAME_INIT_SAVED_REGS (frame); + gr_addr = frame->saved_regs[ regnum - IA64_NAT0_REGNUM + + IA64_GR0_REGNUM]; + } if (gr_addr) { /* Compute address of nat collection bits */ @@ -1114,20 +1176,50 @@ ia64_get_saved_register (char *raw_buffer, natval = (nat_collection >> nat_bit) & 1; } store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), natval); - addr = 0; - if (lval != NULL) - *lval = not_lval; + } + else if (regnum == IA64_IP_REGNUM) + { + CORE_ADDR pc; + if (frame->next) + { + /* FIXME: Set *addrp, *lval when possible. */ + pc = ia64_frame_saved_pc (frame->next); + } + else + { + pc = read_pc (); + } + store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); + } + else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM) + { + CORE_ADDR addr = 0; + if (!is_dummy_frame) + { + FRAME_INIT_SAVED_REGS (frame); + addr = frame->saved_regs[regnum]; + } + + if (addr != 0) + { + if (lval != NULL) + *lval = lval_memory; + if (addrp != NULL) + *addrp = addr; + read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); + } + else + { + /* r32 - r127 must be fetchable via memory. If they aren't, + then the register is unavailable */ + memset (raw_buffer, 0, REGISTER_RAW_SIZE (regnum)); + } } else { - if (lval != NULL) - *lval = lval_register; - addr = REGISTER_BYTE (regnum); - if (raw_buffer != NULL) - read_register_gen (regnum, raw_buffer); + generic_get_saved_register (raw_buffer, optimized, addrp, frame, + regnum, lval); } - if (addrp != NULL) - *addrp = addr; } /* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of @@ -1230,6 +1322,9 @@ void ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) { CORE_ADDR bsp, cfm; + int next_frame_is_call_dummy = ((frame->next != NULL) + && PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame, + frame->next->frame)); frame->extra_info = (struct frame_extra_info *) frame_obstack_alloc (sizeof (struct frame_extra_info)); @@ -1240,6 +1335,18 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) cfm = read_register (IA64_CFM_REGNUM); } + else if (frame->next->signal_handler_caller) + { + bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM); + cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM); + } + else if (next_frame_is_call_dummy) + { + bsp = generic_read_register_dummy (frame->next->pc, frame->next->frame, + IA64_BSP_REGNUM); + cfm = generic_read_register_dummy (frame->next->pc, frame->next->frame, + IA64_CFM_REGNUM); + } else { struct frame_info *frn = frame->next; @@ -1248,6 +1355,13 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) if (frn->saved_regs[IA64_CFM_REGNUM] != 0) cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8); + else if (frn->next && frn->next->signal_handler_caller) + cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM); + else if (frn->next + && PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame, + frn->next->frame)) + cfm = generic_read_register_dummy (frn->next->pc, frn->next->frame, + IA64_PFS_REGNUM); else cfm = read_register (IA64_PFS_REGNUM); @@ -1256,7 +1370,9 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) frame->extra_info->cfm = cfm; frame->extra_info->sof = cfm & 0x7f; frame->extra_info->sol = (cfm >> 7) & 0x7f; - if (frame->next == 0) + if (frame->next == 0 + || frame->next->signal_handler_caller + || next_frame_is_call_dummy) frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof); else frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sol); @@ -1719,16 +1835,98 @@ ia64_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes, *targ_len = nr_bytes; } +static void +process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj) +{ + int *os_ident_ptr = obj; + const char *name; + unsigned int sectsize; + + name = bfd_get_section_name (abfd, sect); + sectsize = bfd_section_size (abfd, sect); + if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0) + { + unsigned int name_length, data_length, note_type; + char *note = alloca (sectsize); + + bfd_get_section_contents (abfd, sect, note, + (file_ptr) 0, (bfd_size_type) sectsize); + + name_length = bfd_h_get_32 (abfd, note); + data_length = bfd_h_get_32 (abfd, note + 4); + note_type = bfd_h_get_32 (abfd, note + 8); + + if (name_length == 4 && data_length == 16 && note_type == 1 + && strcmp (note + 12, "GNU") == 0) + { + int os_number = bfd_h_get_32 (abfd, note + 16); + + /* The case numbers are from abi-tags in glibc */ + switch (os_number) + { + case 0 : + *os_ident_ptr = ELFOSABI_LINUX; + break; +#if 0 /* FIXME: Enable after internal repository is synced with sourceware */ + case 1 : + *os_ident_ptr = ELFOSABI_HURD; + break; + case 2 : + *os_ident_ptr = ELFOSABI_SOLARIS; + break; +#endif + default : + internal_error ( + "process_note_abi_sections: unknown OS number %d", os_number); + break; + } + } + } +} + static struct gdbarch * ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; + struct gdbarch_tdep *tdep; + int os_ident; - arches = gdbarch_list_lookup_by_info (arches, &info); - if (arches != NULL) - return arches->gdbarch; + if (info.abfd != NULL + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) + { + os_ident = elf_elfheader (info.abfd)->e_ident[EI_OSABI]; - gdbarch = gdbarch_alloc (&info, NULL); + /* If os_ident is 0, it is not necessarily the case that we're on a + SYSV system. (ELFOSABI_NONE is defined to be 0.) GNU/Linux uses + a note section to record OS/ABI info, but leaves e_ident[EI_OSABI] + zero. So we have to check for note sections too. */ + if (os_ident == 0) + { + bfd_map_over_sections (info.abfd, + process_note_abi_tag_sections, + &os_ident); + } + } + else + os_ident = -1; + + for (arches = gdbarch_list_lookup_by_info (arches, &info); + arches != NULL; + arches = gdbarch_list_lookup_by_info (arches->next, &info)) + { + if (gdbarch_tdep (current_gdbarch)->os_ident != os_ident) + continue; + return arches->gdbarch; + } + + tdep = xmalloc (sizeof (struct gdbarch_tdep)); + gdbarch = gdbarch_alloc (&info, tdep); + tdep->os_ident = os_ident; + + if (os_ident == ELFOSABI_LINUX) + tdep->sigcontext_register_address = ia64_linux_sigcontext_register_address; + else + tdep->sigcontext_register_address = 0; set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); @@ -1762,7 +1960,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call); set_gdbarch_frame_chain (gdbarch, ia64_frame_chain); - set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); + set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, ia64_frame_saved_pc); set_gdbarch_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 06439d0248d..f00b0e38790 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -42,79 +42,79 @@ /* Functions exported for general use: */ -void nofp_registers_info PARAMS ((char *, int)); +void nofp_registers_info (char *, int); -void all_registers_info PARAMS ((char *, int)); +void all_registers_info (char *, int); -void registers_info PARAMS ((char *, int)); +void registers_info (char *, int); /* Local functions: */ -void continue_command PARAMS ((char *, int)); +void continue_command (char *, int); static void print_return_value (int struct_return, struct type *value_type); -static void finish_command_continuation PARAMS ((struct continuation_arg *)); +static void finish_command_continuation (struct continuation_arg *); -static void until_next_command PARAMS ((int)); +static void until_next_command (int); -static void until_command PARAMS ((char *, int)); +static void until_command (char *, int); -static void path_info PARAMS ((char *, int)); +static void path_info (char *, int); -static void path_command PARAMS ((char *, int)); +static void path_command (char *, int); -static void unset_command PARAMS ((char *, int)); +static void unset_command (char *, int); -static void float_info PARAMS ((char *, int)); +static void float_info (char *, int); -static void detach_command PARAMS ((char *, int)); +static void detach_command (char *, int); static void interrupt_target_command (char *args, int from_tty); #if !defined (DO_REGISTERS_INFO) -static void do_registers_info PARAMS ((int, int)); +static void do_registers_info (int, int); #endif -static void unset_environment_command PARAMS ((char *, int)); +static void unset_environment_command (char *, int); -static void set_environment_command PARAMS ((char *, int)); +static void set_environment_command (char *, int); -static void environment_info PARAMS ((char *, int)); +static void environment_info (char *, int); -static void program_info PARAMS ((char *, int)); +static void program_info (char *, int); -static void finish_command PARAMS ((char *, int)); +static void finish_command (char *, int); -static void signal_command PARAMS ((char *, int)); +static void signal_command (char *, int); -static void jump_command PARAMS ((char *, int)); +static void jump_command (char *, int); -static void step_1 PARAMS ((int, int, char *)); +static void step_1 (int, int, char *); static void step_once (int skip_subroutines, int single_inst, int count); static void step_1_continuation (struct continuation_arg *arg); -void nexti_command PARAMS ((char *, int)); +void nexti_command (char *, int); -void stepi_command PARAMS ((char *, int)); +void stepi_command (char *, int); -static void next_command PARAMS ((char *, int)); +static void next_command (char *, int); -static void step_command PARAMS ((char *, int)); +static void step_command (char *, int); -static void run_command PARAMS ((char *, int)); +static void run_command (char *, int); -static void run_no_args_command PARAMS ((char *args, int from_tty)); +static void run_no_args_command (char *args, int from_tty); -static void go_command PARAMS ((char *line_no, int from_tty)); +static void go_command (char *line_no, int from_tty); -static int strip_bg_char PARAMS ((char **)); +static int strip_bg_char (char **); -void _initialize_infcmd PARAMS ((void)); +void _initialize_infcmd (void); #define GO_USAGE "Usage: go \n" -static void breakpoint_auto_delete_contents PARAMS ((PTR)); +static void breakpoint_auto_delete_contents (PTR); #define ERROR_NO_INFERIOR \ if (!target_has_execution) error ("The program is not being run."); @@ -454,6 +454,12 @@ nexti_command (count_string, from_tty) step_1 (1, 1, count_string); } +static void +disable_longjmp_breakpoint_cleanup (void *ignore) +{ + disable_longjmp_breakpoint (); +} + static void step_1 (skip_subroutines, single_inst, count_string) int skip_subroutines; @@ -489,10 +495,9 @@ step_1 (skip_subroutines, single_inst, count_string) { enable_longjmp_breakpoint (); if (!event_loop_p || !target_can_async_p ()) - cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint, - 0); + cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); else - make_exec_cleanup ((make_cleanup_func) disable_longjmp_breakpoint, 0); + make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); } /* In synchronous case, all is well, just use the regular for loop. */ @@ -1194,9 +1199,9 @@ finish_command (arg, from_tty) breakpoint = set_momentary_breakpoint (sal, frame, bp_finish); if (!event_loop_p || !target_can_async_p ()) - old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + old_chain = make_cleanup_delete_breakpoint (breakpoint); else - old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint); + old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); /* Find the function we will return from. */ @@ -1998,6 +2003,7 @@ use \"set args\" without arguments."); add_info ("registers", nofp_registers_info, "List of integer registers and their contents, for selected stack frame.\n\ Register name as argument means describe only that register."); + add_info_alias ("r", "registers", 1); if (xdb_commands) add_com ("lr", class_info, nofp_registers_info, diff --git a/gdb/inferior.h b/gdb/inferior.h index 5965f045ee8..26798a50d74 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -38,13 +38,17 @@ struct inferior_status; -extern struct inferior_status *save_inferior_status PARAMS ((int)); +extern struct inferior_status *save_inferior_status (int); -extern void restore_inferior_status PARAMS ((struct inferior_status *)); +extern void restore_inferior_status (struct inferior_status *); -extern void discard_inferior_status PARAMS ((struct inferior_status *)); +extern struct cleanup *make_cleanup_restore_inferior_status (struct inferior_status *); -extern void write_inferior_status_register PARAMS ((struct inferior_status * inf_status, int regno, LONGEST val)); +extern void discard_inferior_status (struct inferior_status *); + +extern void write_inferior_status_register (struct inferior_status + *inf_status, int regno, + LONGEST val); /* This macro gives the number of registers actually in use by the inferior. This may be less than the total number of registers, @@ -54,13 +58,13 @@ extern void write_inferior_status_register PARAMS ((struct inferior_status * inf #define ARCH_NUM_REGS NUM_REGS #endif -extern void set_sigint_trap PARAMS ((void)); +extern void set_sigint_trap (void); -extern void clear_sigint_trap PARAMS ((void)); +extern void clear_sigint_trap (void); -extern void set_sigio_trap PARAMS ((void)); +extern void set_sigio_trap (void); -extern void clear_sigio_trap PARAMS ((void)); +extern void clear_sigio_trap (void); /* File name for default use for standard in/out in the inferior. */ @@ -116,84 +120,92 @@ extern char *registers; extern signed char *register_valid; -extern void clear_proceed_status PARAMS ((void)); +extern void clear_proceed_status (void); + +extern void proceed (CORE_ADDR, enum target_signal, int); -extern void proceed PARAMS ((CORE_ADDR, enum target_signal, int)); +extern void kill_inferior (void); -extern void kill_inferior PARAMS ((void)); +extern void generic_mourn_inferior (void); -extern void generic_mourn_inferior PARAMS ((void)); +extern void terminal_ours (void); -extern void terminal_ours PARAMS ((void)); +extern int run_stack_dummy (CORE_ADDR, char *); -extern int run_stack_dummy PARAMS ((CORE_ADDR, char *)); +extern CORE_ADDR read_pc (void); -extern CORE_ADDR read_pc PARAMS ((void)); +extern CORE_ADDR read_pc_pid (int); -extern CORE_ADDR read_pc_pid PARAMS ((int)); +extern CORE_ADDR generic_target_read_pc (int); -extern CORE_ADDR generic_target_read_pc PARAMS ((int)); +extern void write_pc (CORE_ADDR); -extern void write_pc PARAMS ((CORE_ADDR)); +extern void write_pc_pid (CORE_ADDR, int); -extern void write_pc_pid PARAMS ((CORE_ADDR, int)); +extern void generic_target_write_pc (CORE_ADDR, int); -extern void generic_target_write_pc PARAMS ((CORE_ADDR, int)); +extern CORE_ADDR read_sp (void); -extern CORE_ADDR read_sp PARAMS ((void)); +extern CORE_ADDR generic_target_read_sp (void); -extern CORE_ADDR generic_target_read_sp PARAMS ((void)); +extern void write_sp (CORE_ADDR); -extern void write_sp PARAMS ((CORE_ADDR)); +extern void generic_target_write_sp (CORE_ADDR); -extern void generic_target_write_sp PARAMS ((CORE_ADDR)); +extern CORE_ADDR read_fp (void); -extern CORE_ADDR read_fp PARAMS ((void)); +extern CORE_ADDR generic_target_read_fp (void); -extern CORE_ADDR generic_target_read_fp PARAMS ((void)); +extern void write_fp (CORE_ADDR); -extern void write_fp PARAMS ((CORE_ADDR)); +extern void generic_target_write_fp (CORE_ADDR); -extern void generic_target_write_fp PARAMS ((CORE_ADDR)); +extern CORE_ADDR unsigned_pointer_to_address (struct type *type, void *buf); -extern void wait_for_inferior PARAMS ((void)); +extern void unsigned_address_to_pointer (struct type *type, void *buf, + CORE_ADDR addr); +extern CORE_ADDR signed_pointer_to_address (struct type *type, void *buf); +extern void address_to_signed_pointer (struct type *type, void *buf, + CORE_ADDR addr); -extern void fetch_inferior_event PARAMS ((void *)); +extern void wait_for_inferior (void); -extern void init_wait_for_inferior PARAMS ((void)); +extern void fetch_inferior_event (void *); -extern void close_exec_file PARAMS ((void)); +extern void init_wait_for_inferior (void); -extern void reopen_exec_file PARAMS ((void)); +extern void close_exec_file (void); + +extern void reopen_exec_file (void); /* The `resume' routine should only be called in special circumstances. Normally, use `proceed', which handles a lot of bookkeeping. */ -extern void resume PARAMS ((int, enum target_signal)); +extern void resume (int, enum target_signal); /* From misc files */ -extern void store_inferior_registers PARAMS ((int)); +extern void store_inferior_registers (int); -extern void fetch_inferior_registers PARAMS ((int)); +extern void fetch_inferior_registers (int); -extern void solib_create_inferior_hook PARAMS ((void)); +extern void solib_create_inferior_hook (void); -extern void child_terminal_info PARAMS ((char *, int)); +extern void child_terminal_info (char *, int); -extern void term_info PARAMS ((char *, int)); +extern void term_info (char *, int); -extern void terminal_ours_for_output PARAMS ((void)); +extern void terminal_ours_for_output (void); -extern void terminal_inferior PARAMS ((void)); +extern void terminal_inferior (void); -extern void terminal_init_inferior PARAMS ((void)); +extern void terminal_init_inferior (void); -extern void terminal_init_inferior_with_pgrp PARAMS ((int pgrp)); +extern void terminal_init_inferior_with_pgrp (int pgrp); /* From infptrace.c or infttrace.c */ -extern int attach PARAMS ((int)); +extern int attach (int); #if !defined(REQUIRE_ATTACH) #define REQUIRE_ATTACH attach @@ -203,70 +215,67 @@ extern int attach PARAMS ((int)); #define REQUIRE_DETACH(pid,siggnal) detach (siggnal) #endif -extern void detach PARAMS ((int)); +extern void detach (int); /* PTRACE method of waiting for inferior process. */ -int ptrace_wait PARAMS ((int, int *)); +int ptrace_wait (int, int *); -extern void child_resume PARAMS ((int, int, enum target_signal)); +extern void child_resume (int, int, enum target_signal); #ifndef PTRACE_ARG3_TYPE #define PTRACE_ARG3_TYPE int /* Correct definition for most systems. */ #endif -extern int call_ptrace PARAMS ((int, int, PTRACE_ARG3_TYPE, int)); +extern int call_ptrace (int, int, PTRACE_ARG3_TYPE, int); -extern void pre_fork_inferior PARAMS ((void)); +extern void pre_fork_inferior (void); /* From procfs.c */ -extern int proc_iterate_over_mappings PARAMS ((int (*)(int, CORE_ADDR))); +extern int proc_iterate_over_mappings (int (*)(int, CORE_ADDR)); -extern int procfs_first_available PARAMS ((void)); +extern int procfs_first_available (void); /* From fork-child.c */ -extern void fork_inferior PARAMS ((char *, char *, char **, - void (*)(void), - void (*)(int), - void (*)(void), - char *)); +extern void fork_inferior (char *, char *, char **, + void (*)(void), + void (*)(int), void (*)(void), char *); -extern void -clone_and_follow_inferior PARAMS ((int, int *)); +extern void clone_and_follow_inferior (int, int *); -extern void startup_inferior PARAMS ((int)); +extern void startup_inferior (int); /* From inflow.c */ -extern void new_tty_prefork PARAMS ((char *)); +extern void new_tty_prefork (char *); -extern int gdb_has_a_terminal PARAMS ((void)); +extern int gdb_has_a_terminal (void); /* From infrun.c */ -extern void start_remote PARAMS ((void)); +extern void start_remote (void); -extern void normal_stop PARAMS ((void)); +extern void normal_stop (void); -extern int signal_stop_state PARAMS ((int)); +extern int signal_stop_state (int); -extern int signal_print_state PARAMS ((int)); +extern int signal_print_state (int); -extern int signal_pass_state PARAMS ((int)); +extern int signal_pass_state (int); -extern int signal_stop_update PARAMS ((int, int)); +extern int signal_stop_update (int, int); -extern int signal_print_update PARAMS ((int, int)); +extern int signal_print_update (int, int); -extern int signal_pass_update PARAMS ((int, int)); +extern int signal_pass_update (int, int); /* From infcmd.c */ -extern void tty_command PARAMS ((char *, int)); +extern void tty_command (char *, int); -extern void attach_command PARAMS ((char *, int)); +extern void attach_command (char *, int); /* Last signal that the inferior received (why it stopped). */ @@ -421,6 +430,9 @@ extern int attach_flag; #define CALL_DUMMY_STACK_ADJUST_P (0) #endif +/* FIXME: cagney/2000-04-17: gdbarch should manage this. The default + shouldn't be necessary. */ + #if !defined (CALL_DUMMY_P) #if defined (CALL_DUMMY) #define CALL_DUMMY_P 1 @@ -429,24 +441,6 @@ extern int attach_flag; #endif #endif -#if !defined (CALL_DUMMY_WORDS) -#if defined (CALL_DUMMY) -extern LONGEST call_dummy_words[]; -#define CALL_DUMMY_WORDS (call_dummy_words) -#else -#define CALL_DUMMY_WORDS (internal_error ("CALL_DUMMY_WORDS"), (void*) 0) -#endif -#endif - -#if !defined (SIZEOF_CALL_DUMMY_WORDS) -#if defined (CALL_DUMMY) -extern int sizeof_call_dummy_words; -#define SIZEOF_CALL_DUMMY_WORDS (sizeof_call_dummy_words) -#else -#define SIZEOF_CALL_DUMMY_WORDS (internal_error ("SIZEOF_CALL_DUMMY_WORDS"), 0) -#endif -#endif - #if !defined PUSH_DUMMY_FRAME #define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0) #endif @@ -462,28 +456,32 @@ extern int sizeof_call_dummy_words; /* Are we in a call dummy? */ -extern int pc_in_call_dummy_before_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); +extern int pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address); #if !GDB_MULTI_ARCH #if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == BEFORE_TEXT_END #define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_before_text_end (pc, sp, frame_address) #endif /* Before text_end. */ #endif -extern int pc_in_call_dummy_after_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); +extern int pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address); #if !GDB_MULTI_ARCH #if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AFTER_TEXT_END #define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address) #endif #endif -extern int pc_in_call_dummy_on_stack PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); +extern int pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address); #if !GDB_MULTI_ARCH #if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == ON_STACK #define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_on_stack (pc, sp, frame_address) #endif #endif -extern int pc_in_call_dummy_at_entry_point PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); +extern int pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address); #if !GDB_MULTI_ARCH #if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AT_ENTRY_POINT #define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_at_entry_point (pc, sp, frame_address) diff --git a/gdb/inflow.c b/gdb/inflow.c index 3747a7d73d5..0b98f83ea9d 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -57,20 +57,16 @@ #endif #if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN) -static void -handle_sigio PARAMS ((int)); +static void handle_sigio (int); #endif -extern void _initialize_inflow PARAMS ((void)); +extern void _initialize_inflow (void); -static void -pass_signal PARAMS ((int)); +static void pass_signal (int); -static void -kill_command PARAMS ((char *, int)); +static void kill_command (char *, int); -static void -terminal_ours_1 PARAMS ((int)); +static void terminal_ours_1 (int); /* Record terminal status separately for debugger and inferior. */ @@ -176,7 +172,7 @@ gdb_has_a_terminal () fprintf_unfiltered(gdb_stderr, "[%s failed in terminal_inferior: %s]\n", \ what, strerror (errno)) -static void terminal_ours_1 PARAMS ((int)); +static void terminal_ours_1 (int); /* Initialize the terminal settings we record for the inferior, before we actually run the inferior. */ diff --git a/gdb/infptrace.c b/gdb/infptrace.c index fb0373af94e..52ff7a3eade 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -34,7 +34,7 @@ #endif #include -#include +#include "gdb_dirent.h" #include #include @@ -100,12 +100,12 @@ #endif /* !FETCH_INFERIOR_REGISTERS */ #if !defined (CHILD_XFER_MEMORY) -static void udot_info PARAMS ((char *, int)); +static void udot_info (char *, int); #endif #if !defined (FETCH_INFERIOR_REGISTERS) -static void fetch_register PARAMS ((int)); -static void store_register PARAMS ((int)); +static void fetch_register (int); +static void store_register (int); #endif /* @@ -124,8 +124,8 @@ static void store_register PARAMS ((int)); #define TIDGET(PID) 0 #endif -void _initialize_kernel_u_addr PARAMS ((void)); -void _initialize_infptrace PARAMS ((void)); +void _initialize_kernel_u_addr (void); +void _initialize_infptrace (void); /* This function simply calls ptrace with the given arguments. diff --git a/gdb/infrun.c b/gdb/infrun.c index 594523f1716..d6075770ac6 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -46,7 +46,7 @@ static void sig_print_info (enum target_signal); static void sig_print_header (void); -static void resume_cleanups (int); +static void resume_cleanups (void *); static int hook_stop_stub (void *); @@ -436,13 +436,13 @@ static int follow_vfork_when_exec; static char *follow_fork_mode_kind_names[] = { -/* ??rehrauer: The "both" option is broken, by what may be a 10.20 - kernel problem. It's also not terribly useful without a GUI to - help the user drive two debuggers. So for now, I'm disabling - the "both" option. - "parent", "child", "both", "ask" }; - */ - "parent", "child", "ask"}; + /* ??rehrauer: The "both" option is broken, by what may be a 10.20 + kernel problem. It's also not terribly useful without a GUI to + help the user drive two debuggers. So for now, I'm disabling the + "both" option. */ + /* "parent", "child", "both", "ask" */ + "parent", "child", "ask", NULL +}; static char *follow_fork_mode_string = NULL; @@ -752,7 +752,7 @@ static int singlestep_breakpoints_inserted_p = 0; /* Things to clean up if we QUIT out of resume (). */ /* ARGSUSED */ static void -resume_cleanups (int arg) +resume_cleanups (void *ignore) { normal_stop (); } @@ -762,7 +762,12 @@ static char schedlock_on[] = "on"; static char schedlock_step[] = "step"; static char *scheduler_mode = schedlock_off; static char *scheduler_enums[] = -{schedlock_off, schedlock_on, schedlock_step}; +{ + schedlock_off, + schedlock_on, + schedlock_step, + NULL +}; static void set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c) @@ -791,8 +796,7 @@ void resume (int step, enum target_signal sig) { int should_resume = 1; - struct cleanup *old_cleanups = make_cleanup ((make_cleanup_func) - resume_cleanups, 0); + struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); QUIT; #ifdef CANNOT_STEP_BREAKPOINT @@ -1044,9 +1048,11 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) int temp = insert_breakpoints (); if (temp) { - print_sys_errmsg ("ptrace", temp); + print_sys_errmsg ("insert_breakpoints", temp); error ("Cannot insert breakpoints.\n\ -The same program may be running in another process."); +The same program may be running in another process,\n\ +or you may have requested too many hardware\n\ +breakpoints and/or watchpoints.\n"); } breakpoints_inserted = 1; @@ -2267,6 +2273,8 @@ handle_inferior_event (struct execution_control_state *ecs) the HP-UX maintainer to furnish a fix that doesn't break other platforms. --JimB, 20 May 1999 */ check_sigtramp2 (ecs); + keep_going (ecs); + return; } /* Handle cases caused by hitting a breakpoint. */ @@ -2738,6 +2746,20 @@ handle_inferior_event (struct execution_control_state *ecs) if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc)) { /* We're doing a "next". */ + + if (IN_SIGTRAMP (stop_pc, ecs->stop_func_name) + && INNER_THAN (step_frame_address, read_sp())) + /* We stepped out of a signal handler, and into its + calling trampoline. This is misdetected as a + subroutine call, but stepping over the signal + trampoline isn't such a bad idea. In order to do + that, we have to ignore the value in + step_frame_address, since that doesn't represent the + frame that'll reach when we return from the signal + trampoline. Otherwise we'll probably continue to the + end of the program. */ + step_frame_address = 0; + step_over_function (ecs); keep_going (ecs); return; @@ -3038,7 +3060,7 @@ step_over_function (struct execution_control_state *ecs) step_resume_breakpoint = set_momentary_breakpoint (sr_sal, get_current_frame (), bp_step_resume); - if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc)) + if (step_frame_address && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc)) step_resume_breakpoint->frame = step_frame_address; if (breakpoints_inserted) @@ -3383,9 +3405,11 @@ normal_stop (void) if (breakpoints_failed) { target_terminal_ours_for_output (); - print_sys_errmsg ("ptrace", breakpoints_failed); + print_sys_errmsg ("While inserting breakpoints", breakpoints_failed); printf_filtered ("Stopped; cannot insert breakpoints.\n\ -The same program may be running in another process.\n"); +The same program may be running in another process,\n\ +or you may have requested too many hardware breakpoints\n\ +and/or watchpoints.\n"); } if (target_has_execution && breakpoints_inserted) @@ -4089,6 +4113,18 @@ restore_inferior_status (struct inferior_status *inf_status) free_inferior_status (inf_status); } +static void +do_restore_inferior_status_cleanup (void *sts) +{ + restore_inferior_status (sts); +} + +struct cleanup * +make_cleanup_restore_inferior_status (struct inferior_status *inf_status) +{ + return make_cleanup (do_restore_inferior_status_cleanup, inf_status); +} + void discard_inferior_status (struct inferior_status *inf_status) { @@ -4242,7 +4278,7 @@ to the user would be loading/unloading of a new library.\n", c = add_set_enum_cmd ("follow-fork-mode", class_run, follow_fork_mode_kind_names, - (char *) &follow_fork_mode_string, + &follow_fork_mode_string, /* ??rehrauer: The "both" option is broken, by what may be a 10.20 kernel problem. It's also not terribly useful without a GUI to help the user drive two debuggers. So for now, I'm disabling @@ -4277,7 +4313,7 @@ By default, the debugger will follow the parent process.", c = add_set_enum_cmd ("scheduler-locking", class_run, scheduler_enums, /* array of string names */ - (char *) &scheduler_mode, /* current mode */ + &scheduler_mode, /* current mode */ "Set mode for locking scheduler during execution.\n\ off == no locking (threads may preempt at any time)\n\ on == full locking (no thread except the current thread may run)\n\ diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 82a15cdf243..53c53e4f5a7 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -34,76 +34,62 @@ #include "gdb_wait.h" -extern struct symtab_and_line * - child_enable_exception_callback PARAMS ((enum exception_event_kind, int)); +extern struct symtab_and_line *child_enable_exception_callback (enum + exception_event_kind, + int); -extern struct exception_event_record * - child_get_current_exception_event PARAMS ((void)); +extern struct exception_event_record + *child_get_current_exception_event (void); -extern void _initialize_inftarg PARAMS ((void)); +extern void _initialize_inftarg (void); -static void -child_prepare_to_store PARAMS ((void)); +static void child_prepare_to_store (void); #ifndef CHILD_WAIT -static int child_wait PARAMS ((int, struct target_waitstatus *)); +static int child_wait (int, struct target_waitstatus *); #endif /* CHILD_WAIT */ #if !defined(CHILD_POST_WAIT) -void -child_post_wait PARAMS ((int, int)); +void child_post_wait (int, int); #endif -static void child_open PARAMS ((char *, int)); +static void child_open (char *, int); -static void -child_files_info PARAMS ((struct target_ops *)); +static void child_files_info (struct target_ops *); -static void -child_detach PARAMS ((char *, int)); +static void child_detach (char *, int); -static void -child_detach_from_process PARAMS ((int, char *, int, int)); +static void child_detach_from_process (int, char *, int, int); -static void -child_attach PARAMS ((char *, int)); +static void child_attach (char *, int); -static void -child_attach_to_process PARAMS ((char *, int, int)); +static void child_attach_to_process (char *, int, int); #if !defined(CHILD_POST_ATTACH) -extern void child_post_attach PARAMS ((int)); +extern void child_post_attach (int); #endif -static void -child_require_attach PARAMS ((char *, int)); +static void child_require_attach (char *, int); -static void -child_require_detach PARAMS ((int, char *, int)); +static void child_require_detach (int, char *, int); -static void -ptrace_me PARAMS ((void)); +static void ptrace_me (void); -static void -ptrace_him PARAMS ((int)); +static void ptrace_him (int); -static void -child_create_inferior PARAMS ((char *, char *, char **)); +static void child_create_inferior (char *, char *, char **); -static void -child_mourn_inferior PARAMS ((void)); +static void child_mourn_inferior (void); -static int -child_can_run PARAMS ((void)); +static int child_can_run (void); -static void -child_stop PARAMS ((void)); +static void child_stop (void); #ifndef CHILD_THREAD_ALIVE -int child_thread_alive PARAMS ((int)); +int child_thread_alive (int); #endif -static void init_child_ops PARAMS ((void)); +static void init_child_ops (void); extern char **environ; diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c index 03eadc0359e..b3e288ce8fb 100644 --- a/gdb/irix4-nat.c +++ b/gdb/irix4-nat.c @@ -30,14 +30,16 @@ #include #include /* For JB_XXX. */ +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* Size of elements in jmpbuf */ #define JB_ELEMENT_SIZE 4 typedef unsigned int greg_t; /* why isn't this defined? */ -static void -fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR)); +static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR); /* * See the comment in m68k-tdep.c regarding the utility of these functions. diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 0c090de6477..ea37b8c23b4 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -33,8 +33,10 @@ #include #include /* For JB_XXX. */ -static void -fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR)); +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + +static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR); /* Size of elements in jmpbuf */ @@ -342,38 +344,27 @@ static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */ /* Local function prototypes */ -static void -sharedlibrary_command PARAMS ((char *, int)); +static void sharedlibrary_command (char *, int); -static int -enable_break PARAMS ((void)); +static int enable_break (void); -static int -disable_break PARAMS ((void)); +static int disable_break (void); -static void -info_sharedlibrary_command PARAMS ((char *, int)); +static void info_sharedlibrary_command (char *, int); -static int -symbol_add_stub PARAMS ((char *)); +static int symbol_add_stub (void *); -static struct so_list * - find_solib PARAMS ((struct so_list *)); +static struct so_list *find_solib (struct so_list *); -static struct link_map * - first_link_map_member PARAMS ((void)); +static struct link_map *first_link_map_member (void); -static struct link_map * - next_link_map_member PARAMS ((struct so_list *)); +static struct link_map *next_link_map_member (struct so_list *); -static void -xfer_link_map_member PARAMS ((struct so_list *, struct link_map *)); +static void xfer_link_map_member (struct so_list *, struct link_map *); -static CORE_ADDR - locate_base PARAMS ((void)); +static CORE_ADDR locate_base (void); -static int -solib_map_sections PARAMS ((char *)); +static int solib_map_sections (void *); /* @@ -403,8 +394,7 @@ solib_map_sections PARAMS ((char *)); */ static int -solib_map_sections (arg) - char *arg; +solib_map_sections (void *arg) { struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */ char *filename; @@ -469,6 +459,7 @@ solib_map_sections (arg) /* Free the file names, close the file now. */ do_cleanups (old_chain); + /* must be non-zero */ return (1); } @@ -573,12 +564,13 @@ first_link_map_member () return NULL; /* Get first list entry. */ - lladdr = (CORE_ADDR) listp; + /* The MIPS Sign extends addresses. */ + lladdr = host_pointer_to_address (listp); read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list)); /* The first entry in the list is the object file we are debugging, so skip it. */ - next_lladdr = (CORE_ADDR) list_old.next; + next_lladdr = host_pointer_to_address (list_old.next); #ifdef HANDLE_NEW_OBJ_LIST if (list_old.data == NEW_OBJ_INFO_MAGIC) @@ -638,7 +630,7 @@ next_link_map_member (so_list_ptr) status = target_read_memory (lm->l_lladdr, (char *) &list_old, sizeof (struct obj_list)); - next_lladdr = (CORE_ADDR) list_old.next; + next_lladdr = host_pointer_to_address (list_old.next); } #ifdef HANDLE_NEW_OBJ_LIST else if (lm->l_variant == OBJ_LIST_32) @@ -691,7 +683,7 @@ xfer_link_map_member (so_list_ptr, lm) new_lm->l_variant = OBJ_LIST_OLD; new_lm->l_lladdr = lladdr; - new_lm->l_next = (CORE_ADDR) list_old.next; + new_lm->l_next = host_pointer_to_address (list_old.next); #ifdef HANDLE_NEW_OBJ_LIST if (list_old.data == NEW_OBJ_INFO_MAGIC) @@ -827,8 +819,7 @@ find_solib (so_list_ptr) /* A small stub to get us past the arg-passing pinhole of catch_errors. */ static int -symbol_add_stub (arg) - char *arg; +symbol_add_stub (void *arg) { register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ CORE_ADDR text_addr = 0; @@ -852,9 +843,12 @@ symbol_add_stub (arg) text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so); } - section_addrs.text_addr = text_addr; + + section_addrs.other[0].name = ".text"; + section_addrs.other[0].addr = text_addr; so->objfile = symbol_file_add (so->so_name, so->from_tty, §ion_addrs, 0, 0); + /* must be non-zero */ return (1); } diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index be5b590a360..ddf22907518 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -99,21 +99,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define YYDEBUG 0 /* Default to no yydebug support */ #endif -int -yyparse PARAMS ((void)); +int yyparse (void); -static int -yylex PARAMS ((void)); +static int yylex (void); -void -yyerror PARAMS ((char *)); +void yyerror (char *); -static struct type * java_type_from_name PARAMS ((struct stoken)); -static void push_expression_name PARAMS ((struct stoken)); -static void push_fieldnames PARAMS ((struct stoken)); +static struct type *java_type_from_name (struct stoken); +static void push_expression_name (struct stoken); +static void push_fieldnames (struct stoken); -static struct expression *copy_exp PARAMS ((struct expression *, int)); -static void insert_exp PARAMS ((int, struct expression *)); +static struct expression *copy_exp (struct expression *, int); +static void insert_exp (int, struct expression *); %} @@ -145,8 +142,7 @@ static void insert_exp PARAMS ((int, struct expression *)); %{ /* YYSTYPE gets defined by %union */ -static int -parse_number PARAMS ((char *, int, int, YYSTYPE *)); +static int parse_number (char *, int, int, YYSTYPE *); %} %type rcurly Dims Dims_opt diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 367add2427f..4c08c7345be 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -47,16 +47,16 @@ struct type *java_void_type; /* Local functions */ -extern void _initialize_java_language PARAMS ((void)); +extern void _initialize_java_language (void); -static int java_demangled_signature_length PARAMS ((char *)); -static void java_demangled_signature_copy PARAMS ((char *, char *)); +static int java_demangled_signature_length (char *); +static void java_demangled_signature_copy (char *, char *); -static struct symtab *get_java_class_symtab PARAMS ((void)); -static char *get_java_utf8_name PARAMS ((struct obstack * obstack, value_ptr name)); -static int java_class_is_primitive PARAMS ((value_ptr clas)); -static struct type *java_lookup_type PARAMS ((char *signature)); -static value_ptr java_value_string PARAMS ((char *ptr, int len)); +static struct symtab *get_java_class_symtab (void); +static char *get_java_utf8_name (struct obstack *obstack, value_ptr name); +static int java_class_is_primitive (value_ptr clas); +static struct type *java_lookup_type (char *signature); +static value_ptr java_value_string (char *ptr, int len); static void java_emit_char (int c, struct ui_file * stream, int quoter); @@ -66,7 +66,7 @@ static void java_emit_char (int c, struct ui_file * stream, int quoter); static struct objfile *dynamics_objfile = NULL; -static struct type *java_link_class_type PARAMS ((struct type *, value_ptr)); +static struct type *java_link_class_type (struct type *, value_ptr); static struct objfile * get_dynamics_objfile () @@ -149,7 +149,7 @@ add_class_symtab_symbol (sym) BLOCK_NSYMS (bl) = BLOCK_NSYMS (bl) + 1; } -static struct symbol *add_class_symbol PARAMS ((struct type * type, CORE_ADDR addr)); +static struct symbol *add_class_symbol (struct type *type, CORE_ADDR addr); static struct symbol * add_class_symbol (type, addr) @@ -224,7 +224,7 @@ get_java_utf8_name (obstack, name) + TYPE_LENGTH (VALUE_TYPE (temp)); chrs = obstack_alloc (obstack, name_length + 1); chrs[name_length] = '\0'; - read_memory_section (data_addr, chrs, name_length, NULL); + read_memory (data_addr, chrs, name_length); return chrs; } @@ -1107,7 +1107,7 @@ _initialize_java_language () We should use make_run_cleanup to have this be called. But will that mess up values in value histry? FIXME */ -extern void java_rerun_cleanup PARAMS ((void)); +extern void java_rerun_cleanup (void); void java_rerun_cleanup () { diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index cfb1a39d64e..5d62c382e87 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern int -java_parse PARAMS ((void)); /* Defined in jv-exp.y */ +extern int java_parse (void); /* Defined in jv-exp.y */ -extern void -java_error PARAMS ((char *)); /* Defined in jv-exp.y */ +extern void java_error (char *); /* Defined in jv-exp.y */ /* sizeof (struct Object) */ #define JAVA_OBJECT_SIZE (get_java_object_header_size ()) @@ -44,25 +42,25 @@ extern int java_val_print (struct type *, char *, int, CORE_ADDR, extern int java_value_print (struct value *, struct ui_file *, int, enum val_prettyprint); -extern value_ptr java_class_from_object PARAMS ((value_ptr)); +extern value_ptr java_class_from_object (value_ptr); -extern struct type *type_from_class PARAMS ((struct value *)); +extern struct type *type_from_class (struct value *); -extern struct type *java_primitive_type PARAMS ((int signature)); +extern struct type *java_primitive_type (int signature); -extern struct type *java_primitive_type_from_name PARAMS ((char *, int)); +extern struct type *java_primitive_type_from_name (char *, int); -extern struct type *java_array_type PARAMS ((struct type *, int)); +extern struct type *java_array_type (struct type *, int); -extern struct type *get_java_object_type PARAMS ((void)); -extern int get_java_object_header_size PARAMS ((void)); +extern struct type *get_java_object_type (void); +extern int get_java_object_header_size (void); -extern struct type *java_lookup_class PARAMS ((char *)); +extern struct type *java_lookup_class (char *); -extern int is_object_type PARAMS ((struct type *)); +extern int is_object_type (struct type *); /* Defined in jv-typeprint.c */ extern void java_print_type (struct type *, char *, struct ui_file *, int, int); -extern char *java_demangle_type_signature PARAMS ((char *)); +extern char *java_demangle_type_signature (char *); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 0f4232cc8c6..6f9273d5100 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -454,6 +454,7 @@ java_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, recurse, pretty) struct type *type; char *valaddr; + int embedded_offset; CORE_ADDR address; struct ui_file *stream; int format; diff --git a/gdb/language.c b/gdb/language.c index 20d2adb66c0..60f43d3f3b4 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -42,49 +42,35 @@ #include "target.h" #include "parser-defs.h" -extern void _initialize_language PARAMS ((void)); +extern void _initialize_language (void); -static void -show_language_command PARAMS ((char *, int)); +static void show_language_command (char *, int); -static void -set_language_command PARAMS ((char *, int)); +static void set_language_command (char *, int); -static void -show_type_command PARAMS ((char *, int)); +static void show_type_command (char *, int); -static void -set_type_command PARAMS ((char *, int)); +static void set_type_command (char *, int); -static void -show_range_command PARAMS ((char *, int)); +static void show_range_command (char *, int); -static void -set_range_command PARAMS ((char *, int)); +static void set_range_command (char *, int); -static void -set_range_str PARAMS ((void)); +static void set_range_str (void); -static void -set_type_str PARAMS ((void)); +static void set_type_str (void); -static void -set_lang_str PARAMS ((void)); +static void set_lang_str (void); -static void -unk_lang_error PARAMS ((char *)); +static void unk_lang_error (char *); -static int -unk_lang_parser PARAMS ((void)); +static int unk_lang_parser (void); -static void -show_check PARAMS ((char *, int)); +static void show_check (char *, int); -static void -set_check PARAMS ((char *, int)); +static void set_check (char *, int); -static void -set_type_range PARAMS ((void)); +static void set_type_range (void); static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter); @@ -94,8 +80,7 @@ static void unk_lang_printstr (struct ui_file * stream, char *string, unsigned int length, int width, int force_ellipses); -static struct type * - unk_lang_create_fundamental_type PARAMS ((struct objfile *, int)); +static struct type *unk_lang_create_fundamental_type (struct objfile *, int); static void unk_lang_print_type (struct type *, char *, struct ui_file *, int, int); diff --git a/gdb/language.h b/gdb/language.h index 69ac2082ec1..185bc919ea0 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -141,15 +141,15 @@ struct language_defn /* Parser function. */ - int (*la_parser) PARAMS ((void)); + int (*la_parser) (void); /* Parser error function */ - void (*la_error) PARAMS ((char *)); + void (*la_error) (char *); /* Evaluate an expression. */ - struct value *(*evaluate_exp) PARAMS ((struct type *, struct expression *, - int *, enum noside)); + struct value *(*evaluate_exp) (struct type *, struct expression *, + int *, enum noside); void (*la_printchar) (int ch, struct ui_file * stream); @@ -159,7 +159,7 @@ struct language_defn void (*la_emitchar) (int ch, struct ui_file * stream, int quoter); - struct type *(*la_fund_type) PARAMS ((struct objfile *, int)); + struct type *(*la_fund_type) (struct objfile *, int); /* Print a type using syntax appropriate for this language. */ @@ -265,11 +265,9 @@ language_mode; #define CAST_IS_CONVERSION (current_language->la_language == language_c || \ current_language->la_language == language_cplus) -extern void -language_info PARAMS ((int)); +extern void language_info (int); -extern enum language -set_language PARAMS ((enum language)); +extern enum language set_language (enum language); /* This page contains functions that return things that are @@ -353,14 +351,11 @@ set_language PARAMS ((enum language)); overwritten by the next call. Takes printf options like "08" or "l" (to produce e.g. %08x or %lx). */ -extern char * - local_decimal_format_custom PARAMS ((char *)); /* language.c */ +extern char *local_decimal_format_custom (char *); /* language.c */ -extern char * - local_octal_format_custom PARAMS ((char *)); /* language.c */ +extern char *local_octal_format_custom (char *); /* language.c */ -extern char * - local_hex_format_custom PARAMS ((char *)); /* language.c */ +extern char *local_hex_format_custom (char *); /* language.c */ #if 0 /* FIXME: cagney/2000-03-04: This function does not appear to be used. @@ -368,108 +363,85 @@ extern char * /* Return a string that contains the hex digits of the number. No preceeding "0x" */ -extern char * - longest_raw_hex_string PARAMS ((LONGEST)); +extern char *longest_raw_hex_string (LONGEST); #endif /* Return a string that contains a number formatted in one of the local (language-specific) formats. Result is static and is overwritten by the next call. Takes printf options like "08l" or "l". */ -extern char * - local_hex_string PARAMS ((unsigned long)); /* language.c */ +extern char *local_hex_string (unsigned long); /* language.c */ -extern char * - longest_local_hex_string PARAMS ((LONGEST)); /* language.c */ +extern char *longest_local_hex_string (LONGEST); /* language.c */ -extern char * - local_hex_string_custom PARAMS ((unsigned long, char *)); /* language.c */ +extern char *local_hex_string_custom (unsigned long, char *); /* language.c */ -extern char * - longest_local_hex_string_custom PARAMS ((LONGEST, char *)); /* language.c */ +extern char *longest_local_hex_string_custom (LONGEST, char *); /* language.c */ /* Type predicates */ -extern int -simple_type PARAMS ((struct type *)); +extern int simple_type (struct type *); -extern int -ordered_type PARAMS ((struct type *)); +extern int ordered_type (struct type *); -extern int -same_type PARAMS ((struct type *, struct type *)); +extern int same_type (struct type *, struct type *); -extern int -integral_type PARAMS ((struct type *)); +extern int integral_type (struct type *); -extern int -numeric_type PARAMS ((struct type *)); +extern int numeric_type (struct type *); -extern int -character_type PARAMS ((struct type *)); +extern int character_type (struct type *); -extern int -boolean_type PARAMS ((struct type *)); +extern int boolean_type (struct type *); -extern int -float_type PARAMS ((struct type *)); +extern int float_type (struct type *); -extern int -pointer_type PARAMS ((struct type *)); +extern int pointer_type (struct type *); -extern int -structured_type PARAMS ((struct type *)); +extern int structured_type (struct type *); /* Checks Binary and Unary operations for semantic type correctness */ /* FIXME: Does not appear to be used */ #define unop_type_check(v,o) binop_type_check((v),NULL,(o)) -extern void -binop_type_check PARAMS ((struct value *, struct value *, int)); +extern void binop_type_check (struct value *, struct value *, int); /* Error messages */ -extern void -op_error PARAMS ((char *fmt, enum exp_opcode, int)); +extern void op_error (char *fmt, enum exp_opcode, int); #define type_op_error(f,o) \ op_error((f),(o),type_check==type_check_on ? 1 : 0) #define range_op_error(f,o) \ op_error((f),(o),range_check==range_check_on ? 1 : 0) -extern void - type_error -PARAMS ((char *,...)) -ATTR_FORMAT (printf, 1, 2); +extern void type_error (char *, ...) ATTR_FORMAT (printf, 1, 2); - void - range_error PARAMS ((char *,...)) - ATTR_FORMAT (printf, 1, 2); +void +range_error (char *, ...) +ATTR_FORMAT (printf, 1, 2); /* Data: Does this value represent "truth" to the current language? */ - extern int - value_true PARAMS ((struct value *)); +extern int value_true (struct value *); - extern struct type *lang_bool_type PARAMS ((void)); +extern struct type *lang_bool_type (void); /* The type used for Boolean values in the current language. */ #define LA_BOOL_TYPE lang_bool_type () /* Misc: The string representing a particular enum language. */ - extern enum language language_enum PARAMS ((char *str)); +extern enum language language_enum (char *str); - extern const struct language_defn *language_def PARAMS ((enum language)); +extern const struct language_defn *language_def (enum language); - extern char *language_str PARAMS ((enum language)); +extern char *language_str (enum language); /* Add a language to the set known by GDB (at initialization time). */ - extern void - add_language PARAMS ((const struct language_defn *)); +extern void add_language (const struct language_defn *); - extern enum language - get_frame_language PARAMS ((void)); /* In stack.c */ +extern enum language get_frame_language (void); /* In stack.c */ #endif /* defined (LANGUAGE_H) */ diff --git a/gdb/lin-thread.c b/gdb/lin-thread.c index de530f68882..cd9ab996eb7 100644 --- a/gdb/lin-thread.c +++ b/gdb/lin-thread.c @@ -125,6 +125,9 @@ #include /* dynamic library interface */ +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + #ifndef TIDGET #define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) #define PIDGET(PID) (((PID) & 0xffff)) @@ -170,6 +173,16 @@ typedef const void *gdb_ps_write_buf_t; typedef size_t gdb_ps_size_t; #endif +/* Unfortunately glibc 2.1.3 was released with a broken prfpregset_t + type. We let configure check for this lossage, and make + appropriate typedefs here. */ + +#ifdef PRFPREGSET_T_BROKEN +typedef elf_fpregset_t gdb_prfpregset_t; +#else +typedef prfpregset_t gdb_prfpregset_t; +#endif + /* * proc_service callback functions, called by thread_db. */ @@ -392,7 +405,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, /* Set LWP general regs */ ps_err_e ps_lgetfpregs (gdb_ps_prochandle_t ph, /* Get LWP float regs */ lwpid_t lwpid, - prfpregset_t *fpregset) + gdb_prfpregset_t *fpregset) { struct cleanup *old_chain = save_inferior_pid (); @@ -406,7 +419,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, /* Get LWP float regs */ ps_err_e ps_lsetfpregs (gdb_ps_prochandle_t ph, /* Set LWP float regs */ lwpid_t lwpid, - const prfpregset_t *fpregset) + const gdb_prfpregset_t *fpregset) { struct cleanup *old_chain = save_inferior_pid (); @@ -508,10 +521,10 @@ static td_err_e (*p_td_thr_setgregs) (const td_thrhandle_t *th_p, const prgregset_t regset); static td_err_e (*p_td_thr_getfpregs) (const td_thrhandle_t *th_p, - prfpregset_t *fpregset); + gdb_prfpregset_t *fpregset); static td_err_e (*p_td_thr_setfpregs) (const td_thrhandle_t *th_p, - const prfpregset_t *fpregset); + const gdb_prfpregset_t *fpregset); static td_err_e (*p_td_ta_map_id2thr) (const td_thragent_t *ta_p, thread_t tid, @@ -1270,7 +1283,7 @@ thread_db_fetch_registers (regno) int regno; { td_thrhandle_t thandle; - prfpregset_t fpregset; + gdb_prfpregset_t fpregset; prgregset_t gregset; thread_t thread; td_err_e ret; @@ -1321,7 +1334,7 @@ thread_db_store_registers (regno) int regno; { td_thrhandle_t thandle; - prfpregset_t fpregset; + gdb_prfpregset_t fpregset; prgregset_t gregset; thread_t thread; td_err_e ret; diff --git a/gdb/linux-thread.c b/gdb/linux-thread.c index 146481c6ac8..f25c763f13b 100644 --- a/gdb/linux-thread.c +++ b/gdb/linux-thread.c @@ -902,7 +902,7 @@ update_stop_threads (test_pid) */ /* Saved pointer to previous owner of the new_objfile event. */ -static void (*target_new_objfile_chain) PARAMS ((struct objfile *)); +static void (*target_new_objfile_chain) (struct objfile *); void linuxthreads_new_objfile (objfile) diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index baf1c22e2d0..39740180c0f 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -28,8 +28,8 @@ #include #include -static unsigned long registers_addr PARAMS ((int pid)); -static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR)); +static unsigned long registers_addr (int pid); +static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); #define X(ENTRY)(offsetof(struct econtext, ENTRY)) diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 94d1fe005b0..0463ca13cf3 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -100,22 +100,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define YYDEBUG 0 /* Default to no yydebug support */ #endif -int -yyparse PARAMS ((void)); +int yyparse (void); -static int -yylex PARAMS ((void)); +static int yylex (void); -void -yyerror PARAMS ((char *)); +void yyerror (char *); #if 0 -static char * -make_qualname PARAMS ((char *, char *)); +static char *make_qualname (char *, char *); #endif -static int -parse_number PARAMS ((int)); +static int parse_number (int); /* The sign of the number being parsed. */ static int number_sign = 1; diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 64e07cca44e..8b938107ad4 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -28,8 +28,8 @@ #include "c-lang.h" #include "valprint.h" -extern void _initialize_m2_language PARAMS ((void)); -static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int)); +extern void _initialize_m2_language (void); +static struct type *m2_create_fundamental_type (struct objfile *, int); static void m2_printstr (struct ui_file * stream, char *string, unsigned int length, int width, int force_ellipses); diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h index 6e63e8d7801..fffa7a54f46 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h @@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern int -m2_parse PARAMS ((void)); /* Defined in m2-exp.y */ +extern int m2_parse (void); /* Defined in m2-exp.y */ -extern void -m2_error PARAMS ((char *)); /* Defined in m2-exp.y */ +extern void m2_error (char *); /* Defined in m2-exp.y */ /* Defined in m2-typeprint.c */ extern void m2_print_type (struct type *, char *, struct ui_file *, int, diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index f6ea251f8a2..b975acecbca 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -38,7 +38,7 @@ #include "inferior.h" /* for write_pc() */ #include -extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t)); +extern void report_transfer_performance (unsigned long, time_t, time_t); #ifndef _MSC_VER /* @@ -189,8 +189,8 @@ m32r_load_gen (filename, from_tty) generic_load (filename, from_tty); } -static void m32r_open PARAMS ((char *args, int from_tty)); -static void mon2000_open PARAMS ((char *args, int from_tty)); +static void m32r_open (char *args, int from_tty); +static void mon2000_open (char *args, int from_tty); /* This array of registers needs to match the indexes used by GDB. The whole reason this exists is because the various ROM monitors use diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index ab3adc583e2..0bdb3f62fc1 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -91,7 +91,10 @@ delta68_in_sigtramp (pc, name) CORE_ADDR pc; char *name; { - return strcmp (name, "_sigcode") == 0; + if (name != NULL) + return strcmp (name, "_sigcode") == 0; + else + return 0; } CORE_ADDR @@ -504,6 +507,9 @@ lose:; #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* The /proc interface divides the target machine's register set up into two different sets, the general register set (gregset) and the floating point register set (fpregset). For each set, there is an ioctl to get diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index 4eed201fcaf..111f2a91a2f 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -82,6 +82,9 @@ m68k_linux_register_u_addr (blockend, regnum) #ifndef USE_PROC_FS +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + void supply_gregset (gregsetp) gregset_t *gregsetp; diff --git a/gdb/m88k-nat.c b/gdb/m88k-nat.c index ed9dfffc306..afaa4ea9817 100644 --- a/gdb/m88k-nat.c +++ b/gdb/m88k-nat.c @@ -239,6 +239,9 @@ m88k_register_u_addr (blockend, regnum) #include +/* Prototypes for supply_gregset etc. */ +#include "gregset.h" + /* Given a pointer to a general register set in /proc format (gregset_t *), unpack the register contents and supply them as gdb's idea of the current register values. */ diff --git a/gdb/mac-nat.c b/gdb/mac-nat.c index c8fcddbec1b..aa2541759d9 100644 --- a/gdb/mac-nat.c +++ b/gdb/mac-nat.c @@ -46,7 +46,7 @@ extern struct target_ops child_ops; -static void child_stop PARAMS ((void)); +static void child_stop (void); static void child_fetch_inferior_registers (int r) diff --git a/gdb/main.c b/gdb/main.c index 9f845a89c5e..c6b9516f99a 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -349,7 +349,7 @@ captured_main (void *data) #ifdef GDBTK case 'z': { - extern int gdbtk_test PARAMS ((char *)); +extern int gdbtk_test (char *); if (!gdbtk_test (optarg)) { fprintf_unfiltered (gdb_stderr, "%s: unable to load tclcommand file \"%s\"", diff --git a/gdb/maint.c b/gdb/maint.c index 8a8df594809..a4def305b5b 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -35,27 +35,27 @@ #include "objfiles.h" #include "value.h" -extern void _initialize_maint_cmds PARAMS ((void)); +extern void _initialize_maint_cmds (void); -static void maintenance_command PARAMS ((char *, int)); +static void maintenance_command (char *, int); -static void maintenance_dump_me PARAMS ((char *, int)); +static void maintenance_dump_me (char *, int); -static void maintenance_internal_error PARAMS ((char *args, int from_tty)); +static void maintenance_internal_error (char *args, int from_tty); -static void maintenance_demangle PARAMS ((char *, int)); +static void maintenance_demangle (char *, int); -static void maintenance_time_display PARAMS ((char *, int)); +static void maintenance_time_display (char *, int); -static void maintenance_space_display PARAMS ((char *, int)); +static void maintenance_space_display (char *, int); -static void maintenance_info_command PARAMS ((char *, int)); +static void maintenance_info_command (char *, int); -static void print_section_table PARAMS ((bfd *, asection *, PTR)); +static void print_section_table (bfd *, asection *, PTR); -static void maintenance_info_sections PARAMS ((char *, int)); +static void maintenance_info_sections (char *, int); -static void maintenance_print_command PARAMS ((char *, int)); +static void maintenance_print_command (char *, int); static void maintenance_do_deprecate (char *, int); @@ -495,6 +495,7 @@ to test internal functions such as the C++ demangler, etc.", "Commands for showing internal info about the program being debugged.", &maintenanceinfolist, "maintenance info ", 0, &maintenancelist); + add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist); add_cmd ("sections", class_maintenance, maintenance_info_sections, "List the BFD sections of the exec and core files.", diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 085cd094be8..e377435d491 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -57,7 +57,7 @@ #ifndef MIPS_EFI_SYMBOL_NAME #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__" -extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR)); +extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR); #include "coff/sym.h" #include "coff/symconst.h" typedef struct mips_extra_func_info @@ -91,7 +91,7 @@ typedef struct mips_extra_func_info #include "expression.h" #include "language.h" /* Needed inside partial-stab.h */ -extern void _initialize_mdebugread PARAMS ((void)); +extern void _initialize_mdebugread (void); /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ #ifndef ECOFF_REG_TO_REGNUM @@ -331,103 +331,77 @@ static int found_ecoff_debugging_info; /* Forward declarations */ -static void -add_pending PARAMS ((FDR *, char *, struct type *)); +static void add_pending (FDR *, char *, struct type *); -static struct mdebug_pending * - is_pending_symbol PARAMS ((FDR *, char *)); +static struct mdebug_pending *is_pending_symbol (FDR *, char *); -static void -pop_parse_stack PARAMS ((void)); +static void pop_parse_stack (void); -static void -push_parse_stack PARAMS ((void)); +static void push_parse_stack (void); -static char * - fdr_name PARAMS ((FDR *)); +static char *fdr_name (FDR *); -static void -mdebug_psymtab_to_symtab PARAMS ((struct partial_symtab *)); +static void mdebug_psymtab_to_symtab (struct partial_symtab *); static int -upgrade_type PARAMS ((int, struct type **, int, union aux_ext *, int, char *)); +upgrade_type (int, struct type **, int, union aux_ext *, int, char *); -static void -parse_partial_symbols PARAMS ((struct objfile *)); +static void parse_partial_symbols (struct objfile *); -static FDR -* get_rfd PARAMS ((int, int)); +static FDR * get_rfd (int, int); -static int -has_opaque_xref PARAMS ((FDR *, SYMR *)); +static int has_opaque_xref (FDR *, SYMR *); static int -cross_ref PARAMS ((int, union aux_ext *, struct type **, enum type_code, - char **, int, char *)); +cross_ref (int, union aux_ext *, struct type **, enum type_code, + char **, int, char *); -static struct symbol * - new_symbol PARAMS ((char *)); +static struct symbol *new_symbol (char *); -static struct type * - new_type PARAMS ((char *)); +static struct type *new_type (char *); -static struct block * - new_block PARAMS ((int)); +static struct block *new_block (int); -static struct symtab * - new_symtab PARAMS ((char *, int, int, struct objfile *)); +static struct symtab *new_symtab (char *, int, int, struct objfile *); -static struct linetable * - new_linetable PARAMS ((int)); +static struct linetable *new_linetable (int); -static struct blockvector * - new_bvect PARAMS ((int)); +static struct blockvector *new_bvect (int); static int -parse_symbol PARAMS ((SYMR *, union aux_ext *, char *, int, struct section_offsets *)); +parse_symbol (SYMR *, union aux_ext *, char *, int, struct section_offsets *, + struct objfile *); -static struct type * - parse_type PARAMS ((int, union aux_ext *, unsigned int, int *, int, char *)); +static struct type *parse_type (int, union aux_ext *, unsigned int, int *, + int, char *); -static struct symbol * - mylookup_symbol PARAMS ((char *, struct block *, namespace_enum, - enum address_class)); +static struct symbol *mylookup_symbol (char *, struct block *, namespace_enum, + enum address_class); -static struct block * - shrink_block PARAMS ((struct block *, struct symtab *)); +static struct block *shrink_block (struct block *, struct symtab *); -static PTR - xzalloc PARAMS ((unsigned int)); +static PTR xzalloc (unsigned int); -static void -sort_blocks PARAMS ((struct symtab *)); +static void sort_blocks (struct symtab *); -static int -compare_blocks PARAMS ((const void *, const void *)); +static int compare_blocks (const void *, const void *); -static struct partial_symtab * - new_psymtab PARAMS ((char *, struct objfile *)); +static struct partial_symtab *new_psymtab (char *, struct objfile *); -static void -psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *)); +static void psymtab_to_symtab_1 (struct partial_symtab *, char *); -static void -add_block PARAMS ((struct block *, struct symtab *)); +static void add_block (struct block *, struct symtab *); -static void -add_symbol PARAMS ((struct symbol *, struct block *)); +static void add_symbol (struct symbol *, struct block *); -static int -add_line PARAMS ((struct linetable *, int, CORE_ADDR, int)); +static int add_line (struct linetable *, int, CORE_ADDR, int); -static struct linetable * - shrink_linetable PARAMS ((struct linetable *)); +static struct linetable *shrink_linetable (struct linetable *); static void -handle_psymbol_enumerators PARAMS ((struct objfile *, FDR *, int, CORE_ADDR)); +handle_psymbol_enumerators (struct objfile *, FDR *, int, CORE_ADDR); -static char * - mdebug_next_symbol_text PARAMS ((struct objfile *)); +static char *mdebug_next_symbol_text (struct objfile *); /* Address bounds for the signal trampoline in inferior, if any */ @@ -716,16 +690,16 @@ add_pending (fh, sh, t) SYMR's handled (normally one). */ static int -parse_symbol (sh, ax, ext_sh, bigend, section_offsets) +parse_symbol (sh, ax, ext_sh, bigend, section_offsets, objfile) SYMR *sh; union aux_ext *ax; char *ext_sh; int bigend; struct section_offsets *section_offsets; + struct objfile *objfile; { const bfd_size_type external_sym_size = debug_swap->external_sym_size; - void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) = - debug_swap->swap_sym_in; + void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in; char *name; struct symbol *s; struct block *b; @@ -753,18 +727,18 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets) The value of a stBlock symbol is the displacement from the procedure address. */ if (sh->st != stEnd && sh->st != stBlock) - sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT); + sh->value += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); break; case scData: case scSData: case scRData: case scPData: case scXData: - sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA); + sh->value += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile)); break; case scBss: case scSBss: - sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS); + sh->value += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile)); break; } @@ -1925,8 +1899,7 @@ upgrade_type (fd, tpp, tq, ax, bigend, sym_name) to look for the function which contains the MIPS_EFI_SYMBOL_NAME symbol in question, or NULL to use top_stack->cur_block. */ -static void parse_procedure PARAMS ((PDR *, struct symtab *, - struct partial_symtab *)); +static void parse_procedure (PDR *, struct symtab *, struct partial_symtab *); static void parse_procedure (pr, search_symtab, pst) @@ -2042,7 +2015,7 @@ parse_procedure (pr, search_symtab, pst) procedure descriptor in e->pdr.adr. As the address in the procedure descriptor is usually relative, we would have to relocate e->pdr.adr with cur_fdr->adr and - ANOFFSET (pst->section_offsets, SECT_OFF_TEXT). + ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)). Unfortunately cur_fdr->adr and e->pdr.adr are both absolute in shared libraries on some systems, and on other systems e->pdr.adr is sometimes offset by a bogus value. @@ -2102,13 +2075,15 @@ ecoff_relocate_efi (sym, delta) This routine clobbers top_stack->cur_block and ->cur_st. */ -static void parse_external PARAMS ((EXTR *, int, struct section_offsets *)); +static void parse_external (EXTR *, int, struct section_offsets *, + struct objfile *); static void -parse_external (es, bigend, section_offsets) +parse_external (es, bigend, section_offsets, objfile) EXTR *es; int bigend; struct section_offsets *section_offsets; + struct objfile *objfile; { union aux_ext *ax; @@ -2183,7 +2158,7 @@ parse_external (es, bigend, section_offsets) /* Note that the case of a symbol with indexNil must be handled anyways by parse_symbol(). */ - parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets); + parse_symbol (&es->asym, ax, (char *) NULL, bigend, section_offsets, objfile); break; default: break; @@ -2196,8 +2171,8 @@ parse_external (es, bigend, section_offsets) numbers can go back and forth, apparently we can live with that and do not need to reorder our linetables */ -static void parse_lines PARAMS ((FDR *, PDR *, struct linetable *, int, - struct partial_symtab *, CORE_ADDR)); +static void parse_lines (FDR *, PDR *, struct linetable *, int, + struct partial_symtab *, CORE_ADDR); static void parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr) @@ -2278,12 +2253,9 @@ parse_partial_symbols (objfile) const bfd_size_type external_sym_size = debug_swap->external_sym_size; const bfd_size_type external_rfd_size = debug_swap->external_rfd_size; const bfd_size_type external_ext_size = debug_swap->external_ext_size; - void (*const swap_ext_in) PARAMS ((bfd *, PTR, EXTR *)) - = debug_swap->swap_ext_in; - void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) - = debug_swap->swap_sym_in; - void (*const swap_rfd_in) PARAMS ((bfd *, PTR, RFDT *)) - = debug_swap->swap_rfd_in; + void (*const swap_ext_in) (bfd *, PTR, EXTR *) = debug_swap->swap_ext_in; + void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in; + void (*const swap_rfd_in) (bfd *, PTR, RFDT *) = debug_swap->swap_rfd_in; int f_idx, s_idx; HDRR *hdr = &debug_info->symbolic_header; /* Running pointers */ @@ -2474,12 +2446,12 @@ parse_partial_symbols (objfile) { case stProc: /* Beginnning of Procedure */ - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); break; case stStaticProc: /* Load time only static procs */ ms_type = mst_file_text; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); break; case stGlobal: /* External symbol */ @@ -2492,12 +2464,12 @@ parse_partial_symbols (objfile) else if (SC_IS_DATA (ext_in->asym.sc)) { ms_type = mst_data; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); } else if (SC_IS_BSS (ext_in->asym.sc)) { ms_type = mst_bss; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); } else ms_type = mst_abs; @@ -2507,17 +2479,17 @@ parse_partial_symbols (objfile) if (SC_IS_TEXT (ext_in->asym.sc)) { ms_type = mst_file_text; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); } else if (SC_IS_DATA (ext_in->asym.sc)) { ms_type = mst_file_data; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); } else if (SC_IS_BSS (ext_in->asym.sc)) { ms_type = mst_file_bss; - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); } else ms_type = mst_abs; @@ -2561,7 +2533,7 @@ parse_partial_symbols (objfile) { textlow = fh->adr; if (relocatable || textlow != 0) - textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); } else textlow = 0; @@ -2649,7 +2621,7 @@ parse_partial_symbols (objfile) CORE_ADDR procaddr; long isym; - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (sh.st == stStaticProc) { namestring = debug_info->ss + fh->issBase + sh.iss; @@ -2657,7 +2629,7 @@ parse_partial_symbols (objfile) sh.value, mst_file_text, NULL, - SECT_OFF_TEXT, + SECT_OFF_TEXT (objfile), NULL, objfile); } @@ -2700,12 +2672,12 @@ parse_partial_symbols (objfile) case scPData: case scXData: namestring = debug_info->ss + fh->issBase + sh.iss; - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); prim_record_minimal_symbol_and_info (namestring, sh.value, mst_file_data, NULL, - SECT_OFF_DATA, + SECT_OFF_DATA (objfile), NULL, objfile); break; @@ -2714,12 +2686,12 @@ parse_partial_symbols (objfile) /* FIXME! Shouldn't this use cases for bss, then have the default be abs? */ namestring = debug_info->ss + fh->issBase + sh.iss; - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); prim_record_minimal_symbol_and_info (namestring, sh.value, mst_file_bss, NULL, - SECT_OFF_BSS, + SECT_OFF_BSS (objfile), NULL, objfile); break; @@ -2767,7 +2739,7 @@ parse_partial_symbols (objfile) #define CUR_SYMBOL_TYPE type_code #define CUR_SYMBOL_VALUE sh.value #define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms)\ - pst = save_pst + (pst = save_pst) #define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set) (void)0 #define HANDLE_RBRAC(val) \ if ((val) > save_pst->texthigh) save_pst->texthigh = (val); @@ -2818,18 +2790,18 @@ parse_partial_symbols (objfile) /* The value of a stEnd symbol is the displacement from the corresponding start symbol value, do not relocate it. */ if (sh.st != stEnd) - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); break; case scData: case scSData: case scRData: case scPData: case scXData: - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); break; case scBss: case scSBss: - sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); break; } @@ -2842,7 +2814,7 @@ parse_partial_symbols (objfile) case stStaticProc: prim_record_minimal_symbol_and_info (name, sh.value, mst_file_text, NULL, - SECT_OFF_TEXT, NULL, + SECT_OFF_TEXT (objfile), NULL, objfile); /* FALLTHROUGH */ @@ -2915,13 +2887,13 @@ parse_partial_symbols (objfile) if (SC_IS_DATA (sh.sc)) prim_record_minimal_symbol_and_info (name, sh.value, mst_file_data, NULL, - SECT_OFF_DATA, + SECT_OFF_DATA (objfile), NULL, objfile); else prim_record_minimal_symbol_and_info (name, sh.value, mst_file_bss, NULL, - SECT_OFF_BSS, + SECT_OFF_BSS (objfile), NULL, objfile); class = LOC_STATIC; @@ -3026,18 +2998,18 @@ parse_partial_symbols (objfile) { case scText: case scRConst: - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); break; case scData: case scSData: case scRData: case scPData: case scXData: - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); break; case scBss: case scSBss: - svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); break; } @@ -3191,8 +3163,7 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue) CORE_ADDR svalue; { const bfd_size_type external_sym_size = debug_swap->external_sym_size; - void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) - = debug_swap->swap_sym_in; + void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in; char *ext_sym = ((char *) debug_info->external_sym + ((fh->isymBase + cur_sdx + 1) * external_sym_size)); SYMR sh; @@ -3284,8 +3255,8 @@ psymtab_to_symtab_1 (pst, filename) { bfd_size_type external_sym_size; bfd_size_type external_pdr_size; - void (*swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)); - void (*swap_pdr_in) PARAMS ((bfd *, PTR, PDR *)); + void (*swap_sym_in) (bfd *, PTR, SYMR *); + void (*swap_pdr_in) (bfd *, PTR, PDR *); int i; struct symtab *st; FDR *fh; @@ -3435,7 +3406,7 @@ psymtab_to_symtab_1 (pst, filename) else { /* Handle encoded stab line number. */ - valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT); + valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)); record_line (current_subfile, sh.index, valu); } } @@ -3446,7 +3417,7 @@ psymtab_to_symtab_1 (pst, filename) else complain (&stab_unknown_complaint, name); } - st = end_symtab (pst->texthigh, pst->objfile, SECT_OFF_TEXT); + st = end_symtab (pst->texthigh, pst->objfile, SECT_OFF_TEXT (pst->objfile)); end_stabs (); /* Sort the symbol table now, we are done adding symbols to it. @@ -3561,7 +3532,7 @@ psymtab_to_symtab_1 (pst, filename) (*swap_sym_in) (cur_bfd, sym_ptr, &sh); c = parse_symbol (&sh, debug_info->external_aux + fh->iauxBase, - sym_ptr, fh->fBigendian, pst->section_offsets); + sym_ptr, fh->fBigendian, pst->section_offsets, pst->objfile); sym_ptr += c * external_sym_size; } @@ -3629,7 +3600,7 @@ psymtab_to_symtab_1 (pst, filename) ext_ptr = PST_PRIVATE (pst)->extern_tab; for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++) - parse_external (ext_ptr, fh->fBigendian, pst->section_offsets); + parse_external (ext_ptr, fh->fBigendian, pst->section_offsets, pst->objfile); /* If there are undefined symbols, tell the user. The alpha has an undefined symbol for every symbol that is diff --git a/gdb/mem-break.c b/gdb/mem-break.c index 99db9d29233..3f013c26098 100644 --- a/gdb/mem-break.c +++ b/gdb/mem-break.c @@ -125,10 +125,6 @@ default_memory_remove_breakpoint (addr, contents_cache) } -#if !defined(MEMORY_INSERT_BREAKPOINT) -#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) \ - default_memory_insert_breakpoint(addr, contents_cache) -#endif int memory_insert_breakpoint (addr, contents_cache) CORE_ADDR addr; @@ -137,10 +133,6 @@ memory_insert_breakpoint (addr, contents_cache) return MEMORY_INSERT_BREAKPOINT(addr, contents_cache); } -#if !defined(MEMORY_REMOVE_BREAKPOINT) -#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) \ - default_memory_remove_breakpoint(addr, contents_cache) -#endif int memory_remove_breakpoint (addr, contents_cache) CORE_ADDR addr; diff --git a/gdb/mi/ChangeLog-mi b/gdb/mi/ChangeLog similarity index 98% rename from gdb/mi/ChangeLog-mi rename to gdb/mi/ChangeLog index f0a3304500f..5edfce47222 100644 --- a/gdb/mi/ChangeLog-mi +++ b/gdb/mi/ChangeLog @@ -1,3 +1,30 @@ +Tue May 16 14:13:41 2000 Andrew Cagney + + * mi-main.c (mi_cmd_execute): Use free_current_contents. + (free_and_reset): Delete. + +Mon May 15 16:17:56 2000 Andrew Cagney + + * mi-main.c (mi_cmd_data_assign, mi_cmd_data_evaluate_expression), + mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete): Delete + make_cleanup_func casts. Not needed. + +2000-05-07 Eli Zaretskii + + * gdbmi.texinfo: Lots of typos and grammar fixes from Brian + Youmans <3diff@flib.gnu.ai.mit.edu>. + +Wed Apr 26 18:35:19 2000 Andrew Cagney + + * gdbmi.texinfo (GDB/MI Output Syntax v2.0): Convert Draft 2.0 + Output Syntax into a new section. Cross reference. + (menu): Fix tipo. GDB/MI Compatibility with CLI. + +2000-04-23 Eli Zaretskii + + * gdbmi.texinfo: Lots of changes, to include this document as part + of the GDB manual. + 2000-03-13 James Ingham * mi-cmd-var.c (mi_cmd_var_create): Add special frame cookie "@" diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo index 8602885caa8..c2aad450e65 100644 --- a/gdb/mi/gdbmi.texinfo +++ b/gdb/mi/gdbmi.texinfo @@ -1,293 +1,379 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename gdbmi.info -@settitle GDB/MI Machine Interface -@setchapternewpage off -@c %**end of header +@c \input texinfo @c -*-texinfo-*- +@c @c %**start of header +@c @setfilename gdbmi.info +@c @settitle GDB/MI Machine Interface +@c @setchapternewpage off +@c @c %**end of header + +@c @ifinfo +@c This file documents GDB/MI, a Machine Interface to GDB. + +@c Copyright (C) 2000, Free Software Foundation, Inc. +@c Contributed by Cygnus Solutions. + +@c Permission is granted to make and distribute verbatim copies of this +@c manual provided the copyright notice and this permission notice are +@c preserved on all copies. + +@c @ignore +@c Permission is granted to process this file through TeX and print the +@c results, provided the printed document carries copying permission notice +@c identical to this one except for the removal of this paragraph (this +@c paragraph not being relevant to the printed manual). + +@c @end ignore +@c Permission is granted to copy and distribute modified versions of this +@c manual under the conditions for verbatim copying, provided also that the +@c entire resulting derived work is distributed under the terms of a +@c permission notice identical to this one. + +@c Permission is granted to copy and distribute translations of this manual +@c into another language, under the above conditions for modified versions. +@c @end ifinfo + +@c @c This title page illustrates only one of the +@c @c two methods of forming a title page. + +@c @titlepage +@c @title GDB/MI +@c @subtitle Version 0.2 +@c @subtitle Feb 2000 +@c @author Andrew Cagney, Fernando Nasser and Elena Zannoni + +@c @c The following two commands +@c @c start the copyright page. +@c @page +@c @vskip 0pt plus 1filll +@c Permission is granted to make and distribute verbatim copies of this +@c manual provided the copyright notice and this permission notice are +@c preserved on all copies. + +@c Copyright @copyright{} 2000, Free Software Foundation, Inc. +@c @end titlepage -@ifinfo -This file documents GDB/MI, a Machine Interface to GDB. +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI +@chapter The @sc{gdb/mi} Interface -Copyright (C) 2000, Free Software Foundation, Inc. -Contributed by Cygnus Solutions. +@unnumberedsec Function and Purpose -Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. +@cindex @sc{gdb/mi}, its purpose +@sc{gdb/mi} is a line based machine oriented text interface to GDB. It is +specifically intended to support the development of systems which use +the debugger as just one small component of a larger system. -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission notice -identical to this one except for the removal of this paragraph (this -paragraph not being relevant to the printed manual). +This chapter is a specification of the @sc{gdb/mi} interface. It is written +in the form of a reference manual. -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. -@end ifinfo - -@c This title page illustrates only one of the -@c two methods of forming a title page. - -@titlepage -@title GDB/MI -@subtitle Version 0.2 -@subtitle Feb 2000 -@author Andrew Cagney, Fernando Nasser and Elena Zannoni - -@c The following two commands -@c start the copyright page. -@page -@vskip 0pt plus 1filll -Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - -Copyright @copyright{} 2000, Free Software Foundation, Inc. -@end titlepage +Note that @sc{gdb/mi} is still under construction, so some of the +features described below are incomplete and subject to change. -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@chapter Overview +@unnumberedsec Notation and Terminology -@heading Function and Purpose +@cindex notational conventions, for @sc{gdb/mi} +This chapter uses the following notation: -GDB/MI is a line based machine oriented text interface to GDB. It is -specifically intended to support the development of systems which use -the debugger as just one small component of a larger system. +@itemize @bullet +@item +@code{|} separates two alternatives. + +@item +@code{[ @var{something} ]} indicates that @var{something} is optional: +it may or may not be given. -@heading This Document +@item +@code{( @var{group} )*} means that @var{group} inside the parentheses +may repeat zero or more times. -This document is a specification of the GDB/MI interface. It is written -in the form of a reference manual. +@item +@code{( @var{group} )+} means that @var{group} inside the parentheses +may repeat one or more times. -@heading Terminology +@item +@code{"@var{string}"} means a literal @var{string}. +@end itemize +@ignore @heading Dependencies +@end ignore @heading Acknowledgments -In alphabetic order: Fernando Nasser, Stan Shebs and Elena Zannoni. - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@chapter Command Syntax +In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and +Elena Zannoni. + +@menu +* GDB/MI Command Syntax:: +* GDB/MI Compatibility with CLI:: +* GDB/MI Output Records:: +* GDB/MI Command Description Format:: +* GDB/MI Breakpoint Table Commands:: +* GDB/MI Data Manipulation:: +* GDB/MI Program Control:: +* GDB/MI Miscellaneous Commands:: +* GDB/MI Stack Manipulation:: +* GDB/MI Symbol Query:: +* GDB/MI Target Manipulation:: +* GDB/MI Thread Commands:: +* GDB/MI Tracepoint Commands:: +* GDB/MI Variable Objects:: +* GDB/MI Draft Changes to Output Syntax:: +@end menu + +@c When these are implemented, they should be moved to be between Misc and +@c Stack Manipulation in the above menu. They are now outside the menu +@c because makeinfo 3.12 barfs if it sees @ignore or @comments in the +@c middle of a menu. +@ignore +* GDB/MI Kod Commands:: +* GDB/MI Memory Overlay Commands:: +* GDB/MI Signal Handling Commands:: +@end ignore -@section Input Syntax +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Command Syntax +@section @sc{gdb/mi} Command Syntax -@table @code +@menu +* GDB/MI Input Syntax:: +* GDB/MI Output Syntax:: +* GDB/MI Simple Examples:: +@end menu -@item @expansion{} - | +@node GDB/MI Input Syntax +@subsection @sc{gdb/mi} Input Syntax -@item @expansion{} -[ ] "any existing GDB CLI command" +@cindex input syntax for @sc{gdb/mi} +@cindex @sc{gdb/mi}, input syntax +@table @code +@item @var{command} @expansion{} +@code{@var{cli-command} | @var{mi-command}} -@item @expansion{} -[ ] ``-'' ( `` ''