summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--bfd/ChangeLog207
-rw-r--r--bfd/bfd-in.h4
-rw-r--r--bfd/bfd-in2.h4
-rw-r--r--bfd/cpu-arm.c2
-rw-r--r--bfd/elf-bfd.h92
-rw-r--r--bfd/elf-m10200.c6
-rw-r--r--bfd/elf-m10300.c10
-rw-r--r--bfd/elf.c16
-rw-r--r--bfd/elf32-arm.h4
-rw-r--r--bfd/elf32-h8300.c4
-rw-r--r--bfd/elf32-hppa.c6
-rw-r--r--bfd/elf32-i386.c23
-rw-r--r--bfd/elf32-ip2k.c12
-rw-r--r--bfd/elf32-iq2000.c18
-rw-r--r--bfd/elf32-m32r.c8
-rw-r--r--bfd/elf32-m68hc11.c2
-rw-r--r--bfd/elf32-m68hc1x.c6
-rw-r--r--bfd/elf32-m68k.c2
-rw-r--r--bfd/elf32-mips.c2
-rw-r--r--bfd/elf32-ppc.c36
-rw-r--r--bfd/elf32-s390.c94
-rw-r--r--bfd/elf32-sh.c6
-rw-r--r--bfd/elf32-v850.c4
-rw-r--r--bfd/elf32-xstormy16.c2
-rw-r--r--bfd/elf32-xtensa.c2
-rw-r--r--bfd/elf64-alpha.c6
-rw-r--r--bfd/elf64-hppa.c4
-rw-r--r--bfd/elf64-mips.c2
-rw-r--r--bfd/elf64-mmix.c12
-rw-r--r--bfd/elf64-ppc.c42
-rw-r--r--bfd/elf64-s390.c96
-rw-r--r--bfd/elf64-sh64.c2
-rw-r--r--bfd/elf64-sparc.c2
-rw-r--r--bfd/elf64-x86-64.c21
-rw-r--r--bfd/elfcode.h6
-rw-r--r--bfd/elflink.c2035
-rw-r--r--bfd/elflink.h2163
-rw-r--r--bfd/elfxx-ia64.c57
-rw-r--r--bfd/elfxx-mips.c38
-rw-r--r--bfd/version.h2
-rw-r--r--bfd/xtensa-isa.c2
-rw-r--r--bfd/xtensa-modules.c4
-rw-r--r--config-ml.in847
-rw-r--r--gdb/ChangeLog221
-rw-r--r--gdb/Makefile.in3
-rw-r--r--gdb/alpha-tdep.c10
-rw-r--r--gdb/alphafbsd-tdep.c2
-rw-r--r--gdb/arch-utils.c4
-rw-r--r--gdb/arm-linux-tdep.c21
-rw-r--r--gdb/arm-tdep.c44
-rw-r--r--gdb/avr-tdep.c8
-rw-r--r--gdb/breakpoint.c4
-rw-r--r--gdb/c-lang.c37
-rw-r--r--gdb/cli/cli-cmds.c5
-rw-r--r--gdb/cli/cli-cmds.h4
-rw-r--r--gdb/config/i386/nto.mt4
-rw-r--r--gdb/config/i386/tm-nto.h33
-rw-r--r--gdb/config/ia64/tm-ia64.h2
-rw-r--r--gdb/config/m68k/tm-vx68.h2
-rw-r--r--gdb/config/mips/tm-mips.h4
-rw-r--r--gdb/config/pa/nm-hppah.h7
-rw-r--r--gdb/config/pa/tm-hppa.h24
-rw-r--r--gdb/config/pa/tm-hppa64.h32
-rw-r--r--gdb/config/s390/tm-s390.h12
-rw-r--r--gdb/config/sparc/tm-sp64.h44
-rw-r--r--gdb/config/sparc/tm-sparc.h12
-rw-r--r--gdb/config/tm-nto.h61
-rw-r--r--gdb/configure.tgt4
-rw-r--r--gdb/cris-tdep.c76
-rw-r--r--gdb/d10v-tdep.c65
-rw-r--r--gdb/defs.h27
-rw-r--r--gdb/doc/ChangeLog29
-rw-r--r--gdb/doc/gdb.texinfo125
-rw-r--r--gdb/doc/gdbint.texinfo28
-rw-r--r--gdb/dummy-frame.c53
-rw-r--r--gdb/dummy-frame.h11
-rw-r--r--gdb/dve3900-rom.c2
-rw-r--r--gdb/dwarf2cfi.c2
-rw-r--r--gdb/dwarf2read.c10
-rw-r--r--gdb/findvar.c6
-rw-r--r--gdb/fork-child.c30
-rw-r--r--gdb/frame.c13
-rw-r--r--gdb/frame.h4
-rw-r--r--gdb/frv-tdep.c6
-rw-r--r--gdb/gdbarch.c301
-rw-r--r--gdb/gdbarch.h197
-rwxr-xr-xgdb/gdbarch.sh57
-rw-r--r--gdb/gdbcmd.h4
-rw-r--r--gdb/gdbthread.h3
-rw-r--r--gdb/h8300-tdep.c6
-rw-r--r--gdb/hppa-tdep.c114
-rw-r--r--gdb/hppab-nat.c2
-rw-r--r--gdb/hppah-nat.c2
-rw-r--r--gdb/hpux-thread.c4
-rw-r--r--gdb/i386-nto-tdep.c298
-rw-r--r--gdb/i386-tdep.c10
-rw-r--r--gdb/ia64-tdep.c14
-rw-r--r--gdb/infcall.c54
-rw-r--r--gdb/infcmd.c4
-rw-r--r--gdb/inferior.h15
-rw-r--r--gdb/infptrace.c4
-rw-r--r--gdb/infrun.c95
-rw-r--r--gdb/irix4-nat.c8
-rw-r--r--gdb/lynx-nat.c4
-rw-r--r--gdb/m68hc11-tdep.c7
-rw-r--r--gdb/m68k-tdep.c18
-rw-r--r--gdb/m68klinux-nat.c4
-rw-r--r--gdb/maint.c25
-rw-r--r--gdb/mcore-tdep.c39
-rw-r--r--gdb/mi/ChangeLog14
-rw-r--r--gdb/mi/mi-main.c10
-rw-r--r--gdb/mips-linux-tdep.c18
-rw-r--r--gdb/mips-nat.c10
-rw-r--r--gdb/mips-tdep.c60
-rw-r--r--gdb/mipsv4-nat.c8
-rw-r--r--gdb/mn10300-tdep.c18
-rw-r--r--gdb/monitor.c8
-rw-r--r--gdb/ns32k-tdep.c12
-rw-r--r--gdb/nto-tdep.c342
-rw-r--r--gdb/nto-tdep.h156
-rw-r--r--gdb/ppc-linux-nat.c4
-rw-r--r--gdb/regcache.c105
-rw-r--r--gdb/regcache.h10
-rw-r--r--gdb/remote-array.c2
-rw-r--r--gdb/remote-e7000.c2
-rw-r--r--gdb/remote-mips.c4
-rw-r--r--gdb/remote-rdp.c2
-rw-r--r--gdb/remote-sim.c10
-rw-r--r--gdb/remote.c11
-rw-r--r--gdb/rom68k-rom.c2
-rw-r--r--gdb/rs6000-nat.c4
-rw-r--r--gdb/rs6000-tdep.c10
-rw-r--r--gdb/s390-tdep.c11
-rw-r--r--gdb/sentinel-frame.c2
-rw-r--r--gdb/sh-tdep.c22
-rw-r--r--gdb/sol-thread.c6
-rw-r--r--gdb/sparc-tdep.c64
-rw-r--r--gdb/stack.c2
-rw-r--r--gdb/symmisc.c8
-rw-r--r--gdb/symtab.h4
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/testsuite/ChangeLog25
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp110
-rw-r--r--gdb/testsuite/gdb.asm/s390x.inc68
-rw-r--r--gdb/testsuite/gdb.base/maint.exp7
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp4
-rw-r--r--gdb/testsuite/gdb.threads/schedlock.exp14
-rw-r--r--gdb/thread-db.c2
-rw-r--r--gdb/thread.c4
-rw-r--r--gdb/tracepoint.c2
-rw-r--r--gdb/tui/ChangeLog5
-rw-r--r--gdb/tui/tuiRegs.c6
-rw-r--r--gdb/v850-tdep.c8
-rw-r--r--gdb/valops.c9
-rw-r--r--gdb/vax-tdep.c11
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/x86-64-tdep.c2
-rw-r--r--gdb/xstormy16-tdep.c6
-rw-r--r--include/ChangeLog10
-rw-r--r--include/gdb/ChangeLog6
-rw-r--r--include/gdb/sim-d10v.h11
-rw-r--r--include/hashtab.h5
-rw-r--r--include/xtensa-isa-internal.h2
-rw-r--r--libiberty/ChangeLog17
-rw-r--r--libiberty/aclocal.m42
-rw-r--r--libiberty/config.in10
-rwxr-xr-xlibiberty/configure756
-rw-r--r--libiberty/configure.in19
-rw-r--r--libiberty/hashtab.c138
-rw-r--r--libiberty/splay-tree.c4
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/i386-dis.c2
-rw-r--r--sim/d10v/ChangeLog12
-rw-r--r--sim/d10v/interp.c42
175 files changed, 3962 insertions, 6606 deletions
diff --git a/ChangeLog b/ChangeLog
index 787355cc717..b3c433922cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,3 @@
-2003-05-05 H.J. Lu <hjl@gnu.org>
-
- * config-ml.in: Restored from gcc repository.
-
2003-05-02 Chris Demetriou <cgd@broadcom.com>
* Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0cf4ea341ad..02ec3136cd6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,210 +1,3 @@
-2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
- Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
- (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
- * elf64-s390.c: Likewise.
-
-2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
- (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
- ELF_LINK_NON_GOT_REF from weakdef.
- (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
- already been adjusted before treating it specially.
- * el64-s390.c: Likwise.
-
-2003-05-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
- non-default visibility, a) don't make them dynamic, b) discard
- space for dynamic relocs.
- (elf_s390_relocate_section): Initialize the GOT entries and skip
- R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
- symbols with non-default visibility.
- * elf64-s390.c: Likewise.
-
-2003-05-09 Alan Modra <amodra@bigpond.net.au>
-
- * cpu-arm.c (arm_check_note): Warning fix.
- * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange
- to keep relocs if edited.
- (iq2000_elf_print_private_bfd_data): Return TRUE.
- * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
- ELF64_R_SYM.
- (elfNN_ia64_relax_ldxmov): Warning fix.
- * xtensa-isa.c (xtensa_add_isa): Warning fix.
- * xtensa-modules.c (get_num_opcodes): Warning fix.
-
-2003-05-09 Andrey Petrov <petrov@netbsd.org>
-
- * elf.c (elf_fake_sections): Use correct cast for sh_name.
-
-2003-05-09 Alan Modra <amodra@bigpond.net.au>
-
- * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
- elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align.
- (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
- (bfd_elf_record_link_assignment): Move from elflink.h.
- (_bfd_elf_merge_symbol): Likewise.
- (_bfd_elf_add_default_symbol): Likewise.
- (_bfd_elf_export_symbol): Likewise.
- (_bfd_elf_link_find_version_dependencies): Likewise.
- (_bfd_elf_link_assign_sym_version): Likewise.
- (_bfd_elf_link_read_relocs): Likewise.
- (_bfd_elf_link_size_reloc_section): Likewise.
- (_bfd_elf_fix_symbol_flags): Likewise.
- (_bfd_elf_adjust_dynamic_symbol): Likewise.
- (_bfd_elf_link_sec_merge_syms): Likewise.
- (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel
- and bed->s->sizeof_rela.
- (_bfd_elf_link_output_relocs): Likewise.
- * elf-bfd.h (struct elf_size_info): Rename file_align to
- log_file_align.
- (struct elf_info_failed): Move from elflink.h.
- (struct elf_assign_sym_version_info): Likewise.
- (struct elf_find_verdep_info): Likewise.
- (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
- (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
- _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
- _bfd_elf_link_assign_sym_version,
- _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
- _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
- _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
- _bfd_elf_link_sec_merge_syms): Declare.
- (bfd_elf32_link_create_dynamic_sections): Don't declare.
- (_bfd_elf32_link_read_relocs): Likewise.
- (bfd_elf64_link_create_dynamic_sections): Likewise.
- (_bfd_elf64_link_read_relocs): Likewise.
- * elflink.h: Move lots o' stuff elsewhere.
- * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
- (bfd_elf64_record_link_assignment): Likewise.
- (bfd_elf_record_link_assignment): Declare.
- * bfd-in2.h: Regenerate.
- * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
- (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
- * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
- (assign_file_positions_for_segments): Likewise.
- (assign_file_positions_except_relocs): Likewise.
- (swap_out_syms, elfcore_write_note): Likewise.
- * elf-m10200.c: Adjust for changed function names.
- * elf-m10300.c: Likewise.
- * elf32-arm.h: Likewise.
- * elf32-h8300.c: Likewise.
- * elf32-hppa.c: Likewise.
- * elf32-ip2k.c: Likewise.
- * elf32-m32r.c: Likewise.
- * elf32-m68hc11.c: Likewise.
- * elf32-m68hc1x.c: Likewise.
- * elf32-m68k.c: Likewise.
- * elf32-mips.c: Likewise.
- * elf32-ppc.c: Likewise.
- * elf32-sh.c: Likewise.
- * elf32-v850.c: Likewise.
- * elf32-xtensa.c: Likewise.
- * elf64-alpha.c: Likewise.
- * elf64-hppa.c: Likewise.
- * elf64-mmix.c: Likewise.
- * elf64-ppc.c: Likewise.
- * elf64-sh64.c: Likewise.
- * elfxx-ia64.c: Likewise.
- * elfxx-mips.c: Likewise.
- (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
- * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
- * elf64-hppa.c (hppa64_elf_size_info): Likewise.
- * elf64-mips.c (mips_elf64_size_info): Likewise.
- * elf64-s390.c (s390_elf64_size_info): Likewise.
- * elf64-sparc.c (sparc64_elf_size_info): Likewise.
-
-2003-05-08 H.J. Lu <hongjiu.lu@intel.com>
-
- * elflink.h (elf_add_default_symbol): After skipping the
- unversioned symbol, go to non-default one.
-
-2003-05-07 H.J. Lu <hongjiu.lu@intel.com>
-
- * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
- want_plt field.
- (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
- for symbols with non-default visibility.
-
-2003-05-07 H.J. Lu <hongjiu.lu@intel.com>
-
- * elflink.h (elf_link_check_versioned_symbol): Also handle the
- case that a DSO references a hidden symbol which may be
- satisfied by a versioned symbol in another DSO.
- (elf_link_output_extsym): Check versioned definition for hidden
- symbol referenced by a DSO.
-
-2003-05-07 Nick Clifton <nickc@redhat.com>
-
- * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
- R_XSTORMY16_16 reloc to ignore overflows.
-
-2003-05-06 Alexandre Oliva <aoliva@redhat.com>
-
- * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
- error message for mixing different-endian files. Check for ABI
- compatibility of input files with the selected emulation.
-
-2003-05-05 Alan Modra <amodra@bigpond.net.au>
-
- * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
- non-default visibility, a) don't make them dynamic, b) discard
- space for dynamic relocs.
- * elf64-x86-64.c (allocate_dynrelocs): Likewise.
-
- * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
- non-default visibility, a) don't allocate plt entries, b) don't
- allocate .got relocs, c) discard dyn rel space,
- (ppc_elf_relocate_section): d) don't generate .got relocs, e)
- don't generate dynamic relocs.
- * elf64-ppc.c (allocate_dynrelocs): As above.
- (ppc64_elf_relocate_section): As above.
-
-2003-05-05 Andreas Jaeger <aj@suse.de>
-
- * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
- relocation entries for weak undefined symbols with non-default
- visibility.
- (elf64_x86_64_relocate_section): Initialize the GOT entries and
- skip R_386_32/R_386_PC32 for weak undefined symbols with
- non-default visibility.
-
-2003-05-04 H.J. Lu <hjl@gnu.org>
-
- * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
- relocation entries for weak undefined symbols with non-default
- visibility.
- (elf_i386_relocate_section): Initialize the GOT entries and
- skip R_386_32/R_386_PC32 for weak undefined symbols with
- non-default visibility.
-
- * elfxx-ia64.c (allocate_fptr): Don't allocate function
- descriptors for weak undefined symbols with non-default
- visibility.
- (allocate_dynrel_entries): Don't allocate relocation entries
- for symbols resolved to 0.
- (set_got_entry): Don't install dynamic relocation for weak
- undefined symbols with non-default visibility.
- (set_pltoff_entry): Likewise.
-
- * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
- with non-default visibility.
- (elf_link_output_extsym): Don't make weak undefined symbols
- with non-default visibility dynamic.
-
-2003-05-04 H.J. Lu <hjl@gnu.org>
-
- * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
-
-2003-05-04 H.J. Lu <hjl@gnu.org>
-
- * elflink.h (elf_merge_symbol): Don't record a hidden/internal
- symbol dynamic. Check indirection when removing the old
- definition for symbols with non-default visibility.
- (elf_add_default_symbol): Skip when told by elf_merge_symbol.
-
2003-05-02 Nick Clifton <nickc@redhat.com>
* elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 93fd0fd13b3..c39bfedd59f 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -651,7 +651,9 @@ struct bfd_link_needed_list
const char *name;
};
-extern bfd_boolean bfd_elf_record_link_assignment
+extern bfd_boolean bfd_elf32_record_link_assignment
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
+extern bfd_boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 637376bc0dd..9b6b5a39370 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -658,7 +658,9 @@ struct bfd_link_needed_list
const char *name;
};
-extern bfd_boolean bfd_elf_record_link_assignment
+extern bfd_boolean bfd_elf32_record_link_assignment
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
+extern bfd_boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 9ef527cb943..66c3a466523 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -260,7 +260,7 @@ arm_check_note (abfd, buffer, buffer_size, expected_name, description_return)
}
else
{
- if (namesz != ((strlen (expected_name) + 1 + 3) & ~3))
+ if (namesz != (strlen (expected_name) + 1 + 3) & ~3)
return FALSE;
if (strcmp (descr, expected_name) != 0)
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 073aee8a179..f15353ce2d6 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -428,7 +428,7 @@ struct elf_size_info {
handle all back-ends. */
#define MAX_INT_RELS_PER_EXT_REL 3
- unsigned char arch_size, log_file_align;
+ unsigned char arch_size, file_align;
unsigned char elfclass, ev_current;
int (*write_out_phdrs)
PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
@@ -1052,46 +1052,6 @@ typedef struct elf_linker_section_pointers
bfd_boolean written_address_p; /* whether address was written yet */
} elf_linker_section_pointers_t;
-/* This struct is used to pass information to routines called via
- elf_link_hash_traverse which must return failure. */
-
-struct elf_info_failed
-{
- bfd_boolean failed;
- struct bfd_link_info *info;
- struct bfd_elf_version_tree *verdefs;
-};
-
-/* This structure is used to pass information to
- _bfd_elf_link_assign_sym_version. */
-
-struct elf_assign_sym_version_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* Version tree. */
- struct bfd_elf_version_tree *verdefs;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
-/* This structure is used to pass information to
- _bfd_elf_link_find_version_dependencies. */
-
-struct elf_find_verdep_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* The number of dependencies. */
- unsigned int vers;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
@@ -1435,6 +1395,8 @@ extern asection *bfd_section_from_r_symndx
PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
extern asection *bfd_section_from_elf_index
PARAMS ((bfd *, unsigned int));
+extern bfd_boolean _bfd_elf_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
PARAMS ((void));
@@ -1473,26 +1435,6 @@ extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
PARAMS ((struct bfd_link_info *));
-extern bfd_boolean _bfd_elf_merge_symbol
- PARAMS ((bfd *, struct bfd_link_info *, const char *,
- Elf_Internal_Sym *, asection **, bfd_vma *,
- struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *,
- bfd_boolean *, bfd_boolean *, bfd_boolean));
-
-extern bfd_boolean _bfd_elf_add_default_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
- bfd_boolean *, bfd_boolean, bfd_boolean));
-
-extern bfd_boolean _bfd_elf_export_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-extern bfd_boolean _bfd_elf_link_find_version_dependencies
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-extern bfd_boolean _bfd_elf_link_assign_sym_version
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
extern bfd_boolean _bfd_elf_link_record_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
extern long _bfd_elf_link_lookup_local_dynindx
@@ -1507,8 +1449,6 @@ extern file_ptr _bfd_elf_assign_file_position_for_section
extern bfd_boolean _bfd_elf_validate_reloc
PARAMS ((bfd *, arelent *));
-extern bfd_boolean _bfd_elf_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
extern bfd_boolean _bfd_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
extern bfd_boolean _bfd_elf_create_got_section
@@ -1550,24 +1490,6 @@ extern bfd_vma bfd_elf64_finish_pointer_linker_section
extern bfd_boolean _bfd_elf_make_linker_section_rela
PARAMS ((bfd *, elf_linker_section_t *, int));
-extern Elf_Internal_Rela *_bfd_elf_link_read_relocs
- PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
-
-extern bfd_boolean _bfd_elf_link_size_reloc_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
-
-extern bfd_boolean _bfd_elf_link_output_relocs
- PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
-
-extern bfd_boolean _bfd_elf_fix_symbol_flags
- PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
-
-extern bfd_boolean _bfd_elf_adjust_dynamic_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-extern bfd_boolean _bfd_elf_link_sec_merge_syms
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
extern const bfd_target *bfd_elf32_object_p
PARAMS ((bfd *));
extern const bfd_target *bfd_elf32_core_file_p
@@ -1616,6 +1538,10 @@ extern bfd_boolean bfd_elf32_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
extern bfd_boolean bfd_elf32_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
+extern bfd_boolean bfd_elf32_link_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs
+ PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
extern const bfd_target *bfd_elf64_object_p
PARAMS ((bfd *));
@@ -1664,6 +1590,10 @@ extern bfd_boolean bfd_elf64_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
extern bfd_boolean bfd_elf64_add_dynamic_entry
PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
+extern bfd_boolean bfd_elf64_link_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
+ PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
#define bfd_elf32_link_record_dynamic_symbol \
_bfd_elf_link_record_dynamic_symbol
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index c35adcba81c..f5f27894c03 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -1,5 +1,5 @@
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -529,7 +529,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1342,7 +1342,7 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
asection **secpp;
bfd_size_type amt;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index cad2b9c7b8c..2f0cd905700 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -1,5 +1,5 @@
/* Matsushita 10300 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -859,7 +859,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
{
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, section, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
link_info->keep_memory));
@@ -1125,7 +1125,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (section->reloc_count != 0)
{
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, section, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
link_info->keep_memory));
@@ -1351,7 +1351,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -2577,7 +2577,7 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf.c b/bfd/elf.c
index 737f4954711..72fe61c4a3c 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2335,7 +2335,7 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
rel_hdr->sh_entsize = (use_rela_p
? bed->s->sizeof_rela
: bed->s->sizeof_rel);
- rel_hdr->sh_addralign = 1 << bed->s->log_file_align;
+ rel_hdr->sh_addralign = bed->s->file_align;
rel_hdr->sh_flags = 0;
rel_hdr->sh_addr = 0;
rel_hdr->sh_size = 0;
@@ -2365,9 +2365,9 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr = &elf_section_data (asect)->this_hdr;
- this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd),
- asect->name, FALSE);
- if (this_hdr->sh_name == (unsigned int) -1)
+ this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd),
+ asect->name, FALSE);
+ if (this_hdr->sh_name == (unsigned long) -1)
{
*failedptr = TRUE;
return;
@@ -3748,7 +3748,7 @@ assign_file_positions_for_segments (abfd)
&& (abfd->flags & D_PAGED) != 0)
p->p_align = bed->maxpagesize;
else if (m->count == 0)
- p->p_align = 1 << bed->s->log_file_align;
+ p->p_align = bed->s->file_align;
else
p->p_align = 0;
@@ -4245,7 +4245,7 @@ assign_file_positions_except_relocs (abfd)
}
/* Place the section headers. */
- off = align_file_position (off, 1 << bed->s->log_file_align);
+ off = align_file_position (off, bed->s->file_align);
i_ehdrp->e_shoff = off;
off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize;
@@ -5302,7 +5302,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
symtab_hdr->sh_entsize = bed->s->sizeof_sym;
symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1);
symtab_hdr->sh_info = elf_num_locals (abfd) + 1;
- symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
+ symtab_hdr->sh_addralign = bed->s->file_align;
symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
symstrtab_hdr->sh_type = SHT_STRTAB;
@@ -7125,7 +7125,7 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size)
namesz = strlen (name) + 1;
bed = get_elf_backend_data (abfd);
- pad = -namesz & ((1 << bed->s->log_file_align) - 1);
+ pad = -namesz & (bed->s->file_align - 1);
}
newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size;
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index ba286b1237d..631b2b9e530 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -679,8 +679,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
/* Load the relocs. */
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL, FALSE);
+ = _bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL, FALSE);
if (internal_relocs == NULL)
goto error_return;
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 30db68f2119..e43ed9d2ed3 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -709,7 +709,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1394,7 +1394,7 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index becfb73c873..b204c57df46 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -2950,9 +2950,9 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
/* Get the relocs. */
internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf32_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 320e9859839..060d66c20ce 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1558,9 +1558,7 @@ allocate_dynrelocs (h, inf)
htab = elf_i386_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1658,10 +1656,8 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
- && (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+ else if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
}
else
@@ -1695,12 +1691,6 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -2308,9 +2298,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
- || (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2434,9 +2422,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& (r_type != R_386_PC32
|| (h != NULL
&& h->dynindx != -1
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index e10e9410ac6..cd2b970daad 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -847,9 +847,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL,
- (Elf_Internal_Rela *)NULL,
- link_info->keep_memory);
+ internal_relocs = _bfd_elf32_link_read_relocs (abfd, sec, NULL,
+ (Elf_Internal_Rela *)NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
@@ -861,9 +861,9 @@ ip2k_elf_relax_section (abfd, sec, link_info, again)
/* So stab does exits. */
Elf_Internal_Rela * irelbase;
- irelbase = _bfd_elf_link_read_relocs (abfd, stab, NULL,
- (Elf_Internal_Rela *)NULL,
- link_info->keep_memory);
+ irelbase = _bfd_elf32_link_read_relocs (abfd, stab, NULL,
+ (Elf_Internal_Rela *)NULL,
+ link_info->keep_memory);
}
/* Get section contents cached copy if it exists. */
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index ebdd30300ff..c4261bf7492 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -454,9 +454,8 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
- const Elf_Internal_Rela *rel;
- const Elf_Internal_Rela *rel_end;
- bfd_boolean changed = FALSE;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *rel_end;
if (info->relocateable)
return TRUE;
@@ -500,20 +499,10 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
if (memcmp (sec->name, ".debug", 6) == 0
|| memcmp (sec->name, ".stab", 5) == 0
|| memcmp (sec->name, ".eh_frame", 9) == 0)
- {
- ((Elf_Internal_Rela *) rel)->r_info
- = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
- changed = TRUE;
- }
+ rel->r_info = ELF32_R_INFO (ELF32_R_SYM (rel->r_info), R_IQ2000_32_DEBUG);
break;
}
}
-
- if (changed)
- /* Note that we've changed relocs, otherwise if !info->keep_memory
- we'll free the relocs and lose our changes. */
- (const Elf_Internal_Rela *) (elf_section_data (sec)->relocs) = relocs;
-
return TRUE;
}
@@ -940,7 +929,6 @@ iq2000_elf_print_private_bfd_data (abfd, ptr)
}
fputc ('\n', file);
- return TRUE;
}
static
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 3116ace867a..b53f50a89af 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -1,5 +1,5 @@
/* M32R-specific support for 32-bit ELF.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1340,7 +1340,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
{
Elf_Internal_Shdr *symtab_hdr;
/* The Rela structures are used here because that's what
- _bfd_elf_link_read_relocs uses [for convenience - it sets the addend
+ _bfd_elf32_link_read_relocs uses [for convenience - it sets the addend
field to 0]. */
Elf_Internal_Rela *internal_relocs = NULL;
Elf_Internal_Rela *irel, *irelend;
@@ -1368,7 +1368,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -1781,7 +1781,7 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
asection **secpp;
Elf32_External_Sym *esym, *esymend;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index 1b95105299d..bb0f9e974c2 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -705,7 +705,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 3c2ff6118f5..0696a364251 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -476,9 +476,9 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
/* Get the relocs. */
internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf32_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index e314ebb4b94..abb0eece334 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -2188,7 +2188,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 85819d55d3d..adf057b40d2 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1716,7 +1716,7 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
}
/* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 64c2839f421..69bb0d676e0 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -1735,9 +1735,9 @@ ppc_elf_relax_section (abfd, isec, link_info, again)
/* Get a copy of the native relocations. */
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, isec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
+ = _bfd_elf32_link_read_relocs (abfd, isec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
if (! link_info->keep_memory)
@@ -2694,9 +2694,7 @@ allocate_dynrelocs (h, inf)
htab = ppc_elf_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1
@@ -2791,10 +2789,8 @@ allocate_dynrelocs (h, inf)
else
htab->got->_raw_size += 4;
dyn = htab->elf.dynamic_sections_created;
- if ((info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
- && (ELF_ST_VISIBILITY (eh->elf.other) == STV_DEFAULT
- || eh->elf.root.type != bfd_link_hash_undefweak))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
{
/* All the entries we allocated need relocs. */
htab->relgot->_raw_size
@@ -2835,12 +2831,6 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -3860,9 +3850,9 @@ ppc_elf_tls_optimize (obfd, info)
int expecting_tls_get_addr;
/* Read the relocations. */
- relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf32_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -4803,10 +4793,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
/* Generate relocs for the dynamic linker. */
- if ((info->shared || indx != 0)
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ if (info->shared || indx != 0)
{
outrel.r_offset = (htab->got->output_section->vma
+ htab->got->output_offset
@@ -5008,9 +4995,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Fall thru. */
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
&& h->dynindx != -1
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 9475f60a669..857b7a068b3 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -383,12 +383,6 @@ elf_s390_is_local_label_name (abfd, name)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
-/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
- copying dynamic variables from a shared lib into an app's dynbss
- section, and instead use a dynamic relocation to point into the
- shared lib. */
-#define ELIMINATE_COPY_RELOCS 1
-
/* The size in bytes of the first entry in the procedure linkage table. */
#define PLT_FIRST_ENTRY_SIZE 32
/* The size in bytes of an entry in the procedure linkage table. */
@@ -834,18 +828,7 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
eind->tls_type = GOT_UNKNOWN;
}
- if (ELIMINATE_COPY_RELOCS
- && ind->root.type != bfd_link_hash_indirect
- && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
- /* If called to transfer flags for a weakdef during processing
- of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
- We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- dir->elf_link_hash_flags |=
- (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
- else
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static int
@@ -1166,8 +1149,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (ELIMINATE_COPY_RELOCS
- && !info->shared
+ || (!info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1498,6 +1480,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf_s390_link_hash_table *htab;
+ struct elf_s390_link_hash_entry * eh;
+ struct elf_s390_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1543,10 +1527,6 @@ elf_s390_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
- if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
- h->elf_link_hash_flags
- = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
- | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1572,26 +1552,20 @@ elf_s390_adjust_dynamic_symbol (info, h)
return TRUE;
}
- if (ELIMINATE_COPY_RELOCS)
+ eh = (struct elf_s390_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
- struct elf_s390_link_hash_entry * eh;
- struct elf_s390_dyn_relocs *p;
-
- eh = (struct elf_s390_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
- {
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
- }
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1644,9 +1618,9 @@ elf_s390_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in elf_s390_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
((DYN) \
- && ((SHARED) \
+ && ((INFO)->shared \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -1677,9 +1651,7 @@ allocate_dynrelocs (h, inf)
htab = elf_s390_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1690,8 +1662,7 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
{
asection *s = htab->splt;
@@ -1787,10 +1758,7 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
- && (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+ else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
}
else
@@ -1824,14 +1792,8 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
- else if (ELIMINATE_COPY_RELOCS)
+ else
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -2339,14 +2301,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
- || (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2511,9 +2471,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32DBL
@@ -2523,8 +2480,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (ELIMINATE_COPY_RELOCS
- && !info->shared
+ || (!info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 8041f5e4c02..35a4ddac863 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -2054,7 +2054,7 @@ sh_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -2736,7 +2736,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count)
/* We always cache the relocs. Perhaps, if info->keep_memory is
FALSE, we should free them, if we are permitted to, when we
leave sh_coff_relax_section. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL,
TRUE));
if (internal_relocs == NULL)
@@ -5735,7 +5735,7 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
Elf_Internal_Sym *isym, *isymend;
bfd_size_type amt;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 62bbbdacf21..26201f5e8ec 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1,5 +1,5 @@
/* V850-specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -2508,7 +2508,7 @@ v850_elf_relax_section (abfd, sec, link_info, again)
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index 2964d343cb3..d06f8b29a99 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -96,7 +96,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] =
16, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_unsigned, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_XSTORMY16_16", /* name */
FALSE, /* partial_inplace */
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index b277540107c..b991df4f792 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -3925,7 +3925,7 @@ retrieve_internal_relocs (abfd, sec, keep_memory)
internal_relocs = elf_section_data (sec)->relocs;
if (internal_relocs == NULL)
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf32_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
keep_memory));
return internal_relocs;
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 9ce3bf3b56a..4a2658abe1f 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -1556,7 +1556,7 @@ elf64_alpha_relax_opt_call (info, symval)
}
else
{
- tsec_relocs = (_bfd_elf_link_read_relocs
+ tsec_relocs = (_bfd_elf64_link_read_relocs
(info->abfd, info->tsec, (PTR) NULL,
(Elf_Internal_Rela *) NULL,
info->link_info->keep_memory));
@@ -2072,7 +2072,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
local_got_entries = alpha_elf_tdata(abfd)->local_got_entries;
/* Load the relocations for this section. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf64_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -5556,7 +5556,7 @@ static const struct elf_size_info alpha_elf_size_info =
sizeof (Elf_External_Note),
8,
1,
- 64, 3,
+ 64, 8,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 8ce5b20f3f7..4d3b8d40a7a 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -606,7 +606,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
the special sections required for dynamic linking. */
if (! elf_hash_table (info)->dynamic_sections_created)
{
- if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+ if (! bfd_elf64_link_create_dynamic_sections (abfd, info))
return FALSE;
}
@@ -2692,7 +2692,7 @@ const struct elf_size_info hppa64_elf_size_info =
sizeof (Elf_External_Note),
4,
1,
- 64, 3,
+ 64, 8,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 6e7321cacc6..39f21b3046d 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2782,7 +2782,7 @@ const struct elf_size_info mips_elf64_size_info =
4, /* hash-table entry size */
3, /* internal relocations per external relocations */
64, /* arch_size */
- 3, /* log_file_align */
+ 8, /* file_align */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index d0213e6a493..bcf99626571 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1854,9 +1854,9 @@ _bfd_mmix_check_all_relocs (abfd, info)
continue;
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf64_link_read_relocs (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
return FALSE;
@@ -2374,9 +2374,9 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
/* Get a copy of the native relocations. */
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
+ = _bfd_elf64_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 011e637b122..1e7a498dab3 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4873,9 +4873,9 @@ ppc64_elf_edit_opd (obfd, info)
sym_hashes = elf_sym_hashes (ibfd);
/* Read the relocations. */
- relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -5196,9 +5196,9 @@ ppc64_elf_tls_optimize (obfd, info)
int expecting_tls_get_addr;
/* Read the relocations. */
- relstart = _bfd_elf_link_read_relocs (ibfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = _bfd_elf64_link_read_relocs (ibfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (relstart == NULL)
return FALSE;
@@ -5497,9 +5497,7 @@ allocate_dynrelocs (h, inf)
if (htab->elf.dynamic_sections_created
&& h->dynindx != -1
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
{
struct plt_entry *pent;
bfd_boolean doneone = FALSE;
@@ -5599,10 +5597,8 @@ allocate_dynrelocs (h, inf)
s->_raw_size
+= (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8;
dyn = htab->elf.dynamic_sections_created;
- if ((info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ if (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
htab->srelgot->_raw_size
+= (gent->tls_type & eh->tls_mask & TLS_GD
? 2 * sizeof (Elf64_External_Rela)
@@ -5638,12 +5634,6 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -6594,9 +6584,9 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size,
/* Get the relocs. */
internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ = _bfd_elf64_link_read_relocs (input_bfd, section, NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
@@ -7650,10 +7640,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
the case of TLSLD where we'll use one entry per
module. */
*offp = off | 1;
- if ((info->shared || indx != 0)
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ if (info->shared || indx != 0)
{
outrel.r_offset = (htab->sgot->output_section->vma
+ htab->sgot->output_offset
@@ -7877,9 +7864,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
&& h->dynindx != -1
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 98555f269bf..e3c7f22103a 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -405,12 +405,6 @@ elf_s390_is_local_label_name (abfd, name)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
-/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
- copying dynamic variables from a shared lib into an app's dynbss
- section, and instead use a dynamic relocation to point into the
- shared lib. */
-#define ELIMINATE_COPY_RELOCS 1
-
/* The size in bytes of the first entry in the procedure linkage table. */
#define PLT_FIRST_ENTRY_SIZE 32
/* The size in bytes of an entry in the procedure linkage table. */
@@ -788,18 +782,7 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
eind->tls_type = GOT_UNKNOWN;
}
- if (ELIMINATE_COPY_RELOCS
- && ind->root.type != bfd_link_hash_indirect
- && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
- /* If called to transfer flags for a weakdef during processing
- of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
- We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- dir->elf_link_hash_flags |=
- (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
- else
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
static int
@@ -1131,8 +1114,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|| h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (ELIMINATE_COPY_RELOCS
- && !info->shared
+ || (!info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1470,6 +1452,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
struct elf_link_hash_entry *h;
{
struct elf_s390_link_hash_table *htab;
+ struct elf_s390_link_hash_entry * eh;
+ struct elf_s390_dyn_relocs *p;
asection *s;
unsigned int power_of_two;
@@ -1515,10 +1499,6 @@ elf_s390_adjust_dynamic_symbol (info, h)
|| h->weakdef->root.type == bfd_link_hash_defweak);
h->root.u.def.section = h->weakdef->root.u.def.section;
h->root.u.def.value = h->weakdef->root.u.def.value;
- if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
- h->elf_link_hash_flags
- = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
- | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
return TRUE;
}
@@ -1544,26 +1524,20 @@ elf_s390_adjust_dynamic_symbol (info, h)
return TRUE;
}
- if (ELIMINATE_COPY_RELOCS)
+ eh = (struct elf_s390_link_hash_entry *) h;
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
- struct elf_s390_link_hash_entry * eh;
- struct elf_s390_dyn_relocs *p;
-
- eh = (struct elf_s390_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
- {
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
+ s = p->sec->output_section;
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
+ break;
+ }
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
- return TRUE;
- }
+ /* If we didn't find any dynamic relocs in read-only sections, then
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
+ if (p == NULL)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ return TRUE;
}
/* We must allocate the symbol in our .dynbss section, which will
@@ -1616,9 +1590,9 @@ elf_s390_adjust_dynamic_symbol (info, h)
will be called from elflink.h. If elflink.h doesn't call our
finish_dynamic_symbol routine, we'll need to do something about
initializing any .plt and .got entries in elf_s390_relocate_section. */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
((DYN) \
- && ((SHARED) \
+ && ((INFO)->shared \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
&& ((H)->dynindx != -1 \
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
@@ -1649,9 +1623,7 @@ allocate_dynrelocs (h, inf)
htab = elf_s390_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1662,8 +1634,7 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
{
asection *s = htab->splt;
@@ -1759,10 +1730,7 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
- && (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+ else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
else
@@ -1796,14 +1764,8 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
- else if (ELIMINATE_COPY_RELOCS)
+ else
{
/* For the non-shared case, discard space for relocs against
symbols which turn out to need copy relocs or are not
@@ -2312,14 +2274,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
off = h->got.offset;
dyn = htab->elf.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
- || (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2489,9 +2449,6 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32
@@ -2502,8 +2459,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& (! info->symbolic
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
- || (ELIMINATE_COPY_RELOCS
- && !info->shared
+ || (!info->shared
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
@@ -3315,7 +3271,7 @@ const struct elf_size_info s390_elf64_size_info =
8, /* hash-table entry size. */
1, /* internal relocations per external relocations. */
64, /* arch_size. */
- 3, /* log_file_align. */
+ 8, /* file_align. */
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index d666fca9cbe..122490e92e8 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -2226,7 +2226,7 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order,
goto error_return;
}
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elf64_link_read_relocs
(input_bfd, input_section, (PTR) NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index d7ad1b725de..bca09b73cef 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -3170,7 +3170,7 @@ const struct elf_size_info sparc64_elf_size_info =
we use 2. */
1,
64, /* arch_size. */
- 3, /* log_file_align. */
+ 8, /* file_align. */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index c0ce57d708d..5ed6b518dbe 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1385,9 +1385,7 @@ allocate_dynrelocs (h, inf)
htab = elf64_x86_64_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1480,9 +1478,7 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+ else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
else
@@ -1516,12 +1512,6 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
-
- /* Also discard relocs on undefined weak syms with non-default
- visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{
@@ -1986,9 +1976,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
- || (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a -Bsymbolic
link and the symbol is defined locally, or the symbol
@@ -2107,9 +2095,6 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_X86_64_PC8
&& r_type != R_X86_64_PC16
&& r_type != R_X86_64_PC32)
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 0be8048a041..2a6f6bf20a4 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -121,6 +121,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs)
#define elf_write_relocs NAME(bfd_elf,write_relocs)
#define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table)
+#define elf_link_create_dynamic_sections \
+ NAME(bfd_elf,link_create_dynamic_sections)
#define elf_bfd_discard_info NAME(bfd_elf,discard_info)
#define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p)
#define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
@@ -1583,7 +1585,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
sizeof (Elf_External_Note),
4,
1,
- ARCH_SIZE, LOG_FILE_ALIGN,
+ ARCH_SIZE, FILE_ALIGN,
ELFCLASS, EV_CURRENT,
elf_write_out_phdrs,
elf_write_shdrs_and_ehdr,
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 05194591b4a..962c1044115 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -25,9 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ARCH_SIZE 0
#include "elf-bfd.h"
-static bfd_boolean elf_link_read_relocs_from_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
-
bfd_boolean
_bfd_elf_create_got_section (abfd, info)
bfd *abfd;
@@ -107,148 +104,6 @@ _bfd_elf_create_got_section (abfd, info)
return TRUE;
}
-/* Create some sections which will be filled in with dynamic linking
- information. ABFD is an input file which requires dynamic sections
- to be created. The dynamic sections take up virtual memory space
- when the final executable is run, so we need to create them before
- addresses are assigned to the output sections. We work out the
- actual contents and size of these sections later. */
-
-bfd_boolean
-_bfd_elf_link_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
-{
- flagword flags;
- register asection *s;
- struct elf_link_hash_entry *h;
- struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
-
- if (! is_elf_hash_table (info))
- return FALSE;
-
- if (elf_hash_table (info)->dynamic_sections_created)
- return TRUE;
-
- /* Make sure that all dynamic sections use the same input BFD. */
- if (elf_hash_table (info)->dynobj == NULL)
- elf_hash_table (info)->dynobj = abfd;
- else
- abfd = elf_hash_table (info)->dynobj;
-
- /* Note that we set the SEC_IN_MEMORY flag for all of these
- sections. */
- flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-
- /* A dynamically linked executable has a .interp section, but a
- shared library does not. */
- if (! info->shared)
- {
- s = bfd_make_section (abfd, ".interp");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
- return FALSE;
- }
-
- if (! info->traditional_format
- && info->hash->creator->flavour == bfd_target_elf_flavour)
- {
- s = bfd_make_section (abfd, ".eh_frame_hdr");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
- return FALSE;
- elf_hash_table (info)->eh_info.hdr_sec = s;
- }
-
- bed = get_elf_backend_data (abfd);
-
- /* Create sections to hold version informations. These are removed
- if they are not needed. */
- s = bfd_make_section (abfd, ".gnu.version_d");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
- return FALSE;
-
- s = bfd_make_section (abfd, ".gnu.version");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 1))
- return FALSE;
-
- s = bfd_make_section (abfd, ".gnu.version_r");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
- return FALSE;
-
- s = bfd_make_section (abfd, ".dynsym");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
- return FALSE;
-
- s = bfd_make_section (abfd, ".dynstr");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
- return FALSE;
-
- /* Create a strtab to hold the dynamic symbol names. */
- if (elf_hash_table (info)->dynstr == NULL)
- {
- elf_hash_table (info)->dynstr = _bfd_elf_strtab_init ();
- if (elf_hash_table (info)->dynstr == NULL)
- return FALSE;
- }
-
- s = bfd_make_section (abfd, ".dynamic");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
- return FALSE;
-
- /* The special symbol _DYNAMIC is always set to the start of the
- .dynamic section. This call occurs before we have processed the
- symbols for any dynamic object, so we don't have to worry about
- overriding a dynamic definition. We could set _DYNAMIC in a
- linker script, but we only want to define it if we are, in fact,
- creating a .dynamic section. We don't want to define it if there
- is no .dynamic section, since on some ELF platforms the start up
- code examines it to decide how to initialize the process. */
- bh = NULL;
- if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
- (const char *) 0, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
- h = (struct elf_link_hash_entry *) bh;
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- h->type = STT_OBJECT;
-
- if (info->shared
- && ! _bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
-
- s = bfd_make_section (abfd, ".hash");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
- return FALSE;
- elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
-
- /* Let the backend create the rest of the sections. This lets the
- backend set the right flags. The backend will normally create
- the .got and .plt sections. */
- if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
- return FALSE;
-
- elf_hash_table (info)->dynamic_sections_created = TRUE;
-
- return TRUE;
-}
-
/* Create dynamic sections when linking against a dynamic object. */
bfd_boolean
@@ -259,6 +114,22 @@ _bfd_elf_create_dynamic_sections (abfd, info)
flagword flags, pltflags;
asection *s;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ int ptralign;
+
+ switch (bed->s->arch_size)
+ {
+ case 32:
+ ptralign = 2;
+ break;
+
+ case 64:
+ ptralign = 3;
+ break;
+
+ default:
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
@@ -304,7 +175,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
return FALSE;
if (! _bfd_elf_create_got_section (abfd, info))
@@ -341,7 +212,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
? ".rela.bss" : ".rel.bss"));
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
return FALSE;
}
}
@@ -435,70 +306,6 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
return TRUE;
}
-
-/* Record an assignment to a symbol made by a linker script. We need
- this in case some dynamic object refers to this symbol. */
-
-bfd_boolean
-bfd_elf_record_link_assignment (output_bfd, info, name, provide)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- const char *name;
- bfd_boolean provide;
-{
- struct elf_link_hash_entry *h;
-
- if (info->hash->creator->flavour != bfd_target_elf_flavour)
- return TRUE;
-
- h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE);
- if (h == NULL)
- return FALSE;
-
- if (h->root.type == bfd_link_hash_new)
- h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
-
- /* If this symbol is being provided by the linker script, and it is
- currently defined by a dynamic object, but not by a regular
- object, then mark it as undefined so that the generic linker will
- force the correct value. */
- if (provide
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- h->root.type = bfd_link_hash_undefined;
-
- /* If this symbol is not being provided by the linker script, and it is
- currently defined by a dynamic object, but not by a regular object,
- then clear out any version information because the symbol will not be
- associated with the dynamic object any more. */
- if (!provide
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- h->verinfo.verdef = NULL;
-
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
-
- if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_REF_DYNAMIC)) != 0
- || info->shared)
- && h->dynindx == -1)
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
-
- /* If this is a weak defined symbol, and we know a corresponding
- real symbol from the same dynamic object, make sure the real
- symbol is also made into a dynamic symbol. */
- if (h->weakdef != NULL
- && h->weakdef->dynindx == -1)
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
- return FALSE;
- }
- }
-
- return TRUE;
-}
/* Record a new local dynamic symbol. Returns 0 on failure, 1 on
success, and 2 on a failure caused by attempting to record a symbol
@@ -670,1230 +477,6 @@ _bfd_elf_link_renumber_dynsyms (output_bfd, info)
return elf_hash_table (info)->dynsymcount = dynsymcount;
}
-
-/* This function is called when we want to define a new symbol. It
- handles the various cases which arise when we find a definition in
- a dynamic object, or when there is already a definition in a
- dynamic object. The new symbol is described by NAME, SYM, PSEC,
- and PVALUE. We set SYM_HASH to the hash table entry. We set
- OVERRIDE if the old symbol is overriding a new definition. We set
- TYPE_CHANGE_OK if it is OK for the type to change. We set
- SIZE_CHANGE_OK if it is OK for the size to change. By OK to
- change, we mean that we shouldn't warn if the type or size does
- change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of
- a shared object. */
-
-bfd_boolean
-_bfd_elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip,
- override, type_change_ok, size_change_ok, dt_needed)
- bfd *abfd;
- struct bfd_link_info *info;
- const char *name;
- Elf_Internal_Sym *sym;
- asection **psec;
- bfd_vma *pvalue;
- struct elf_link_hash_entry **sym_hash;
- bfd_boolean *skip;
- bfd_boolean *override;
- bfd_boolean *type_change_ok;
- bfd_boolean *size_change_ok;
- bfd_boolean dt_needed;
-{
- asection *sec;
- struct elf_link_hash_entry *h;
- struct elf_link_hash_entry *flip;
- int bind;
- bfd *oldbfd;
- bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
- bfd_boolean newweakdef, oldweakdef, newweakundef, oldweakundef;
-
- *skip = FALSE;
- *override = FALSE;
-
- sec = *psec;
- bind = ELF_ST_BIND (sym->st_info);
-
- if (! bfd_is_und_section (sec))
- h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE);
- else
- h = ((struct elf_link_hash_entry *)
- bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE));
- if (h == NULL)
- return FALSE;
- *sym_hash = h;
-
- /* This code is for coping with dynamic objects, and is only useful
- if we are doing an ELF link. */
- if (info->hash->creator != abfd->xvec)
- return TRUE;
-
- /* For merging, we only care about real symbols. */
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* If we just created the symbol, mark it as being an ELF symbol.
- Other than that, there is nothing to do--there is no merge issue
- with a newly defined symbol--so we just return. */
-
- if (h->root.type == bfd_link_hash_new)
- {
- h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
- return TRUE;
- }
-
- /* OLDBFD is a BFD associated with the existing symbol. */
-
- switch (h->root.type)
- {
- default:
- oldbfd = NULL;
- break;
-
- case bfd_link_hash_undefined:
- case bfd_link_hash_undefweak:
- oldbfd = h->root.u.undef.abfd;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- oldbfd = h->root.u.def.section->owner;
- break;
-
- case bfd_link_hash_common:
- oldbfd = h->root.u.c.p->section->owner;
- break;
- }
-
- /* In cases involving weak versioned symbols, we may wind up trying
- to merge a symbol with itself. Catch that here, to avoid the
- confusion that results if we try to override a symbol with
- itself. The additional tests catch cases like
- _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
- dynamic object, which we do want to handle here. */
- if (abfd == oldbfd
- && ((abfd->flags & DYNAMIC) == 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
- return TRUE;
-
- /* NEWDYN and OLDDYN indicate whether the new or old symbol,
- respectively, is from a dynamic object. */
-
- if ((abfd->flags & DYNAMIC) != 0)
- newdyn = TRUE;
- else
- newdyn = FALSE;
-
- if (oldbfd != NULL)
- olddyn = (oldbfd->flags & DYNAMIC) != 0;
- else
- {
- asection *hsec;
-
- /* This code handles the special SHN_MIPS_{TEXT,DATA} section
- indices used by MIPS ELF. */
- switch (h->root.type)
- {
- default:
- hsec = NULL;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- hsec = h->root.u.def.section;
- break;
-
- case bfd_link_hash_common:
- hsec = h->root.u.c.p->section;
- break;
- }
-
- if (hsec == NULL)
- olddyn = FALSE;
- else
- olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
- }
-
- /* NEWDEF and OLDDEF indicate whether the new or old symbol,
- respectively, appear to be a definition rather than reference. */
-
- if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
- newdef = FALSE;
- else
- newdef = TRUE;
-
- if (h->root.type == bfd_link_hash_undefined
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_common)
- olddef = FALSE;
- else
- olddef = TRUE;
-
- /* We need to rememeber if a symbol has a definition in a dynamic
- object or is weak in all dynamic objects. Internal and hidden
- visibility will make it unavailable to dynamic objects. */
- if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
- {
- if (!bfd_is_und_section (sec))
- h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF;
- else
- {
- /* Check if this symbol is weak in all dynamic objects. If it
- is the first time we see it in a dynamic object, we mark
- if it is weak. Otherwise, we clear it. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
- {
- if (bind == STB_WEAK)
- h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK;
- }
- else if (bind != STB_WEAK)
- h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK;
- }
- }
-
- /* If the old symbol has non-default visibility, we ignore the new
- definition from a dynamic object. */
- if (newdyn
- && ELF_ST_VISIBILITY (h->other)
- && !bfd_is_und_section (sec))
- {
- *skip = TRUE;
- /* Make sure this symbol is dynamic. */
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- /* A protected symbol has external availability. Make sure it is
- recorded as dynamic.
-
- FIXME: Should we check type and size for protected symbol? */
- if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
- return _bfd_elf_link_record_dynamic_symbol (info, h);
- else
- return TRUE;
- }
- else if (!newdyn
- && ELF_ST_VISIBILITY (sym->st_other)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
- {
- /* If the new symbol with non-default visibility comes from a
- relocatable file and the old definition comes from a dynamic
- object, we remove the old definition. */
- if ((*sym_hash)->root.type == bfd_link_hash_indirect)
- h = *sym_hash;
- h->root.type = bfd_link_hash_new;
- h->root.u.undef.abfd = NULL;
- if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- }
- /* FIXME: Should we check type and size for protected symbol? */
- h->size = 0;
- h->type = 0;
- return TRUE;
- }
-
- /* We need to treat weak definiton right, depending on if there is a
- definition from a dynamic object. */
- if (bind == STB_WEAK)
- {
- if (olddef)
- {
- newweakdef = TRUE;
- newweakundef = FALSE;
- }
- else
- {
- newweakdef = FALSE;
- newweakundef = TRUE;
- }
- }
- else
- newweakdef = newweakundef = FALSE;
-
- /* If the new weak definition comes from a relocatable file and the
- old symbol comes from a dynamic object, we treat the new one as
- strong. */
- if (newweakdef && !newdyn && olddyn)
- newweakdef = FALSE;
-
- if (h->root.type == bfd_link_hash_defweak)
- {
- oldweakdef = TRUE;
- oldweakundef = FALSE;
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- {
- oldweakdef = FALSE;
- oldweakundef = TRUE;
- }
- else
- oldweakdef = oldweakundef = FALSE;
-
- /* If the old weak definition comes from a relocatable file and the
- new symbol comes from a dynamic object, we treat the old one as
- strong. */
- if (oldweakdef && !olddyn && newdyn)
- oldweakdef = FALSE;
-
- /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
- symbol, respectively, appears to be a common symbol in a dynamic
- object. If a symbol appears in an uninitialized section, and is
- not weak, and is not a function, then it may be a common symbol
- which was resolved when the dynamic object was created. We want
- to treat such symbols specially, because they raise special
- considerations when setting the symbol size: if the symbol
- appears as a common symbol in a regular object, and the size in
- the regular object is larger, we must make sure that we use the
- larger size. This problematic case can always be avoided in C,
- but it must be handled correctly when using Fortran shared
- libraries.
-
- Note that if NEWDYNCOMMON is set, NEWDEF will be set, and
- likewise for OLDDYNCOMMON and OLDDEF.
-
- Note that this test is just a heuristic, and that it is quite
- possible to have an uninitialized symbol in a shared object which
- is really a definition, rather than a common symbol. This could
- lead to some minor confusion when the symbol really is a common
- symbol in some regular object. However, I think it will be
- harmless. */
-
- if (newdyn
- && newdef
- && (sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_LOAD) == 0
- && sym->st_size > 0
- && !newweakdef
- && !newweakundef
- && ELF_ST_TYPE (sym->st_info) != STT_FUNC)
- newdyncommon = TRUE;
- else
- newdyncommon = FALSE;
-
- if (olddyn
- && olddef
- && h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->root.u.def.section->flags & SEC_ALLOC) != 0
- && (h->root.u.def.section->flags & SEC_LOAD) == 0
- && h->size > 0
- && h->type != STT_FUNC)
- olddyncommon = TRUE;
- else
- olddyncommon = FALSE;
-
- /* It's OK to change the type if either the existing symbol or the
- new symbol is weak unless it comes from a DT_NEEDED entry of
- a shared object, in which case, the DT_NEEDED entry may not be
- required at the run time. */
-
- if ((! dt_needed && oldweakdef)
- || oldweakundef
- || newweakdef
- || newweakundef)
- *type_change_ok = TRUE;
-
- /* It's OK to change the size if either the existing symbol or the
- new symbol is weak, or if the old symbol is undefined. */
-
- if (*type_change_ok
- || h->root.type == bfd_link_hash_undefined)
- *size_change_ok = TRUE;
-
- /* If both the old and the new symbols look like common symbols in a
- dynamic object, set the size of the symbol to the larger of the
- two. */
-
- if (olddyncommon
- && newdyncommon
- && sym->st_size != h->size)
- {
- /* Since we think we have two common symbols, issue a multiple
- common warning if desired. Note that we only warn if the
- size is different. If the size is the same, we simply let
- the old symbol override the new one as normally happens with
- symbols defined in dynamic objects. */
-
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string, oldbfd, bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common, sym->st_size)))
- return FALSE;
-
- if (sym->st_size > h->size)
- h->size = sym->st_size;
-
- *size_change_ok = TRUE;
- }
-
- /* If we are looking at a dynamic object, and we have found a
- definition, we need to see if the symbol was already defined by
- some other object. If so, we want to use the existing
- definition, and we do not want to report a multiple symbol
- definition error; we do this by clobbering *PSEC to be
- bfd_und_section_ptr.
-
- We treat a common symbol as a definition if the symbol in the
- shared library is a function, since common symbols always
- represent variables; this can cause confusion in principle, but
- any such confusion would seem to indicate an erroneous program or
- shared library. We also permit a common symbol in a regular
- object to override a weak symbol in a shared object.
-
- We prefer a non-weak definition in a shared library to a weak
- definition in the executable unless it comes from a DT_NEEDED
- entry of a shared object, in which case, the DT_NEEDED entry
- may not be required at the run time. */
-
- if (newdyn
- && newdef
- && (olddef
- || (h->root.type == bfd_link_hash_common
- && (newweakdef
- || newweakundef
- || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
- && (!oldweakdef
- || dt_needed
- || newweakdef
- || newweakundef))
- {
- *override = TRUE;
- newdef = FALSE;
- newdyncommon = FALSE;
-
- *psec = sec = bfd_und_section_ptr;
- *size_change_ok = TRUE;
-
- /* If we get here when the old symbol is a common symbol, then
- we are explicitly letting it override a weak symbol or
- function in a dynamic object, and we don't want to warn about
- a type change. If the old symbol is a defined symbol, a type
- change warning may still be appropriate. */
-
- if (h->root.type == bfd_link_hash_common)
- *type_change_ok = TRUE;
- }
-
- /* Handle the special case of an old common symbol merging with a
- new symbol which looks like a common symbol in a shared object.
- We change *PSEC and *PVALUE to make the new symbol look like a
- common symbol, and let _bfd_generic_link_add_one_symbol will do
- the right thing. */
-
- if (newdyncommon
- && h->root.type == bfd_link_hash_common)
- {
- *override = TRUE;
- newdef = FALSE;
- newdyncommon = FALSE;
- *pvalue = sym->st_size;
- *psec = sec = bfd_com_section_ptr;
- *size_change_ok = TRUE;
- }
-
- /* If the old symbol is from a dynamic object, and the new symbol is
- a definition which is not from a dynamic object, then the new
- symbol overrides the old symbol. Symbols from regular files
- always take precedence over symbols from dynamic objects, even if
- they are defined after the dynamic object in the link.
-
- As above, we again permit a common symbol in a regular object to
- override a definition in a shared object if the shared object
- symbol is a function or is weak.
-
- As above, we permit a non-weak definition in a shared object to
- override a weak definition in a regular object. */
-
- flip = NULL;
- if (! newdyn
- && (newdef
- || (bfd_is_com_section (sec)
- && (oldweakdef || h->type == STT_FUNC)))
- && olddyn
- && olddef
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && ((!newweakdef && !newweakundef) || oldweakdef))
- {
- /* Change the hash table entry to undefined, and let
- _bfd_generic_link_add_one_symbol do the right thing with the
- new definition. */
-
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
- *size_change_ok = TRUE;
-
- olddef = FALSE;
- olddyncommon = FALSE;
-
- /* We again permit a type change when a common symbol may be
- overriding a function. */
-
- if (bfd_is_com_section (sec))
- *type_change_ok = TRUE;
-
- if ((*sym_hash)->root.type == bfd_link_hash_indirect)
- flip = *sym_hash;
- else
- /* This union may have been set to be non-NULL when this symbol
- was seen in a dynamic object. We must force the union to be
- NULL, so that it is correct for a regular symbol. */
- h->verinfo.vertree = NULL;
- }
-
- /* Handle the special case of a new common symbol merging with an
- old symbol that looks like it might be a common symbol defined in
- a shared object. Note that we have already handled the case in
- which a new common symbol should simply override the definition
- in the shared library. */
-
- if (! newdyn
- && bfd_is_com_section (sec)
- && olddyncommon)
- {
- /* It would be best if we could set the hash table entry to a
- common symbol, but we don't know what to use for the section
- or the alignment. */
- if (! ((*info->callbacks->multiple_common)
- (info, h->root.root.string, oldbfd, bfd_link_hash_common,
- h->size, abfd, bfd_link_hash_common, sym->st_size)))
- return FALSE;
-
- /* If the predumed common symbol in the dynamic object is
- larger, pretend that the new symbol has its size. */
-
- if (h->size > *pvalue)
- *pvalue = h->size;
-
- /* FIXME: We no longer know the alignment required by the symbol
- in the dynamic object, so we just wind up using the one from
- the regular object. */
-
- olddef = FALSE;
- olddyncommon = FALSE;
-
- h->root.type = bfd_link_hash_undefined;
- h->root.u.undef.abfd = h->root.u.def.section->owner;
-
- *size_change_ok = TRUE;
- *type_change_ok = TRUE;
-
- if ((*sym_hash)->root.type == bfd_link_hash_indirect)
- flip = *sym_hash;
- else
- h->verinfo.vertree = NULL;
- }
-
- if (flip != NULL)
- {
- /* Handle the case where we had a versioned symbol in a dynamic
- library and now find a definition in a normal object. In this
- case, we make the versioned symbol point to the normal one. */
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
- flip->root.type = h->root.type;
- h->root.type = bfd_link_hash_indirect;
- h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
- (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h);
- flip->root.u.undef.abfd = h->root.u.undef.abfd;
- if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
- {
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
- flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- }
- }
-
- /* Handle the special case of a weak definition in a regular object
- followed by a non-weak definition in a shared object. In this
- case, we prefer the definition in the shared object unless it
- comes from a DT_NEEDED entry of a shared object, in which case,
- the DT_NEEDED entry may not be required at the run time. */
- if (olddef
- && ! dt_needed
- && oldweakdef
- && newdef
- && newdyn
- && !newweakdef
- && !newweakundef)
- {
- /* To make this work we have to frob the flags so that the rest
- of the code does not think we are using the regular
- definition. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
- else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
- | ELF_LINK_HASH_DEF_DYNAMIC);
-
- /* If H is the target of an indirection, we want the caller to
- use H rather than the indirect symbol. Otherwise if we are
- defining a new indirect symbol we will wind up attaching it
- to the entry we are overriding. */
- *sym_hash = h;
- }
-
- /* Handle the special case of a non-weak definition in a shared
- object followed by a weak definition in a regular object. In
- this case we prefer the definition in the shared object. To make
- this work we have to tell the caller to not treat the new symbol
- as a definition. */
- if (olddef
- && olddyn
- && !oldweakdef
- && newdef
- && ! newdyn
- && (newweakdef || newweakundef))
- *override = TRUE;
-
- return TRUE;
-}
-
-/* This function is called to create an indirect symbol from the
- default for the symbol with the default version if needed. The
- symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We
- set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED
- indicates if it comes from a DT_NEEDED entry of a shared object. */
-
-bfd_boolean
-_bfd_elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
- dynsym, override, dt_needed)
- bfd *abfd;
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- const char *name;
- Elf_Internal_Sym *sym;
- asection **psec;
- bfd_vma *value;
- bfd_boolean *dynsym;
- bfd_boolean override;
- bfd_boolean dt_needed;
-{
- bfd_boolean type_change_ok;
- bfd_boolean size_change_ok;
- bfd_boolean skip;
- char *shortname;
- struct elf_link_hash_entry *hi;
- struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
- bfd_boolean collect;
- bfd_boolean dynamic;
- char *p;
- size_t len, shortlen;
- asection *sec;
-
- /* If this symbol has a version, and it is the default version, we
- create an indirect symbol from the default name to the fully
- decorated name. This will cause external references which do not
- specify a version to be bound to this version of the symbol. */
- p = strchr (name, ELF_VER_CHR);
- if (p == NULL || p[1] != ELF_VER_CHR)
- return TRUE;
-
- if (override)
- {
- /* We are overridden by an old defition. We need to check if we
- need to create the indirect symbol from the default name. */
- hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE,
- FALSE, FALSE);
- BFD_ASSERT (hi != NULL);
- if (hi == h)
- return TRUE;
- while (hi->root.type == bfd_link_hash_indirect
- || hi->root.type == bfd_link_hash_warning)
- {
- hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
- if (hi == h)
- return TRUE;
- }
- }
-
- bed = get_elf_backend_data (abfd);
- collect = bed->collect;
- dynamic = (abfd->flags & DYNAMIC) != 0;
-
- shortlen = p - name;
- shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1);
- if (shortname == NULL)
- return FALSE;
- memcpy (shortname, name, shortlen);
- shortname[shortlen] = '\0';
-
- /* We are going to create a new symbol. Merge it with any existing
- symbol with this name. For the purposes of the merge, act as
- though we were defining the symbol we just defined, although we
- actually going to define an indirect symbol. */
- type_change_ok = FALSE;
- size_change_ok = FALSE;
- sec = *psec;
- if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
- &hi, &skip, &override, &type_change_ok,
- &size_change_ok, dt_needed))
- return FALSE;
-
- if (skip)
- goto nondefault;
-
- if (! override)
- {
- bh = &hi->root;
- if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
- (bfd_vma) 0, name, FALSE, collect, &bh)))
- return FALSE;
- hi = (struct elf_link_hash_entry *) bh;
- }
- else
- {
- /* In this case the symbol named SHORTNAME is overriding the
- indirect symbol we want to add. We were planning on making
- SHORTNAME an indirect symbol referring to NAME. SHORTNAME
- is the name without a version. NAME is the fully versioned
- name, and it is the default version.
-
- Overriding means that we already saw a definition for the
- symbol SHORTNAME in a regular object, and it is overriding
- the symbol defined in the dynamic object.
-
- When this happens, we actually want to change NAME, the
- symbol we just added, to refer to SHORTNAME. This will cause
- references to NAME in the shared object to become references
- to SHORTNAME in the regular object. This is what we expect
- when we override a function in a shared object: that the
- references in the shared object will be mapped to the
- definition in the regular object. */
-
- while (hi->root.type == bfd_link_hash_indirect
- || hi->root.type == bfd_link_hash_warning)
- hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
-
- h->root.type = bfd_link_hash_indirect;
- h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
- if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
- {
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
- hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- if (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR))
- {
- if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
- return FALSE;
- }
- }
-
- /* Now set HI to H, so that the following code will set the
- other fields correctly. */
- hi = h;
- }
-
- /* If there is a duplicate definition somewhere, then HI may not
- point to an indirect symbol. We will have reported an error to
- the user in that case. */
-
- if (hi->root.type == bfd_link_hash_indirect)
- {
- struct elf_link_hash_entry *ht;
-
- /* If the symbol became indirect, then we assume that we have
- not seen a definition before. */
- BFD_ASSERT ((hi->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR)) == 0);
-
- ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
- (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi);
-
- /* See if the new flags lead us to realize that the symbol must
- be dynamic. */
- if (! *dynsym)
- {
- if (! dynamic)
- {
- if (info->shared
- || ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- *dynsym = TRUE;
- }
- else
- {
- if ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_REGULAR) != 0)
- *dynsym = TRUE;
- }
- }
- }
-
- /* We also need to define an indirection from the nondefault version
- of the symbol. */
-
-nondefault:
- len = strlen (name);
- shortname = bfd_hash_allocate (&info->hash->table, len);
- if (shortname == NULL)
- return FALSE;
- memcpy (shortname, name, shortlen);
- memcpy (shortname + shortlen, p + 1, len - shortlen);
-
- /* Once again, merge with any existing symbol. */
- type_change_ok = FALSE;
- size_change_ok = FALSE;
- sec = *psec;
- if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
- &hi, &skip, &override, &type_change_ok,
- &size_change_ok, dt_needed))
- return FALSE;
-
- if (skip)
- return TRUE;
-
- if (override)
- {
- /* Here SHORTNAME is a versioned name, so we don't expect to see
- the type of override we do in the case above unless it is
- overridden by a versioned definiton. */
- if (hi->root.type != bfd_link_hash_defined
- && hi->root.type != bfd_link_hash_defweak)
- (*_bfd_error_handler)
- (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"),
- bfd_archive_filename (abfd), shortname);
- }
- else
- {
- bh = &hi->root;
- if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, shortname, BSF_INDIRECT,
- bfd_ind_section_ptr, (bfd_vma) 0, name, FALSE, collect, &bh)))
- return FALSE;
- hi = (struct elf_link_hash_entry *) bh;
-
- /* If there is a duplicate definition somewhere, then HI may not
- point to an indirect symbol. We will have reported an error
- to the user in that case. */
-
- if (hi->root.type == bfd_link_hash_indirect)
- {
- /* If the symbol became indirect, then we assume that we have
- not seen a definition before. */
- BFD_ASSERT ((hi->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC
- | ELF_LINK_HASH_DEF_REGULAR)) == 0);
-
- (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
-
- /* See if the new flags lead us to realize that the symbol
- must be dynamic. */
- if (! *dynsym)
- {
- if (! dynamic)
- {
- if (info->shared
- || ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- *dynsym = TRUE;
- }
- else
- {
- if ((hi->elf_link_hash_flags
- & ELF_LINK_HASH_REF_REGULAR) != 0)
- *dynsym = TRUE;
- }
- }
- }
- }
-
- return TRUE;
-}
-
-/* This routine is used to export all defined symbols into the dynamic
- symbol table. It is called via elf_link_hash_traverse. */
-
-bfd_boolean
-_bfd_elf_export_symbol (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_info_failed *eif = (struct elf_info_failed *) data;
-
- /* Ignore indirect symbols. These are added by the versioning code. */
- if (h->root.type == bfd_link_hash_indirect)
- return TRUE;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (h->dynindx == -1
- && (h->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
- {
- struct bfd_elf_version_tree *t;
- struct bfd_elf_version_expr *d;
-
- for (t = eif->verdefs; t != NULL; t = t->next)
- {
- if (t->globals != NULL)
- {
- for (d = t->globals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- goto doit;
- }
- }
-
- if (t->locals != NULL)
- {
- for (d = t->locals ; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- return TRUE;
- }
- }
- }
-
- if (!eif->verdefs)
- {
- doit:
- if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
- }
- }
-
- return TRUE;
-}
-
-/* Look through the symbols which are defined in other shared
- libraries and referenced here. Update the list of version
- dependencies. This will be put into the .gnu.version_r section.
- This function is called via elf_link_hash_traverse. */
-
-bfd_boolean
-_bfd_elf_link_find_version_dependencies (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data;
- Elf_Internal_Verneed *t;
- Elf_Internal_Vernaux *a;
- bfd_size_type amt;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* We only care about symbols defined in shared objects with version
- information. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- || h->dynindx == -1
- || h->verinfo.verdef == NULL)
- return TRUE;
-
- /* See if we already know about this version. */
- for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
- {
- if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
- continue;
-
- for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
- if (a->vna_nodename == h->verinfo.verdef->vd_nodename)
- return TRUE;
-
- break;
- }
-
- /* This is a new version. Add it to tree we are building. */
-
- if (t == NULL)
- {
- amt = sizeof *t;
- t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt);
- if (t == NULL)
- {
- rinfo->failed = TRUE;
- return FALSE;
- }
-
- t->vn_bfd = h->verinfo.verdef->vd_bfd;
- t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
- elf_tdata (rinfo->output_bfd)->verref = t;
- }
-
- amt = sizeof *a;
- a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt);
-
- /* Note that we are copying a string pointer here, and testing it
- above. If bfd_elf_string_from_elf_section is ever changed to
- discard the string data when low in memory, this will have to be
- fixed. */
- a->vna_nodename = h->verinfo.verdef->vd_nodename;
-
- a->vna_flags = h->verinfo.verdef->vd_flags;
- a->vna_nextptr = t->vn_auxptr;
-
- h->verinfo.verdef->vd_exp_refno = rinfo->vers;
- ++rinfo->vers;
-
- a->vna_other = h->verinfo.verdef->vd_exp_refno + 1;
-
- t->vn_auxptr = a;
-
- return TRUE;
-}
-
-/* Figure out appropriate versions for all the symbols. We may not
- have the version number script until we have read all of the input
- files, so until that point we don't know which symbols should be
- local. This function is called via elf_link_hash_traverse. */
-
-bfd_boolean
-_bfd_elf_link_assign_sym_version (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_assign_sym_version_info *sinfo;
- struct bfd_link_info *info;
- struct elf_backend_data *bed;
- struct elf_info_failed eif;
- char *p;
- bfd_size_type amt;
-
- sinfo = (struct elf_assign_sym_version_info *) data;
- info = sinfo->info;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- /* Fix the symbol flags. */
- eif.failed = FALSE;
- eif.info = info;
- if (! _bfd_elf_fix_symbol_flags (h, &eif))
- {
- if (eif.failed)
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- /* We only need version numbers for symbols defined in regular
- objects. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- return TRUE;
-
- bed = get_elf_backend_data (sinfo->output_bfd);
- p = strchr (h->root.root.string, ELF_VER_CHR);
- if (p != NULL && h->verinfo.vertree == NULL)
- {
- struct bfd_elf_version_tree *t;
- bfd_boolean hidden;
-
- hidden = TRUE;
-
- /* There are two consecutive ELF_VER_CHR characters if this is
- not a hidden symbol. */
- ++p;
- if (*p == ELF_VER_CHR)
- {
- hidden = FALSE;
- ++p;
- }
-
- /* If there is no version string, we can just return out. */
- if (*p == '\0')
- {
- if (hidden)
- h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
- return TRUE;
- }
-
- /* Look for the version. If we find it, it is no longer weak. */
- for (t = sinfo->verdefs; t != NULL; t = t->next)
- {
- if (strcmp (t->name, p) == 0)
- {
- size_t len;
- char *alc;
- struct bfd_elf_version_expr *d;
-
- len = p - h->root.root.string;
- alc = bfd_malloc ((bfd_size_type) len);
- if (alc == NULL)
- return FALSE;
- memcpy (alc, h->root.root.string, len - 1);
- alc[len - 1] = '\0';
- if (alc[len - 2] == ELF_VER_CHR)
- alc[len - 2] = '\0';
-
- h->verinfo.vertree = t;
- t->used = TRUE;
- d = NULL;
-
- if (t->globals != NULL)
- {
- for (d = t->globals; d != NULL; d = d->next)
- if ((*d->match) (d, alc))
- break;
- }
-
- /* See if there is anything to force this symbol to
- local scope. */
- if (d == NULL && t->locals != NULL)
- {
- for (d = t->locals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, alc))
- {
- if (h->dynindx != -1
- && info->shared
- && ! info->export_dynamic)
- {
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
-
- break;
- }
- }
- }
-
- free (alc);
- break;
- }
- }
-
- /* If we are building an application, we need to create a
- version node for this version. */
- if (t == NULL && ! info->shared)
- {
- struct bfd_elf_version_tree **pp;
- int version_index;
-
- /* If we aren't going to export this symbol, we don't need
- to worry about it. */
- if (h->dynindx == -1)
- return TRUE;
-
- amt = sizeof *t;
- t = ((struct bfd_elf_version_tree *)
- bfd_alloc (sinfo->output_bfd, amt));
- if (t == NULL)
- {
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- t->next = NULL;
- t->name = p;
- t->globals = NULL;
- t->locals = NULL;
- t->deps = NULL;
- t->name_indx = (unsigned int) -1;
- t->used = TRUE;
-
- version_index = 1;
- /* Don't count anonymous version tag. */
- if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0)
- version_index = 0;
- for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next)
- ++version_index;
- t->vernum = version_index;
-
- *pp = t;
-
- h->verinfo.vertree = t;
- }
- else if (t == NULL)
- {
- /* We could not find the version for a symbol when
- generating a shared archive. Return an error. */
- (*_bfd_error_handler)
- (_("%s: undefined versioned symbol name %s"),
- bfd_get_filename (sinfo->output_bfd), h->root.root.string);
- bfd_set_error (bfd_error_bad_value);
- sinfo->failed = TRUE;
- return FALSE;
- }
-
- if (hidden)
- h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
- }
-
- /* If we don't have a version for this symbol, see if we can find
- something. */
- if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
- {
- struct bfd_elf_version_tree *t;
- struct bfd_elf_version_tree *local_ver;
- struct bfd_elf_version_expr *d;
-
- /* See if can find what version this symbol is in. If the
- symbol is supposed to be local, then don't actually register
- it. */
- local_ver = NULL;
- for (t = sinfo->verdefs; t != NULL; t = t->next)
- {
- if (t->globals != NULL)
- {
- bfd_boolean matched;
-
- matched = FALSE;
- for (d = t->globals; d != NULL; d = d->next)
- {
- if ((*d->match) (d, h->root.root.string))
- {
- if (d->symver)
- matched = TRUE;
- else
- {
- /* There is a version without definition. Make
- the symbol the default definition for this
- version. */
- h->verinfo.vertree = t;
- local_ver = NULL;
- d->script = 1;
- break;
- }
- }
- }
-
- if (d != NULL)
- break;
- else if (matched)
- /* There is no undefined version for this symbol. Hide the
- default one. */
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
-
- if (t->locals != NULL)
- {
- for (d = t->locals; d != NULL; d = d->next)
- {
- /* If the match is "*", keep looking for a more
- explicit, perhaps even global, match. */
- if (d->pattern[0] == '*' && d->pattern[1] == '\0')
- local_ver = t;
- else if ((*d->match) (d, h->root.root.string))
- {
- local_ver = t;
- break;
- }
- }
-
- if (d != NULL)
- break;
- }
- }
-
- if (local_ver != NULL)
- {
- h->verinfo.vertree = local_ver;
- if (h->dynindx != -1
- && info->shared
- && ! info->export_dynamic)
- {
- (*bed->elf_backend_hide_symbol) (info, h, TRUE);
- }
- }
- }
-
- return TRUE;
-}
/* Create a special linker section, or return a pointer to a linker
section already created */
@@ -2067,585 +650,3 @@ _bfd_elf_make_linker_section_rela (dynobj, lsect, alignment)
return TRUE;
}
-
-/* Read and swap the relocs from the section indicated by SHDR. This
- may be either a REL or a RELA section. The relocations are
- translated into RELA relocations and stored in INTERNAL_RELOCS,
- which should have already been allocated to contain enough space.
- The EXTERNAL_RELOCS are a buffer where the external form of the
- relocations should be stored.
-
- Returns FALSE if something goes wrong. */
-
-static bfd_boolean
-elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
- internal_relocs)
- bfd *abfd;
- Elf_Internal_Shdr *shdr;
- PTR external_relocs;
- Elf_Internal_Rela *internal_relocs;
-{
- struct elf_backend_data *bed;
- void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
- const bfd_byte *erela;
- const bfd_byte *erelaend;
- Elf_Internal_Rela *irela;
-
- /* If there aren't any relocations, that's OK. */
- if (!shdr)
- return TRUE;
-
- /* Position ourselves at the start of the section. */
- if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
- return FALSE;
-
- /* Read the relocations. */
- if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size)
- return FALSE;
-
- bed = get_elf_backend_data (abfd);
-
- /* Convert the external relocations to the internal format. */
- if (shdr->sh_entsize == bed->s->sizeof_rel)
- swap_in = bed->s->swap_reloc_in;
- else if (shdr->sh_entsize == bed->s->sizeof_rela)
- swap_in = bed->s->swap_reloca_in;
- else
- {
- bfd_set_error (bfd_error_wrong_format);
- return FALSE;
- }
-
- erela = external_relocs;
- erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
- irela = internal_relocs;
- while (erela < erelaend)
- {
- (*swap_in) (abfd, erela, irela);
- irela += bed->s->int_rels_per_ext_rel;
- erela += shdr->sh_entsize;
- }
-
- return TRUE;
-}
-
-/* Read and swap the relocs for a section O. They may have been
- cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
- not NULL, they are used as buffers to read into. They are known to
- be large enough. If the INTERNAL_RELOCS relocs argument is NULL,
- the return value is allocated using either malloc or bfd_alloc,
- according to the KEEP_MEMORY argument. If O has two relocation
- sections (both REL and RELA relocations), then the REL_HDR
- relocations will appear first in INTERNAL_RELOCS, followed by the
- REL_HDR2 relocations. */
-
-Elf_Internal_Rela *
-_bfd_elf_link_read_relocs (abfd, o, external_relocs, internal_relocs,
- keep_memory)
- bfd *abfd;
- asection *o;
- PTR external_relocs;
- Elf_Internal_Rela *internal_relocs;
- bfd_boolean keep_memory;
-{
- Elf_Internal_Shdr *rel_hdr;
- PTR alloc1 = NULL;
- Elf_Internal_Rela *alloc2 = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
-
- if (elf_section_data (o)->relocs != NULL)
- return elf_section_data (o)->relocs;
-
- if (o->reloc_count == 0)
- return NULL;
-
- rel_hdr = &elf_section_data (o)->rel_hdr;
-
- if (internal_relocs == NULL)
- {
- bfd_size_type size;
-
- size = o->reloc_count;
- size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela);
- if (keep_memory)
- internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
- else
- internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size);
- if (internal_relocs == NULL)
- goto error_return;
- }
-
- if (external_relocs == NULL)
- {
- bfd_size_type size = rel_hdr->sh_size;
-
- if (elf_section_data (o)->rel_hdr2)
- size += elf_section_data (o)->rel_hdr2->sh_size;
- alloc1 = (PTR) bfd_malloc (size);
- if (alloc1 == NULL)
- goto error_return;
- external_relocs = alloc1;
- }
-
- if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
- external_relocs,
- internal_relocs))
- goto error_return;
- if (!elf_link_read_relocs_from_section
- (abfd,
- elf_section_data (o)->rel_hdr2,
- ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
- internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr)
- * bed->s->int_rels_per_ext_rel)))
- goto error_return;
-
- /* Cache the results for next time, if we can. */
- if (keep_memory)
- elf_section_data (o)->relocs = internal_relocs;
-
- if (alloc1 != NULL)
- free (alloc1);
-
- /* Don't free alloc2, since if it was allocated we are passing it
- back (under the name of internal_relocs). */
-
- return internal_relocs;
-
- error_return:
- if (alloc1 != NULL)
- free (alloc1);
- if (alloc2 != NULL)
- free (alloc2);
- return NULL;
-}
-
-/* Compute the size of, and allocate space for, REL_HDR which is the
- section header for a section containing relocations for O. */
-
-bfd_boolean
-_bfd_elf_link_size_reloc_section (abfd, rel_hdr, o)
- bfd *abfd;
- Elf_Internal_Shdr *rel_hdr;
- asection *o;
-{
- bfd_size_type reloc_count;
- bfd_size_type num_rel_hashes;
-
- /* Figure out how many relocations there will be. */
- if (rel_hdr == &elf_section_data (o)->rel_hdr)
- reloc_count = elf_section_data (o)->rel_count;
- else
- reloc_count = elf_section_data (o)->rel_count2;
-
- num_rel_hashes = o->reloc_count;
- if (num_rel_hashes < reloc_count)
- num_rel_hashes = reloc_count;
-
- /* That allows us to calculate the size of the section. */
- rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count;
-
- /* The contents field must last into write_object_contents, so we
- allocate it with bfd_alloc rather than malloc. Also since we
- cannot be sure that the contents will actually be filled in,
- we zero the allocated space. */
- rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size);
- if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
- return FALSE;
-
- /* We only allocate one set of hash entries, so we only do it the
- first time we are called. */
- if (elf_section_data (o)->rel_hashes == NULL
- && num_rel_hashes)
- {
- struct elf_link_hash_entry **p;
-
- p = ((struct elf_link_hash_entry **)
- bfd_zmalloc (num_rel_hashes
- * sizeof (struct elf_link_hash_entry *)));
- if (p == NULL)
- return FALSE;
-
- elf_section_data (o)->rel_hashes = p;
- }
-
- return TRUE;
-}
-
-/* Copy the relocations indicated by the INTERNAL_RELOCS (which
- originated from the section given by INPUT_REL_HDR) to the
- OUTPUT_BFD. */
-
-bfd_boolean
-_bfd_elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
- internal_relocs)
- bfd *output_bfd;
- asection *input_section;
- Elf_Internal_Shdr *input_rel_hdr;
- Elf_Internal_Rela *internal_relocs;
-{
- Elf_Internal_Rela *irela;
- Elf_Internal_Rela *irelaend;
- bfd_byte *erel;
- Elf_Internal_Shdr *output_rel_hdr;
- asection *output_section;
- unsigned int *rel_countp = NULL;
- struct elf_backend_data *bed;
- void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
-
- output_section = input_section->output_section;
- output_rel_hdr = NULL;
-
- if (elf_section_data (output_section)->rel_hdr.sh_entsize
- == input_rel_hdr->sh_entsize)
- {
- output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
- rel_countp = &elf_section_data (output_section)->rel_count;
- }
- else if (elf_section_data (output_section)->rel_hdr2
- && (elf_section_data (output_section)->rel_hdr2->sh_entsize
- == input_rel_hdr->sh_entsize))
- {
- output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
- rel_countp = &elf_section_data (output_section)->rel_count2;
- }
- else
- {
- (*_bfd_error_handler)
- (_("%s: relocation size mismatch in %s section %s"),
- bfd_get_filename (output_bfd),
- bfd_archive_filename (input_section->owner),
- input_section->name);
- bfd_set_error (bfd_error_wrong_object_format);
- return FALSE;
- }
-
- bed = get_elf_backend_data (output_bfd);
- if (input_rel_hdr->sh_entsize == bed->s->sizeof_rel)
- swap_out = bed->s->swap_reloc_out;
- else if (input_rel_hdr->sh_entsize == bed->s->sizeof_rela)
- swap_out = bed->s->swap_reloca_out;
- else
- abort ();
-
- erel = output_rel_hdr->contents;
- erel += *rel_countp * input_rel_hdr->sh_entsize;
- irela = internal_relocs;
- irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
- * bed->s->int_rels_per_ext_rel);
- while (irela < irelaend)
- {
- (*swap_out) (output_bfd, irela, erel);
- irela += bed->s->int_rels_per_ext_rel;
- erel += input_rel_hdr->sh_entsize;
- }
-
- /* Bump the counter, so that we know where to add the next set of
- relocations. */
- *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr);
-
- return TRUE;
-}
-
-/* Fix up the flags for a symbol. This handles various cases which
- can only be fixed after all the input files are seen. This is
- currently called by both adjust_dynamic_symbol and
- assign_sym_version, which is unnecessary but perhaps more robust in
- the face of future changes. */
-
-bfd_boolean
-_bfd_elf_fix_symbol_flags (h, eif)
- struct elf_link_hash_entry *h;
- struct elf_info_failed *eif;
-{
- /* If this symbol was mentioned in a non-ELF file, try to set
- DEF_REGULAR and REF_REGULAR correctly. This is the only way to
- permit a non-ELF file to correctly refer to a symbol defined in
- an ELF dynamic object. */
- if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
- {
- while (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (h->root.type != bfd_link_hash_defined
- && h->root.type != bfd_link_hash_defweak)
- h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
- else
- {
- if (h->root.u.def.section->owner != NULL
- && (bfd_get_flavour (h->root.u.def.section->owner)
- == bfd_target_elf_flavour))
- h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
- else
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- }
-
- if (h->dynindx == -1
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
- {
- if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
- }
- }
- else
- {
- /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
- was first seen in a non-ELF file. Fortunately, if the symbol
- was first seen in an ELF file, we're probably OK unless the
- symbol was defined in a non-ELF file. Catch that case here.
- FIXME: We're still in trouble if the symbol was first seen in
- a dynamic object, and then later in a non-ELF regular object. */
- if ((h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && (h->root.u.def.section->owner != NULL
- ? (bfd_get_flavour (h->root.u.def.section->owner)
- != bfd_target_elf_flavour)
- : (bfd_is_abs_section (h->root.u.def.section)
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- }
-
- /* If this is a final link, and the symbol was defined as a common
- symbol in a regular object file, and there was no definition in
- any dynamic object, then the linker will have allocated space for
- the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
- flag will not have been set. */
- if (h->root.type == bfd_link_hash_defined
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
-
- /* If -Bsymbolic was used (which means to bind references to global
- symbols to the definition within the shared object), and this
- symbol was defined in a regular object, then it actually doesn't
- need a PLT entry, and we can accomplish that by forcing it local.
- Likewise, if the symbol has hidden or internal visibility.
- FIXME: It might be that we also do not need a PLT for other
- non-hidden visibilities, but we would have to tell that to the
- backend specifically; we can't just clear PLT-related data here. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
- && eif->info->shared
- && is_elf_hash_table (eif->info)
- && (eif->info->symbolic
- || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
- || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- {
- struct elf_backend_data *bed;
- bfd_boolean force_local;
-
- bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
-
- force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
- || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
- (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
- }
-
- /* If a weak undefined symbol has non-default visibility, we also
- hide it from the dynamic linker. */
- if (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak)
- {
- struct elf_backend_data *bed;
- bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
- (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
- }
-
- /* If this is a weak defined symbol in a dynamic object, and we know
- the real definition in the dynamic object, copy interesting flags
- over to the real definition. */
- if (h->weakdef != NULL)
- {
- struct elf_link_hash_entry *weakdef;
-
- weakdef = h->weakdef;
- if (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- BFD_ASSERT (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak);
- BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
- || weakdef->root.type == bfd_link_hash_defweak);
- BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
-
- /* If the real definition is defined by a regular object file,
- don't do anything special. See the longer description in
- _bfd_elf_adjust_dynamic_symbol, below. */
- if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- h->weakdef = NULL;
- else
- {
- struct elf_backend_data *bed;
-
- bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
- (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
- }
- }
-
- return TRUE;
-}
-
-/* Make the backend pick a good value for a dynamic symbol. This is
- called via elf_link_hash_traverse, and also calls itself
- recursively. */
-
-bfd_boolean
-_bfd_elf_adjust_dynamic_symbol (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct elf_info_failed *eif = (struct elf_info_failed *) data;
- bfd *dynobj;
- struct elf_backend_data *bed;
-
- if (! is_elf_hash_table (eif->info))
- return FALSE;
-
- if (h->root.type == bfd_link_hash_warning)
- {
- h->plt = elf_hash_table (eif->info)->init_offset;
- h->got = elf_hash_table (eif->info)->init_offset;
-
- /* When warning symbols are created, they **replace** the "real"
- entry in the hash table, thus we never get to see the real
- symbol in a hash traversal. So look at it now. */
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
-
- /* Ignore indirect symbols. These are added by the versioning code. */
- if (h->root.type == bfd_link_hash_indirect)
- return TRUE;
-
- /* Fix the symbol flags. */
- if (! _bfd_elf_fix_symbol_flags (h, eif))
- return FALSE;
-
- /* If this symbol does not require a PLT entry, and it is not
- defined by a dynamic object, or is not referenced by a regular
- object, ignore it. We do have to handle a weak defined symbol,
- even if no regular object refers to it, if we decided to add it
- to the dynamic symbol table. FIXME: Do we normally need to worry
- about symbols which are defined by one dynamic object and
- referenced by another one? */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
- && (h->weakdef == NULL || h->weakdef->dynindx == -1))))
- {
- h->plt = elf_hash_table (eif->info)->init_offset;
- return TRUE;
- }
-
- /* If we've already adjusted this symbol, don't do it again. This
- can happen via a recursive call. */
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
- return TRUE;
-
- /* Don't look at this symbol again. Note that we must set this
- after checking the above conditions, because we may look at a
- symbol once, decide not to do anything, and then get called
- recursively later after REF_REGULAR is set below. */
- h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
-
- /* If this is a weak definition, and we know a real definition, and
- the real symbol is not itself defined by a regular object file,
- then get a good value for the real definition. We handle the
- real symbol first, for the convenience of the backend routine.
-
- Note that there is a confusing case here. If the real definition
- is defined by a regular object file, we don't get the real symbol
- from the dynamic object, but we do get the weak symbol. If the
- processor backend uses a COPY reloc, then if some routine in the
- dynamic object changes the real symbol, we will not see that
- change in the corresponding weak symbol. This is the way other
- ELF linkers work as well, and seems to be a result of the shared
- library model.
-
- I will clarify this issue. Most SVR4 shared libraries define the
- variable _timezone and define timezone as a weak synonym. The
- tzset call changes _timezone. If you write
- extern int timezone;
- int _timezone = 5;
- int main () { tzset (); printf ("%d %d\n", timezone, _timezone); }
- you might expect that, since timezone is a synonym for _timezone,
- the same number will print both times. However, if the processor
- backend uses a COPY reloc, then actually timezone will be copied
- into your process image, and, since you define _timezone
- yourself, _timezone will not. Thus timezone and _timezone will
- wind up at different memory locations. The tzset call will set
- _timezone, leaving timezone unchanged. */
-
- if (h->weakdef != NULL)
- {
- /* If we get to this point, we know there is an implicit
- reference by a regular object file via the weak symbol H.
- FIXME: Is this really true? What if the traversal finds
- H->WEAKDEF before it finds H? */
- h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
-
- if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif))
- return FALSE;
- }
-
- /* If a symbol has no type and no size and does not require a PLT
- entry, then we are probably about to do the wrong thing here: we
- are probably going to create a COPY reloc for an empty object.
- This case can arise when a shared object is built with assembly
- code, and the assembly code fails to set the symbol type. */
- if (h->size == 0
- && h->type == STT_NOTYPE
- && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
- (*_bfd_error_handler)
- (_("warning: type and size of dynamic symbol `%s' are not defined"),
- h->root.root.string);
-
- dynobj = elf_hash_table (eif->info)->dynobj;
- bed = get_elf_backend_data (dynobj);
- if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
- {
- eif->failed = TRUE;
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* Adjust all external symbols pointing into SEC_MERGE sections
- to reflect the object merging within the sections. */
-
-bfd_boolean
-_bfd_elf_link_sec_merge_syms (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- asection *sec;
-
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if ((h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && ((sec = h->root.u.def.section)->flags & SEC_MERGE)
- && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
- {
- bfd *output_bfd = (bfd *) data;
-
- h->root.u.def.value =
- _bfd_merged_section_offset (output_bfd,
- &h->root.u.def.section,
- elf_section_data (sec)->sec_info,
- h->root.u.def.value, (bfd_vma) 0);
- }
-
- return TRUE;
-}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 2c025edceee..61505e007a7 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -20,6 +20,16 @@
/* ELF linker code. */
+/* This struct is used to pass information to routines called via
+ elf_link_hash_traverse which must return failure. */
+
+struct elf_info_failed
+{
+ bfd_boolean failed;
+ struct bfd_link_info *info;
+ struct bfd_elf_version_tree *verdefs;
+};
+
static bfd_boolean is_global_data_symbol_definition
PARAMS ((bfd *, Elf_Internal_Sym *));
static bfd_boolean elf_link_is_defined_archive_symbol
@@ -28,12 +38,37 @@ static bfd_boolean elf_link_add_object_symbols
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf_link_add_archive_symbols
PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_merge_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, const char *,
+ Elf_Internal_Sym *, asection **, bfd_vma *,
+ struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *,
+ bfd_boolean *, bfd_boolean *, bfd_boolean));
+static bfd_boolean elf_add_default_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
+ bfd_boolean *, bfd_boolean, bfd_boolean));
+static bfd_boolean elf_export_symbol
+ PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_finalize_dynstr
PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf_fix_symbol_flags
+ PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
+static bfd_boolean elf_adjust_dynamic_symbol
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_link_find_version_dependencies
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_link_assign_sym_version
+ PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_collect_hash_codes
PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_link_read_relocs_from_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
static size_t compute_bucket_count
PARAMS ((struct bfd_link_info *));
+static bfd_boolean elf_link_output_relocs
+ PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+static bfd_boolean elf_link_size_reloc_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static void elf_link_adjust_relocs
PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int,
struct elf_link_hash_entry **));
@@ -415,6 +450,772 @@ elf_link_add_archive_symbols (abfd, info)
return FALSE;
}
+/* This function is called when we want to define a new symbol. It
+ handles the various cases which arise when we find a definition in
+ a dynamic object, or when there is already a definition in a
+ dynamic object. The new symbol is described by NAME, SYM, PSEC,
+ and PVALUE. We set SYM_HASH to the hash table entry. We set
+ OVERRIDE if the old symbol is overriding a new definition. We set
+ TYPE_CHANGE_OK if it is OK for the type to change. We set
+ SIZE_CHANGE_OK if it is OK for the size to change. By OK to
+ change, we mean that we shouldn't warn if the type or size does
+ change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of
+ a shared object. */
+
+static bfd_boolean
+elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip,
+ override, type_change_ok, size_change_ok, dt_needed)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection **psec;
+ bfd_vma *pvalue;
+ struct elf_link_hash_entry **sym_hash;
+ bfd_boolean *skip;
+ bfd_boolean *override;
+ bfd_boolean *type_change_ok;
+ bfd_boolean *size_change_ok;
+ bfd_boolean dt_needed;
+{
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry *flip;
+ int bind;
+ bfd *oldbfd;
+ bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
+
+ *skip = FALSE;
+ *override = FALSE;
+
+ sec = *psec;
+ bind = ELF_ST_BIND (sym->st_info);
+
+ if (! bfd_is_und_section (sec))
+ h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE);
+ else
+ h = ((struct elf_link_hash_entry *)
+ bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE));
+ if (h == NULL)
+ return FALSE;
+ *sym_hash = h;
+
+ /* This code is for coping with dynamic objects, and is only useful
+ if we are doing an ELF link. */
+ if (info->hash->creator != abfd->xvec)
+ return TRUE;
+
+ /* For merging, we only care about real symbols. */
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* If we just created the symbol, mark it as being an ELF symbol.
+ Other than that, there is nothing to do--there is no merge issue
+ with a newly defined symbol--so we just return. */
+
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
+ return TRUE;
+ }
+
+ /* OLDBFD is a BFD associated with the existing symbol. */
+
+ switch (h->root.type)
+ {
+ default:
+ oldbfd = NULL;
+ break;
+
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ oldbfd = h->root.u.undef.abfd;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ oldbfd = h->root.u.def.section->owner;
+ break;
+
+ case bfd_link_hash_common:
+ oldbfd = h->root.u.c.p->section->owner;
+ break;
+ }
+
+ /* In cases involving weak versioned symbols, we may wind up trying
+ to merge a symbol with itself. Catch that here, to avoid the
+ confusion that results if we try to override a symbol with
+ itself. The additional tests catch cases like
+ _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
+ dynamic object, which we do want to handle here. */
+ if (abfd == oldbfd
+ && ((abfd->flags & DYNAMIC) == 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ return TRUE;
+
+ /* NEWDYN and OLDDYN indicate whether the new or old symbol,
+ respectively, is from a dynamic object. */
+
+ if ((abfd->flags & DYNAMIC) != 0)
+ newdyn = TRUE;
+ else
+ newdyn = FALSE;
+
+ if (oldbfd != NULL)
+ olddyn = (oldbfd->flags & DYNAMIC) != 0;
+ else
+ {
+ asection *hsec;
+
+ /* This code handles the special SHN_MIPS_{TEXT,DATA} section
+ indices used by MIPS ELF. */
+ switch (h->root.type)
+ {
+ default:
+ hsec = NULL;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ hsec = h->root.u.def.section;
+ break;
+
+ case bfd_link_hash_common:
+ hsec = h->root.u.c.p->section;
+ break;
+ }
+
+ if (hsec == NULL)
+ olddyn = FALSE;
+ else
+ olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
+ }
+
+ /* NEWDEF and OLDDEF indicate whether the new or old symbol,
+ respectively, appear to be a definition rather than reference. */
+
+ if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
+ newdef = FALSE;
+ else
+ newdef = TRUE;
+
+ if (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_common)
+ olddef = FALSE;
+ else
+ olddef = TRUE;
+
+ /* We need to rememeber if a symbol has a definition in a dynamic
+ object or is weak in all dynamic objects. Internal and hidden
+ visibility will make it unavailable to dynamic objects. */
+ if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
+ {
+ if (!bfd_is_und_section (sec))
+ h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF;
+ else
+ {
+ /* Check if this symbol is weak in all dynamic objects. If it
+ is the first time we see it in a dynamic object, we mark
+ if it is weak. Otherwise, we clear it. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
+ {
+ if (bind == STB_WEAK)
+ h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK;
+ }
+ else if (bind != STB_WEAK)
+ h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK;
+ }
+ }
+
+ /* If the old symbol has non-default visibility, we ignore the new
+ definition from a dynamic object. */
+ if (newdyn
+ && ELF_ST_VISIBILITY (h->other)
+ && !bfd_is_und_section (sec))
+ {
+ *skip = TRUE;
+ /* Make sure this symbol is dynamic. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ /* FIXME: Should we check type and size for protected symbol? */
+ return _bfd_elf_link_record_dynamic_symbol (info, h);
+ }
+ else if (!newdyn
+ && ELF_ST_VISIBILITY (sym->st_other)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ {
+ /* If the new symbol with non-default visibility comes from a
+ relocatable file and the old definition comes from a dynamic
+ object, we remove the old definition. */
+ h->root.type = bfd_link_hash_new;
+ h->root.u.undef.abfd = NULL;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ /* FIXME: Should we check type and size for protected symbol? */
+ h->size = 0;
+ h->type = 0;
+ return TRUE;
+ }
+
+ /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
+ symbol, respectively, appears to be a common symbol in a dynamic
+ object. If a symbol appears in an uninitialized section, and is
+ not weak, and is not a function, then it may be a common symbol
+ which was resolved when the dynamic object was created. We want
+ to treat such symbols specially, because they raise special
+ considerations when setting the symbol size: if the symbol
+ appears as a common symbol in a regular object, and the size in
+ the regular object is larger, we must make sure that we use the
+ larger size. This problematic case can always be avoided in C,
+ but it must be handled correctly when using Fortran shared
+ libraries.
+
+ Note that if NEWDYNCOMMON is set, NEWDEF will be set, and
+ likewise for OLDDYNCOMMON and OLDDEF.
+
+ Note that this test is just a heuristic, and that it is quite
+ possible to have an uninitialized symbol in a shared object which
+ is really a definition, rather than a common symbol. This could
+ lead to some minor confusion when the symbol really is a common
+ symbol in some regular object. However, I think it will be
+ harmless. */
+
+ if (newdyn
+ && newdef
+ && (sec->flags & SEC_ALLOC) != 0
+ && (sec->flags & SEC_LOAD) == 0
+ && sym->st_size > 0
+ && bind != STB_WEAK
+ && ELF_ST_TYPE (sym->st_info) != STT_FUNC)
+ newdyncommon = TRUE;
+ else
+ newdyncommon = FALSE;
+
+ if (olddyn
+ && olddef
+ && h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->root.u.def.section->flags & SEC_ALLOC) != 0
+ && (h->root.u.def.section->flags & SEC_LOAD) == 0
+ && h->size > 0
+ && h->type != STT_FUNC)
+ olddyncommon = TRUE;
+ else
+ olddyncommon = FALSE;
+
+ /* It's OK to change the type if either the existing symbol or the
+ new symbol is weak unless it comes from a DT_NEEDED entry of
+ a shared object, in which case, the DT_NEEDED entry may not be
+ required at the run time. */
+
+ if ((! dt_needed && h->root.type == bfd_link_hash_defweak)
+ || h->root.type == bfd_link_hash_undefweak
+ || bind == STB_WEAK)
+ *type_change_ok = TRUE;
+
+ /* It's OK to change the size if either the existing symbol or the
+ new symbol is weak, or if the old symbol is undefined. */
+
+ if (*type_change_ok
+ || h->root.type == bfd_link_hash_undefined)
+ *size_change_ok = TRUE;
+
+ /* If both the old and the new symbols look like common symbols in a
+ dynamic object, set the size of the symbol to the larger of the
+ two. */
+
+ if (olddyncommon
+ && newdyncommon
+ && sym->st_size != h->size)
+ {
+ /* Since we think we have two common symbols, issue a multiple
+ common warning if desired. Note that we only warn if the
+ size is different. If the size is the same, we simply let
+ the old symbol override the new one as normally happens with
+ symbols defined in dynamic objects. */
+
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return FALSE;
+
+ if (sym->st_size > h->size)
+ h->size = sym->st_size;
+
+ *size_change_ok = TRUE;
+ }
+
+ /* If we are looking at a dynamic object, and we have found a
+ definition, we need to see if the symbol was already defined by
+ some other object. If so, we want to use the existing
+ definition, and we do not want to report a multiple symbol
+ definition error; we do this by clobbering *PSEC to be
+ bfd_und_section_ptr.
+
+ We treat a common symbol as a definition if the symbol in the
+ shared library is a function, since common symbols always
+ represent variables; this can cause confusion in principle, but
+ any such confusion would seem to indicate an erroneous program or
+ shared library. We also permit a common symbol in a regular
+ object to override a weak symbol in a shared object.
+
+ We prefer a non-weak definition in a shared library to a weak
+ definition in the executable unless it comes from a DT_NEEDED
+ entry of a shared object, in which case, the DT_NEEDED entry
+ may not be required at the run time. */
+
+ if (newdyn
+ && newdef
+ && (olddef
+ || (h->root.type == bfd_link_hash_common
+ && (bind == STB_WEAK
+ || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
+ && (h->root.type != bfd_link_hash_defweak
+ || dt_needed
+ || bind == STB_WEAK))
+ {
+ *override = TRUE;
+ newdef = FALSE;
+ newdyncommon = FALSE;
+
+ *psec = sec = bfd_und_section_ptr;
+ *size_change_ok = TRUE;
+
+ /* If we get here when the old symbol is a common symbol, then
+ we are explicitly letting it override a weak symbol or
+ function in a dynamic object, and we don't want to warn about
+ a type change. If the old symbol is a defined symbol, a type
+ change warning may still be appropriate. */
+
+ if (h->root.type == bfd_link_hash_common)
+ *type_change_ok = TRUE;
+ }
+
+ /* Handle the special case of an old common symbol merging with a
+ new symbol which looks like a common symbol in a shared object.
+ We change *PSEC and *PVALUE to make the new symbol look like a
+ common symbol, and let _bfd_generic_link_add_one_symbol will do
+ the right thing. */
+
+ if (newdyncommon
+ && h->root.type == bfd_link_hash_common)
+ {
+ *override = TRUE;
+ newdef = FALSE;
+ newdyncommon = FALSE;
+ *pvalue = sym->st_size;
+ *psec = sec = bfd_com_section_ptr;
+ *size_change_ok = TRUE;
+ }
+
+ /* If the old symbol is from a dynamic object, and the new symbol is
+ a definition which is not from a dynamic object, then the new
+ symbol overrides the old symbol. Symbols from regular files
+ always take precedence over symbols from dynamic objects, even if
+ they are defined after the dynamic object in the link.
+
+ As above, we again permit a common symbol in a regular object to
+ override a definition in a shared object if the shared object
+ symbol is a function or is weak.
+
+ As above, we permit a non-weak definition in a shared object to
+ override a weak definition in a regular object. */
+
+ flip = NULL;
+ if (! newdyn
+ && (newdef
+ || (bfd_is_com_section (sec)
+ && (h->root.type == bfd_link_hash_defweak
+ || h->type == STT_FUNC)))
+ && olddyn
+ && olddef
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (bind != STB_WEAK
+ || h->root.type == bfd_link_hash_defweak))
+ {
+ /* Change the hash table entry to undefined, and let
+ _bfd_generic_link_add_one_symbol do the right thing with the
+ new definition. */
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+ *size_change_ok = TRUE;
+
+ olddef = FALSE;
+ olddyncommon = FALSE;
+
+ /* We again permit a type change when a common symbol may be
+ overriding a function. */
+
+ if (bfd_is_com_section (sec))
+ *type_change_ok = TRUE;
+
+ if ((*sym_hash)->root.type == bfd_link_hash_indirect)
+ flip = *sym_hash;
+ else
+ /* This union may have been set to be non-NULL when this symbol
+ was seen in a dynamic object. We must force the union to be
+ NULL, so that it is correct for a regular symbol. */
+ h->verinfo.vertree = NULL;
+ }
+
+ /* Handle the special case of a new common symbol merging with an
+ old symbol that looks like it might be a common symbol defined in
+ a shared object. Note that we have already handled the case in
+ which a new common symbol should simply override the definition
+ in the shared library. */
+
+ if (! newdyn
+ && bfd_is_com_section (sec)
+ && olddyncommon)
+ {
+ /* It would be best if we could set the hash table entry to a
+ common symbol, but we don't know what to use for the section
+ or the alignment. */
+ if (! ((*info->callbacks->multiple_common)
+ (info, h->root.root.string, oldbfd, bfd_link_hash_common,
+ h->size, abfd, bfd_link_hash_common, sym->st_size)))
+ return FALSE;
+
+ /* If the predumed common symbol in the dynamic object is
+ larger, pretend that the new symbol has its size. */
+
+ if (h->size > *pvalue)
+ *pvalue = h->size;
+
+ /* FIXME: We no longer know the alignment required by the symbol
+ in the dynamic object, so we just wind up using the one from
+ the regular object. */
+
+ olddef = FALSE;
+ olddyncommon = FALSE;
+
+ h->root.type = bfd_link_hash_undefined;
+ h->root.u.undef.abfd = h->root.u.def.section->owner;
+
+ *size_change_ok = TRUE;
+ *type_change_ok = TRUE;
+
+ if ((*sym_hash)->root.type == bfd_link_hash_indirect)
+ flip = *sym_hash;
+ else
+ h->verinfo.vertree = NULL;
+ }
+
+ if (flip != NULL)
+ {
+ /* Handle the case where we had a versioned symbol in a dynamic
+ library and now find a definition in a normal object. In this
+ case, we make the versioned symbol point to the normal one. */
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ flip->root.type = h->root.type;
+ h->root.type = bfd_link_hash_indirect;
+ h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
+ (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h);
+ flip->root.u.undef.abfd = h->root.u.undef.abfd;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
+ flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ }
+ }
+
+ /* Handle the special case of a weak definition in a regular object
+ followed by a non-weak definition in a shared object. In this
+ case, we prefer the definition in the shared object unless it
+ comes from a DT_NEEDED entry of a shared object, in which case,
+ the DT_NEEDED entry may not be required at the run time. */
+ if (olddef
+ && ! dt_needed
+ && h->root.type == bfd_link_hash_defweak
+ && newdef
+ && newdyn
+ && bind != STB_WEAK)
+ {
+ /* To make this work we have to frob the flags so that the rest
+ of the code does not think we are using the regular
+ definition. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If H is the target of an indirection, we want the caller to
+ use H rather than the indirect symbol. Otherwise if we are
+ defining a new indirect symbol we will wind up attaching it
+ to the entry we are overriding. */
+ *sym_hash = h;
+ }
+
+ /* Handle the special case of a non-weak definition in a shared
+ object followed by a weak definition in a regular object. In
+ this case we prefer the definition in the shared object. To make
+ this work we have to tell the caller to not treat the new symbol
+ as a definition. */
+ if (olddef
+ && olddyn
+ && h->root.type != bfd_link_hash_defweak
+ && newdef
+ && ! newdyn
+ && bind == STB_WEAK)
+ *override = TRUE;
+
+ return TRUE;
+}
+
+/* This function is called to create an indirect symbol from the
+ default for the symbol with the default version if needed. The
+ symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We
+ set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED
+ indicates if it comes from a DT_NEEDED entry of a shared object. */
+
+static bfd_boolean
+elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
+ dynsym, override, dt_needed)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection **psec;
+ bfd_vma *value;
+ bfd_boolean *dynsym;
+ bfd_boolean override;
+ bfd_boolean dt_needed;
+{
+ bfd_boolean type_change_ok;
+ bfd_boolean size_change_ok;
+ bfd_boolean skip;
+ char *shortname;
+ struct elf_link_hash_entry *hi;
+ struct bfd_link_hash_entry *bh;
+ struct elf_backend_data *bed;
+ bfd_boolean collect;
+ bfd_boolean dynamic;
+ char *p;
+ size_t len, shortlen;
+ asection *sec;
+
+ /* If this symbol has a version, and it is the default version, we
+ create an indirect symbol from the default name to the fully
+ decorated name. This will cause external references which do not
+ specify a version to be bound to this version of the symbol. */
+ p = strchr (name, ELF_VER_CHR);
+ if (p == NULL || p[1] != ELF_VER_CHR)
+ return TRUE;
+
+ if (override)
+ {
+ /* We are overridden by an old defition. We need to check if we
+ need to create the indirect symbol from the default name. */
+ hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE,
+ FALSE, FALSE);
+ BFD_ASSERT (hi != NULL);
+ if (hi == h)
+ return TRUE;
+ while (hi->root.type == bfd_link_hash_indirect
+ || hi->root.type == bfd_link_hash_warning)
+ {
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+ if (hi == h)
+ return TRUE;
+ }
+ }
+
+ bed = get_elf_backend_data (abfd);
+ collect = bed->collect;
+ dynamic = (abfd->flags & DYNAMIC) != 0;
+
+ shortlen = p - name;
+ shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1);
+ if (shortname == NULL)
+ return FALSE;
+ memcpy (shortname, name, shortlen);
+ shortname[shortlen] = '\0';
+
+ /* We are going to create a new symbol. Merge it with any existing
+ symbol with this name. For the purposes of the merge, act as
+ though we were defining the symbol we just defined, although we
+ actually going to define an indirect symbol. */
+ type_change_ok = FALSE;
+ size_change_ok = FALSE;
+ sec = *psec;
+ if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
+ &hi, &skip, &override, &type_change_ok,
+ &size_change_ok, dt_needed))
+ return FALSE;
+
+ if (! override)
+ {
+ bh = &hi->root;
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
+ (bfd_vma) 0, name, FALSE, collect, &bh)))
+ return FALSE;
+ hi = (struct elf_link_hash_entry *) bh;
+ }
+ else
+ {
+ /* In this case the symbol named SHORTNAME is overriding the
+ indirect symbol we want to add. We were planning on making
+ SHORTNAME an indirect symbol referring to NAME. SHORTNAME
+ is the name without a version. NAME is the fully versioned
+ name, and it is the default version.
+
+ Overriding means that we already saw a definition for the
+ symbol SHORTNAME in a regular object, and it is overriding
+ the symbol defined in the dynamic object.
+
+ When this happens, we actually want to change NAME, the
+ symbol we just added, to refer to SHORTNAME. This will cause
+ references to NAME in the shared object to become references
+ to SHORTNAME in the regular object. This is what we expect
+ when we override a function in a shared object: that the
+ references in the shared object will be mapped to the
+ definition in the regular object. */
+
+ while (hi->root.type == bfd_link_hash_indirect
+ || hi->root.type == bfd_link_hash_warning)
+ hi = (struct elf_link_hash_entry *) hi->root.u.i.link;
+
+ h->root.type = bfd_link_hash_indirect;
+ h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
+ if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
+ hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ if (hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_DEF_REGULAR))
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
+ return FALSE;
+ }
+ }
+
+ /* Now set HI to H, so that the following code will set the
+ other fields correctly. */
+ hi = h;
+ }
+
+ /* If there is a duplicate definition somewhere, then HI may not
+ point to an indirect symbol. We will have reported an error to
+ the user in that case. */
+
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ struct elf_link_hash_entry *ht;
+
+ /* If the symbol became indirect, then we assume that we have
+ not seen a definition before. */
+ BFD_ASSERT ((hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR)) == 0);
+
+ ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
+ (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi);
+
+ /* See if the new flags lead us to realize that the symbol must
+ be dynamic. */
+ if (! *dynsym)
+ {
+ if (! dynamic)
+ {
+ if (info->shared
+ || ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ *dynsym = TRUE;
+ }
+ else
+ {
+ if ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0)
+ *dynsym = TRUE;
+ }
+ }
+ }
+
+ /* We also need to define an indirection from the nondefault version
+ of the symbol. */
+
+ len = strlen (name);
+ shortname = bfd_hash_allocate (&info->hash->table, len);
+ if (shortname == NULL)
+ return FALSE;
+ memcpy (shortname, name, shortlen);
+ memcpy (shortname + shortlen, p + 1, len - shortlen);
+
+ /* Once again, merge with any existing symbol. */
+ type_change_ok = FALSE;
+ size_change_ok = FALSE;
+ sec = *psec;
+ if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value,
+ &hi, &skip, &override, &type_change_ok,
+ &size_change_ok, dt_needed))
+ return FALSE;
+
+ if (override)
+ {
+ /* Here SHORTNAME is a versioned name, so we don't expect to see
+ the type of override we do in the case above unless it is
+ overridden by a versioned definiton. */
+ if (hi->root.type != bfd_link_hash_defined
+ && hi->root.type != bfd_link_hash_defweak)
+ (*_bfd_error_handler)
+ (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"),
+ bfd_archive_filename (abfd), shortname);
+ }
+ else
+ {
+ bh = &hi->root;
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, shortname, BSF_INDIRECT,
+ bfd_ind_section_ptr, (bfd_vma) 0, name, FALSE, collect, &bh)))
+ return FALSE;
+ hi = (struct elf_link_hash_entry *) bh;
+
+ /* If there is a duplicate definition somewhere, then HI may not
+ point to an indirect symbol. We will have reported an error
+ to the user in that case. */
+
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ /* If the symbol became indirect, then we assume that we have
+ not seen a definition before. */
+ BFD_ASSERT ((hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_DEF_REGULAR)) == 0);
+
+ (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
+
+ /* See if the new flags lead us to realize that the symbol
+ must be dynamic. */
+ if (! *dynsym)
+ {
+ if (! dynamic)
+ {
+ if (info->shared
+ || ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ *dynsym = TRUE;
+ }
+ else
+ {
+ if ((hi->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0)
+ *dynsym = TRUE;
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
/* Add symbols from an ELF object file to the linker hash table. */
static bfd_boolean
@@ -557,7 +1358,7 @@ elf_link_add_object_symbols (abfd, info)
&& ! hash_table->dynamic_sections_created
&& abfd->xvec == info->hash->creator)
{
- if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+ if (! elf_link_create_dynamic_sections (abfd, info))
goto error_return;
}
}
@@ -747,7 +1548,7 @@ elf_link_add_object_symbols (abfd, info)
/* If this is the first dynamic object found in the link, create
the special sections required for dynamic linking. */
if (! hash_table->dynamic_sections_created)
- if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+ if (! elf_link_create_dynamic_sections (abfd, info))
goto error_return;
if (add_needed)
@@ -1092,10 +1893,10 @@ elf_link_add_object_symbols (abfd, info)
}
}
- if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value,
- sym_hash, &skip, &override,
- &type_change_ok, &size_change_ok,
- dt_needed))
+ if (! elf_merge_symbol (abfd, info, name, isym, &sec, &value,
+ sym_hash, &skip, &override,
+ &type_change_ok, &size_change_ok,
+ dt_needed))
goto error_free_vers;
if (skip)
@@ -1345,9 +2146,9 @@ elf_link_add_object_symbols (abfd, info)
/* Check to see if we need to add an indirect symbol for
the default name. */
if (definition || h->root.type == bfd_link_hash_common)
- if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym,
- &sec, &value, &dynsym,
- override, dt_needed))
+ if (! elf_add_default_symbol (abfd, info, h, name, isym,
+ &sec, &value, &dynsym,
+ override, dt_needed))
goto error_free_vers;
if (definition && !dynamic)
@@ -1608,10 +2409,10 @@ elf_link_add_object_symbols (abfd, info)
|| bfd_is_abs_section (o->output_section))
continue;
- internal_relocs
- = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ internal_relocs = (NAME(_bfd_elf,link_read_relocs)
+ (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
@@ -1707,6 +2508,148 @@ elf_link_add_object_symbols (abfd, info)
return FALSE;
}
+/* Create some sections which will be filled in with dynamic linking
+ information. ABFD is an input file which requires dynamic sections
+ to be created. The dynamic sections take up virtual memory space
+ when the final executable is run, so we need to create them before
+ addresses are assigned to the output sections. We work out the
+ actual contents and size of these sections later. */
+
+bfd_boolean
+elf_link_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ flagword flags;
+ register asection *s;
+ struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh;
+ struct elf_backend_data *bed;
+
+ if (! is_elf_hash_table (info))
+ return FALSE;
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ return TRUE;
+
+ /* Make sure that all dynamic sections use the same input BFD. */
+ if (elf_hash_table (info)->dynobj == NULL)
+ elf_hash_table (info)->dynobj = abfd;
+ else
+ abfd = elf_hash_table (info)->dynobj;
+
+ /* Note that we set the SEC_IN_MEMORY flag for all of these
+ sections. */
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+
+ /* A dynamically linked executable has a .interp section, but a
+ shared library does not. */
+ if (! info->shared)
+ {
+ s = bfd_make_section (abfd, ".interp");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
+ return FALSE;
+ }
+
+ if (! info->traditional_format
+ && info->hash->creator->flavour == bfd_target_elf_flavour)
+ {
+ s = bfd_make_section (abfd, ".eh_frame_hdr");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return FALSE;
+ elf_hash_table (info)->eh_info.hdr_sec = s;
+ }
+
+ /* Create sections to hold version informations. These are removed
+ if they are not needed. */
+ s = bfd_make_section (abfd, ".gnu.version_d");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".gnu.version");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, 1))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".gnu.version_r");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".dynsym");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
+ return FALSE;
+
+ s = bfd_make_section (abfd, ".dynstr");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY))
+ return FALSE;
+
+ /* Create a strtab to hold the dynamic symbol names. */
+ if (elf_hash_table (info)->dynstr == NULL)
+ {
+ elf_hash_table (info)->dynstr = _bfd_elf_strtab_init ();
+ if (elf_hash_table (info)->dynstr == NULL)
+ return FALSE;
+ }
+
+ s = bfd_make_section (abfd, ".dynamic");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags)
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
+ return FALSE;
+
+ /* The special symbol _DYNAMIC is always set to the start of the
+ .dynamic section. This call occurs before we have processed the
+ symbols for any dynamic object, so we don't have to worry about
+ overriding a dynamic definition. We could set _DYNAMIC in a
+ linker script, but we only want to define it if we are, in fact,
+ creating a .dynamic section. We don't want to define it if there
+ is no .dynamic section, since on some ELF platforms the start up
+ code examines it to decide how to initialize the process. */
+ bh = NULL;
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
+ (const char *) 0, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
+ h = (struct elf_link_hash_entry *) bh;
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ h->type = STT_OBJECT;
+
+ if (info->shared
+ && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+
+ bed = get_elf_backend_data (abfd);
+
+ s = bfd_make_section (abfd, ".hash");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
+ return FALSE;
+ elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
+
+ /* Let the backend create the rest of the sections. This lets the
+ backend set the right flags. The backend will normally create
+ the .got and .plt sections. */
+ if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
+ return FALSE;
+
+ elf_hash_table (info)->dynamic_sections_created = TRUE;
+
+ return TRUE;
+}
+
/* Add an entry to the .dynamic table. */
bfd_boolean
@@ -1745,6 +2688,251 @@ elf_add_dynamic_entry (info, tag, val)
return TRUE;
}
+/* Read and swap the relocs from the section indicated by SHDR. This
+ may be either a REL or a RELA section. The relocations are
+ translated into RELA relocations and stored in INTERNAL_RELOCS,
+ which should have already been allocated to contain enough space.
+ The EXTERNAL_RELOCS are a buffer where the external form of the
+ relocations should be stored.
+
+ Returns FALSE if something goes wrong. */
+
+static bfd_boolean
+elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
+ internal_relocs)
+ bfd *abfd;
+ Elf_Internal_Shdr *shdr;
+ PTR external_relocs;
+ Elf_Internal_Rela *internal_relocs;
+{
+ struct elf_backend_data *bed;
+ void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ const bfd_byte *erela;
+ const bfd_byte *erelaend;
+ Elf_Internal_Rela *irela;
+
+ /* If there aren't any relocations, that's OK. */
+ if (!shdr)
+ return TRUE;
+
+ /* Position ourselves at the start of the section. */
+ if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
+ return FALSE;
+
+ /* Read the relocations. */
+ if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size)
+ return FALSE;
+
+ bed = get_elf_backend_data (abfd);
+
+ /* Convert the external relocations to the internal format. */
+ if (shdr->sh_entsize == sizeof (Elf_External_Rel))
+ swap_in = bed->s->swap_reloc_in;
+ else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
+ swap_in = bed->s->swap_reloca_in;
+ else
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return FALSE;
+ }
+
+ erela = external_relocs;
+ erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
+ irela = internal_relocs;
+ while (erela < erelaend)
+ {
+ (*swap_in) (abfd, erela, irela);
+ irela += bed->s->int_rels_per_ext_rel;
+ erela += shdr->sh_entsize;
+ }
+
+ return TRUE;
+}
+
+/* Read and swap the relocs for a section O. They may have been
+ cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
+ not NULL, they are used as buffers to read into. They are known to
+ be large enough. If the INTERNAL_RELOCS relocs argument is NULL,
+ the return value is allocated using either malloc or bfd_alloc,
+ according to the KEEP_MEMORY argument. If O has two relocation
+ sections (both REL and RELA relocations), then the REL_HDR
+ relocations will appear first in INTERNAL_RELOCS, followed by the
+ REL_HDR2 relocations. */
+
+Elf_Internal_Rela *
+NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
+ keep_memory)
+ bfd *abfd;
+ asection *o;
+ PTR external_relocs;
+ Elf_Internal_Rela *internal_relocs;
+ bfd_boolean keep_memory;
+{
+ Elf_Internal_Shdr *rel_hdr;
+ PTR alloc1 = NULL;
+ Elf_Internal_Rela *alloc2 = NULL;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
+ if (elf_section_data (o)->relocs != NULL)
+ return elf_section_data (o)->relocs;
+
+ if (o->reloc_count == 0)
+ return NULL;
+
+ rel_hdr = &elf_section_data (o)->rel_hdr;
+
+ if (internal_relocs == NULL)
+ {
+ bfd_size_type size;
+
+ size = o->reloc_count;
+ size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela);
+ if (keep_memory)
+ internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
+ else
+ internal_relocs = alloc2 = (Elf_Internal_Rela *) bfd_malloc (size);
+ if (internal_relocs == NULL)
+ goto error_return;
+ }
+
+ if (external_relocs == NULL)
+ {
+ bfd_size_type size = rel_hdr->sh_size;
+
+ if (elf_section_data (o)->rel_hdr2)
+ size += elf_section_data (o)->rel_hdr2->sh_size;
+ alloc1 = (PTR) bfd_malloc (size);
+ if (alloc1 == NULL)
+ goto error_return;
+ external_relocs = alloc1;
+ }
+
+ if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
+ external_relocs,
+ internal_relocs))
+ goto error_return;
+ if (!elf_link_read_relocs_from_section
+ (abfd,
+ elf_section_data (o)->rel_hdr2,
+ ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
+ internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr)
+ * bed->s->int_rels_per_ext_rel)))
+ goto error_return;
+
+ /* Cache the results for next time, if we can. */
+ if (keep_memory)
+ elf_section_data (o)->relocs = internal_relocs;
+
+ if (alloc1 != NULL)
+ free (alloc1);
+
+ /* Don't free alloc2, since if it was allocated we are passing it
+ back (under the name of internal_relocs). */
+
+ return internal_relocs;
+
+ error_return:
+ if (alloc1 != NULL)
+ free (alloc1);
+ if (alloc2 != NULL)
+ free (alloc2);
+ return NULL;
+}
+
+/* Record an assignment to a symbol made by a linker script. We need
+ this in case some dynamic object refers to this symbol. */
+
+bfd_boolean
+NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+ const char *name;
+ bfd_boolean provide;
+{
+ struct elf_link_hash_entry *h;
+
+ if (info->hash->creator->flavour != bfd_target_elf_flavour)
+ return TRUE;
+
+ h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE);
+ if (h == NULL)
+ return FALSE;
+
+ if (h->root.type == bfd_link_hash_new)
+ h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
+
+ /* If this symbol is being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular
+ object, then mark it as undefined so that the generic linker will
+ force the correct value. */
+ if (provide
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ h->root.type = bfd_link_hash_undefined;
+
+ /* If this symbol is not being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular object,
+ then clear out any version information because the symbol will not be
+ associated with the dynamic object any more. */
+ if (!provide
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ h->verinfo.verdef = NULL;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
+ if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
+ | ELF_LINK_HASH_REF_DYNAMIC)) != 0
+ || info->shared)
+ && h->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+
+ /* If this is a weak defined symbol, and we know a corresponding
+ real symbol from the same dynamic object, make sure the real
+ symbol is also made into a dynamic symbol. */
+ if (h->weakdef != NULL
+ && h->weakdef->dynindx == -1)
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* This structure is used to pass information to
+ elf_link_assign_sym_version. */
+
+struct elf_assign_sym_version_info
+{
+ /* Output BFD. */
+ bfd *output_bfd;
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* Version tree. */
+ struct bfd_elf_version_tree *verdefs;
+ /* Whether we had a failure. */
+ bfd_boolean failed;
+};
+
+/* This structure is used to pass information to
+ elf_link_find_version_dependencies. */
+
+struct elf_find_verdep_info
+{
+ /* Output BFD. */
+ bfd *output_bfd;
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* The number of dependencies. */
+ unsigned int vers;
+ /* Whether we had a failure. */
+ bfd_boolean failed;
+};
+
/* Array used to determine the number of hash table buckets to use
based on the number of symbols there are. If there are fewer than
3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets,
@@ -2040,8 +3228,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
table (this is not the normal case), then do so. */
if (info->export_dynamic)
{
- elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_export_symbol,
+ elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
(PTR) &eif);
if (eif.failed)
return FALSE;
@@ -2105,7 +3292,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
asvinfo.failed = FALSE;
elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_link_assign_sym_version,
+ elf_link_assign_sym_version,
(PTR) &asvinfo);
if (asvinfo.failed)
return FALSE;
@@ -2135,7 +3322,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
/* Find all symbols which were defined in a dynamic object and make
the backend pick a reasonable value for them. */
elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_adjust_dynamic_symbol,
+ elf_adjust_dynamic_symbol,
(PTR) &eif);
if (eif.failed)
return FALSE;
@@ -2464,7 +3651,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
sinfo.failed = FALSE;
elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_link_find_version_dependencies,
+ elf_link_find_version_dependencies,
(PTR) &sinfo);
if (elf_tdata (output_bfd)->verref == NULL)
@@ -2795,6 +3982,663 @@ elf_finalize_dynstr (output_bfd, info)
return TRUE;
}
+
+/* Fix up the flags for a symbol. This handles various cases which
+ can only be fixed after all the input files are seen. This is
+ currently called by both adjust_dynamic_symbol and
+ assign_sym_version, which is unnecessary but perhaps more robust in
+ the face of future changes. */
+
+static bfd_boolean
+elf_fix_symbol_flags (h, eif)
+ struct elf_link_hash_entry *h;
+ struct elf_info_failed *eif;
+{
+ /* If this symbol was mentioned in a non-ELF file, try to set
+ DEF_REGULAR and REF_REGULAR correctly. This is the only way to
+ permit a non-ELF file to correctly refer to a symbol defined in
+ an ELF dynamic object. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
+ {
+ while (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
+ else
+ {
+ if (h->root.u.def.section->owner != NULL
+ && (bfd_get_flavour (h->root.u.def.section->owner)
+ == bfd_target_elf_flavour))
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
+ else
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ }
+
+ if (h->dynindx == -1
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
+ was first seen in a non-ELF file. Fortunately, if the symbol
+ was first seen in an ELF file, we're probably OK unless the
+ symbol was defined in a non-ELF file. Catch that case here.
+ FIXME: We're still in trouble if the symbol was first seen in
+ a dynamic object, and then later in a non-ELF regular object. */
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->root.u.def.section->owner != NULL
+ ? (bfd_get_flavour (h->root.u.def.section->owner)
+ != bfd_target_elf_flavour)
+ : (bfd_is_abs_section (h->root.u.def.section)
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ }
+
+ /* If this is a final link, and the symbol was defined as a common
+ symbol in a regular object file, and there was no definition in
+ any dynamic object, then the linker will have allocated space for
+ the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
+ flag will not have been set. */
+ if (h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
+ /* If -Bsymbolic was used (which means to bind references to global
+ symbols to the definition within the shared object), and this
+ symbol was defined in a regular object, then it actually doesn't
+ need a PLT entry, and we can accomplish that by forcing it local.
+ Likewise, if the symbol has hidden or internal visibility.
+ FIXME: It might be that we also do not need a PLT for other
+ non-hidden visibilities, but we would have to tell that to the
+ backend specifically; we can't just clear PLT-related data here. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
+ && eif->info->shared
+ && is_elf_hash_table (eif->info)
+ && (eif->info->symbolic
+ || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+ || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ {
+ struct elf_backend_data *bed;
+ bfd_boolean force_local;
+
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+
+ force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+ || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
+ (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
+ }
+
+ /* If this is a weak defined symbol in a dynamic object, and we know
+ the real definition in the dynamic object, copy interesting flags
+ over to the real definition. */
+ if (h->weakdef != NULL)
+ {
+ struct elf_link_hash_entry *weakdef;
+
+ weakdef = h->weakdef;
+ if (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak);
+ BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
+ || weakdef->root.type == bfd_link_hash_defweak);
+ BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If the real definition is defined by a regular object file,
+ don't do anything special. See the longer description in
+ elf_adjust_dynamic_symbol, below. */
+ if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->weakdef = NULL;
+ else
+ {
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+ (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
+ }
+ }
+
+ return TRUE;
+}
+
+/* Make the backend pick a good value for a dynamic symbol. This is
+ called via elf_link_hash_traverse, and also calls itself
+ recursively. */
+
+static bfd_boolean
+elf_adjust_dynamic_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_info_failed *eif = (struct elf_info_failed *) data;
+ bfd *dynobj;
+ struct elf_backend_data *bed;
+
+ if (! is_elf_hash_table (eif->info))
+ return FALSE;
+
+ if (h->root.type == bfd_link_hash_warning)
+ {
+ h->plt = elf_hash_table (eif->info)->init_offset;
+ h->got = elf_hash_table (eif->info)->init_offset;
+
+ /* When warning symbols are created, they **replace** the "real"
+ entry in the hash table, thus we never get to see the real
+ symbol in a hash traversal. So look at it now. */
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ /* Fix the symbol flags. */
+ if (! elf_fix_symbol_flags (h, eif))
+ return FALSE;
+
+ /* If this symbol does not require a PLT entry, and it is not
+ defined by a dynamic object, or is not referenced by a regular
+ object, ignore it. We do have to handle a weak defined symbol,
+ even if no regular object refers to it, if we decided to add it
+ to the dynamic symbol table. FIXME: Do we normally need to worry
+ about symbols which are defined by one dynamic object and
+ referenced by another one? */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
+ && (h->weakdef == NULL || h->weakdef->dynindx == -1))))
+ {
+ h->plt = elf_hash_table (eif->info)->init_offset;
+ return TRUE;
+ }
+
+ /* If we've already adjusted this symbol, don't do it again. This
+ can happen via a recursive call. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
+ return TRUE;
+
+ /* Don't look at this symbol again. Note that we must set this
+ after checking the above conditions, because we may look at a
+ symbol once, decide not to do anything, and then get called
+ recursively later after REF_REGULAR is set below. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
+
+ /* If this is a weak definition, and we know a real definition, and
+ the real symbol is not itself defined by a regular object file,
+ then get a good value for the real definition. We handle the
+ real symbol first, for the convenience of the backend routine.
+
+ Note that there is a confusing case here. If the real definition
+ is defined by a regular object file, we don't get the real symbol
+ from the dynamic object, but we do get the weak symbol. If the
+ processor backend uses a COPY reloc, then if some routine in the
+ dynamic object changes the real symbol, we will not see that
+ change in the corresponding weak symbol. This is the way other
+ ELF linkers work as well, and seems to be a result of the shared
+ library model.
+
+ I will clarify this issue. Most SVR4 shared libraries define the
+ variable _timezone and define timezone as a weak synonym. The
+ tzset call changes _timezone. If you write
+ extern int timezone;
+ int _timezone = 5;
+ int main () { tzset (); printf ("%d %d\n", timezone, _timezone); }
+ you might expect that, since timezone is a synonym for _timezone,
+ the same number will print both times. However, if the processor
+ backend uses a COPY reloc, then actually timezone will be copied
+ into your process image, and, since you define _timezone
+ yourself, _timezone will not. Thus timezone and _timezone will
+ wind up at different memory locations. The tzset call will set
+ _timezone, leaving timezone unchanged. */
+
+ if (h->weakdef != NULL)
+ {
+ /* If we get to this point, we know there is an implicit
+ reference by a regular object file via the weak symbol H.
+ FIXME: Is this really true? What if the traversal finds
+ H->WEAKDEF before it finds H? */
+ h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+
+ if (! elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif))
+ return FALSE;
+ }
+
+ /* If a symbol has no type and no size and does not require a PLT
+ entry, then we are probably about to do the wrong thing here: we
+ are probably going to create a COPY reloc for an empty object.
+ This case can arise when a shared object is built with assembly
+ code, and the assembly code fails to set the symbol type. */
+ if (h->size == 0
+ && h->type == STT_NOTYPE
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ (*_bfd_error_handler)
+ (_("warning: type and size of dynamic symbol `%s' are not defined"),
+ h->root.root.string);
+
+ dynobj = elf_hash_table (eif->info)->dynobj;
+ bed = get_elf_backend_data (dynobj);
+ if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* This routine is used to export all defined symbols into the dynamic
+ symbol table. It is called via elf_link_hash_traverse. */
+
+static bfd_boolean
+elf_export_symbol (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_info_failed *eif = (struct elf_info_failed *) data;
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->root.type == bfd_link_hash_indirect)
+ return TRUE;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if (h->dynindx == -1
+ && (h->elf_link_hash_flags
+ & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
+ {
+ struct bfd_elf_version_tree *t;
+ struct bfd_elf_version_expr *d;
+
+ for (t = eif->verdefs; t != NULL; t = t->next)
+ {
+ if (t->globals != NULL)
+ {
+ for (d = t->globals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ goto doit;
+ }
+ }
+
+ if (t->locals != NULL)
+ {
+ for (d = t->locals ; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ return TRUE;
+ }
+ }
+ }
+
+ if (!eif->verdefs)
+ {
+ doit:
+ if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+ {
+ eif->failed = TRUE;
+ return FALSE;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+/* Look through the symbols which are defined in other shared
+ libraries and referenced here. Update the list of version
+ dependencies. This will be put into the .gnu.version_r section.
+ This function is called via elf_link_hash_traverse. */
+
+static bfd_boolean
+elf_link_find_version_dependencies (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_find_verdep_info *rinfo = (struct elf_find_verdep_info *) data;
+ Elf_Internal_Verneed *t;
+ Elf_Internal_Vernaux *a;
+ bfd_size_type amt;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* We only care about symbols defined in shared objects with version
+ information. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ || h->dynindx == -1
+ || h->verinfo.verdef == NULL)
+ return TRUE;
+
+ /* See if we already know about this version. */
+ for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
+ {
+ if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
+ continue;
+
+ for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+ if (a->vna_nodename == h->verinfo.verdef->vd_nodename)
+ return TRUE;
+
+ break;
+ }
+
+ /* This is a new version. Add it to tree we are building. */
+
+ if (t == NULL)
+ {
+ amt = sizeof *t;
+ t = (Elf_Internal_Verneed *) bfd_zalloc (rinfo->output_bfd, amt);
+ if (t == NULL)
+ {
+ rinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ t->vn_bfd = h->verinfo.verdef->vd_bfd;
+ t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
+ elf_tdata (rinfo->output_bfd)->verref = t;
+ }
+
+ amt = sizeof *a;
+ a = (Elf_Internal_Vernaux *) bfd_zalloc (rinfo->output_bfd, amt);
+
+ /* Note that we are copying a string pointer here, and testing it
+ above. If bfd_elf_string_from_elf_section is ever changed to
+ discard the string data when low in memory, this will have to be
+ fixed. */
+ a->vna_nodename = h->verinfo.verdef->vd_nodename;
+
+ a->vna_flags = h->verinfo.verdef->vd_flags;
+ a->vna_nextptr = t->vn_auxptr;
+
+ h->verinfo.verdef->vd_exp_refno = rinfo->vers;
+ ++rinfo->vers;
+
+ a->vna_other = h->verinfo.verdef->vd_exp_refno + 1;
+
+ t->vn_auxptr = a;
+
+ return TRUE;
+}
+
+/* Figure out appropriate versions for all the symbols. We may not
+ have the version number script until we have read all of the input
+ files, so until that point we don't know which symbols should be
+ local. This function is called via elf_link_hash_traverse. */
+
+static bfd_boolean
+elf_link_assign_sym_version (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct elf_assign_sym_version_info *sinfo;
+ struct bfd_link_info *info;
+ struct elf_backend_data *bed;
+ struct elf_info_failed eif;
+ char *p;
+ bfd_size_type amt;
+
+ sinfo = (struct elf_assign_sym_version_info *) data;
+ info = sinfo->info;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ /* Fix the symbol flags. */
+ eif.failed = FALSE;
+ eif.info = info;
+ if (! elf_fix_symbol_flags (h, &eif))
+ {
+ if (eif.failed)
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ /* We only need version numbers for symbols defined in regular
+ objects. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ return TRUE;
+
+ bed = get_elf_backend_data (sinfo->output_bfd);
+ p = strchr (h->root.root.string, ELF_VER_CHR);
+ if (p != NULL && h->verinfo.vertree == NULL)
+ {
+ struct bfd_elf_version_tree *t;
+ bfd_boolean hidden;
+
+ hidden = TRUE;
+
+ /* There are two consecutive ELF_VER_CHR characters if this is
+ not a hidden symbol. */
+ ++p;
+ if (*p == ELF_VER_CHR)
+ {
+ hidden = FALSE;
+ ++p;
+ }
+
+ /* If there is no version string, we can just return out. */
+ if (*p == '\0')
+ {
+ if (hidden)
+ h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
+ return TRUE;
+ }
+
+ /* Look for the version. If we find it, it is no longer weak. */
+ for (t = sinfo->verdefs; t != NULL; t = t->next)
+ {
+ if (strcmp (t->name, p) == 0)
+ {
+ size_t len;
+ char *alc;
+ struct bfd_elf_version_expr *d;
+
+ len = p - h->root.root.string;
+ alc = bfd_malloc ((bfd_size_type) len);
+ if (alc == NULL)
+ return FALSE;
+ memcpy (alc, h->root.root.string, len - 1);
+ alc[len - 1] = '\0';
+ if (alc[len - 2] == ELF_VER_CHR)
+ alc[len - 2] = '\0';
+
+ h->verinfo.vertree = t;
+ t->used = TRUE;
+ d = NULL;
+
+ if (t->globals != NULL)
+ {
+ for (d = t->globals; d != NULL; d = d->next)
+ if ((*d->match) (d, alc))
+ break;
+ }
+
+ /* See if there is anything to force this symbol to
+ local scope. */
+ if (d == NULL && t->locals != NULL)
+ {
+ for (d = t->locals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, alc))
+ {
+ if (h->dynindx != -1
+ && info->shared
+ && ! info->export_dynamic)
+ {
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+
+ break;
+ }
+ }
+ }
+
+ free (alc);
+ break;
+ }
+ }
+
+ /* If we are building an application, we need to create a
+ version node for this version. */
+ if (t == NULL && ! info->shared)
+ {
+ struct bfd_elf_version_tree **pp;
+ int version_index;
+
+ /* If we aren't going to export this symbol, we don't need
+ to worry about it. */
+ if (h->dynindx == -1)
+ return TRUE;
+
+ amt = sizeof *t;
+ t = ((struct bfd_elf_version_tree *)
+ bfd_alloc (sinfo->output_bfd, amt));
+ if (t == NULL)
+ {
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ t->next = NULL;
+ t->name = p;
+ t->globals = NULL;
+ t->locals = NULL;
+ t->deps = NULL;
+ t->name_indx = (unsigned int) -1;
+ t->used = TRUE;
+
+ version_index = 1;
+ /* Don't count anonymous version tag. */
+ if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0)
+ version_index = 0;
+ for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next)
+ ++version_index;
+ t->vernum = version_index;
+
+ *pp = t;
+
+ h->verinfo.vertree = t;
+ }
+ else if (t == NULL)
+ {
+ /* We could not find the version for a symbol when
+ generating a shared archive. Return an error. */
+ (*_bfd_error_handler)
+ (_("%s: undefined versioned symbol name %s"),
+ bfd_get_filename (sinfo->output_bfd), h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ sinfo->failed = TRUE;
+ return FALSE;
+ }
+
+ if (hidden)
+ h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
+ }
+
+ /* If we don't have a version for this symbol, see if we can find
+ something. */
+ if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
+ {
+ struct bfd_elf_version_tree *t;
+ struct bfd_elf_version_tree *local_ver;
+ struct bfd_elf_version_expr *d;
+
+ /* See if can find what version this symbol is in. If the
+ symbol is supposed to be local, then don't actually register
+ it. */
+ local_ver = NULL;
+ for (t = sinfo->verdefs; t != NULL; t = t->next)
+ {
+ if (t->globals != NULL)
+ {
+ bfd_boolean matched;
+
+ matched = FALSE;
+ for (d = t->globals; d != NULL; d = d->next)
+ {
+ if ((*d->match) (d, h->root.root.string))
+ {
+ if (d->symver)
+ matched = TRUE;
+ else
+ {
+ /* There is a version without definition. Make
+ the symbol the default definition for this
+ version. */
+ h->verinfo.vertree = t;
+ local_ver = NULL;
+ d->script = 1;
+ break;
+ }
+ }
+ }
+
+ if (d != NULL)
+ break;
+ else if (matched)
+ /* There is no undefined version for this symbol. Hide the
+ default one. */
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+
+ if (t->locals != NULL)
+ {
+ for (d = t->locals; d != NULL; d = d->next)
+ {
+ /* If the match is "*", keep looking for a more
+ explicit, perhaps even global, match. */
+ if (d->pattern[0] == '*' && d->pattern[1] == '\0')
+ local_ver = t;
+ else if ((*d->match) (d, h->root.root.string))
+ {
+ local_ver = t;
+ break;
+ }
+ }
+
+ if (d != NULL)
+ break;
+ }
+ }
+
+ if (local_ver != NULL)
+ {
+ h->verinfo.vertree = local_ver;
+ if (h->dynindx != -1
+ && info->shared
+ && ! info->export_dynamic)
+ {
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ }
+ }
+ }
+
+ return TRUE;
+}
/* Final phase of ELF linker. */
@@ -2855,6 +4699,8 @@ static bfd_boolean elf_link_flush_output_syms
PARAMS ((struct elf_final_link_info *));
static bfd_boolean elf_link_output_extsym
PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf_link_sec_merge_syms
+ PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean elf_link_check_versioned_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static bfd_boolean elf_link_input_bfd
@@ -2872,6 +4718,58 @@ struct elf_outext_info
struct elf_final_link_info *finfo;
};
+/* Compute the size of, and allocate space for, REL_HDR which is the
+ section header for a section containing relocations for O. */
+
+static bfd_boolean
+elf_link_size_reloc_section (abfd, rel_hdr, o)
+ bfd *abfd;
+ Elf_Internal_Shdr *rel_hdr;
+ asection *o;
+{
+ bfd_size_type reloc_count;
+ bfd_size_type num_rel_hashes;
+
+ /* Figure out how many relocations there will be. */
+ if (rel_hdr == &elf_section_data (o)->rel_hdr)
+ reloc_count = elf_section_data (o)->rel_count;
+ else
+ reloc_count = elf_section_data (o)->rel_count2;
+
+ num_rel_hashes = o->reloc_count;
+ if (num_rel_hashes < reloc_count)
+ num_rel_hashes = reloc_count;
+
+ /* That allows us to calculate the size of the section. */
+ rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count;
+
+ /* The contents field must last into write_object_contents, so we
+ allocate it with bfd_alloc rather than malloc. Also since we
+ cannot be sure that the contents will actually be filled in,
+ we zero the allocated space. */
+ rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size);
+ if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+ return FALSE;
+
+ /* We only allocate one set of hash entries, so we only do it the
+ first time we are called. */
+ if (elf_section_data (o)->rel_hashes == NULL
+ && num_rel_hashes)
+ {
+ struct elf_link_hash_entry **p;
+
+ p = ((struct elf_link_hash_entry **)
+ bfd_zmalloc (num_rel_hashes
+ * sizeof (struct elf_link_hash_entry *)));
+ if (p == NULL)
+ return FALSE;
+
+ elf_section_data (o)->rel_hashes = p;
+ }
+
+ return TRUE;
+}
+
/* When performing a relocateable link, the input relocations are
preserved. But, if they reference global symbols, the indices
referenced must be updated. Update all the relocations in
@@ -3240,10 +5138,9 @@ elf_bfd_final_link (abfd, info)
{
Elf_Internal_Rela * relocs;
- relocs
- = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relocs = (NAME(_bfd_elf,link_read_relocs)
+ (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL, info->keep_memory));
reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
@@ -3361,7 +5258,7 @@ elf_bfd_final_link (abfd, info)
if (! info->relocateable && merged)
elf_link_hash_traverse (elf_hash_table (info),
- _bfd_elf_link_sec_merge_syms, (PTR) abfd);
+ elf_link_sec_merge_syms, (PTR) abfd);
/* Figure out the file positions for everything but the symbol table
and the relocs. We set symcount to force assign_section_numbers
@@ -3377,13 +5274,15 @@ elf_bfd_final_link (abfd, info)
{
if ((o->flags & SEC_RELOC) != 0)
{
- if (!(_bfd_elf_link_size_reloc_section
- (abfd, &elf_section_data (o)->rel_hdr, o)))
+ if (!elf_link_size_reloc_section (abfd,
+ &elf_section_data (o)->rel_hdr,
+ o))
goto error_return;
if (elf_section_data (o)->rel_hdr2
- && !(_bfd_elf_link_size_reloc_section
- (abfd, elf_section_data (o)->rel_hdr2, o)))
+ && !elf_link_size_reloc_section (abfd,
+ elf_section_data (o)->rel_hdr2,
+ o))
goto error_return;
}
@@ -3408,7 +5307,7 @@ elf_bfd_final_link (abfd, info)
/* sh_link is set in assign_section_numbers. */
/* sh_info is set below. */
/* sh_offset is set just below. */
- symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
+ symtab_hdr->sh_addralign = bed->s->file_align;
off = elf_tdata (abfd)->next_file_pos;
off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE);
@@ -4018,7 +5917,7 @@ elf_bfd_final_link (abfd, info)
if ((o->flags & SEC_LINKER_CREATED) == 0)
{
/* At this point, we are only interested in sections
- created by _bfd_elf_link_create_dynamic_sections. */
+ created by elf_link_create_dynamic_sections. */
continue;
}
if ((elf_section_data (o->output_section)->this_hdr.sh_type
@@ -4225,47 +6124,53 @@ elf_link_flush_output_syms (finfo)
return TRUE;
}
+/* Adjust all external symbols pointing into SEC_MERGE sections
+ to reflect the object merging within the sections. */
+
+static bfd_boolean
+elf_link_sec_merge_syms (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ asection *sec;
+
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && ((sec = h->root.u.def.section)->flags & SEC_MERGE)
+ && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+ {
+ bfd *output_bfd = (bfd *) data;
+
+ h->root.u.def.value =
+ _bfd_merged_section_offset (output_bfd,
+ &h->root.u.def.section,
+ elf_section_data (sec)->sec_info,
+ h->root.u.def.value, (bfd_vma) 0);
+ }
+
+ return TRUE;
+}
+
/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in
allowing an unsatisfied unversioned symbol in the DSO to match a
- versioned symbol that would normally require an explicit version.
- We also handle the case that a DSO references a hidden symbol
- which may be satisfied by a versioned symbol in another DSO. */
+ versioned symbol that would normally require an explicit version. */
static bfd_boolean
elf_link_check_versioned_symbol (info, h)
struct bfd_link_info *info;
struct elf_link_hash_entry *h;
{
- bfd *abfd;
+ bfd *undef_bfd = h->root.u.undef.abfd;
struct elf_link_loaded_list *loaded;
- if (info->hash->creator->flavour != bfd_target_elf_flavour)
+ if ((undef_bfd->flags & DYNAMIC) == 0
+ || info->hash->creator->flavour != bfd_target_elf_flavour
+ || elf_dt_soname (undef_bfd) == NULL)
return FALSE;
- switch (h->root.type)
- {
- default:
- abfd = NULL;
- break;
-
- case bfd_link_hash_undefined:
- case bfd_link_hash_undefweak:
- abfd = h->root.u.undef.abfd;
- if ((abfd->flags & DYNAMIC) == 0 || elf_dt_soname (abfd) == NULL)
- return FALSE;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- abfd = h->root.u.def.section->owner;
- break;
-
- case bfd_link_hash_common:
- abfd = h->root.u.c.p->section->owner;
- break;
- }
- BFD_ASSERT (abfd != NULL);
-
for (loaded = elf_hash_table (info)->loaded;
loaded != NULL;
loaded = loaded->next)
@@ -4285,7 +6190,7 @@ elf_link_check_versioned_symbol (info, h)
input = loaded->abfd;
/* We check each DSO for a possible hidden versioned definition. */
- if (input == abfd
+ if (input == undef_bfd
|| (input->flags & DYNAMIC) == 0
|| elf_dynversym (input) == 0)
continue;
@@ -4437,8 +6342,7 @@ elf_link_output_extsym (h, data)
&& (h->elf_link_hash_flags
& (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC
| ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
- == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
- && ! elf_link_check_versioned_symbol (finfo->info, h))
+ == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC))
{
(*_bfd_error_handler)
(_("%s: %s symbol `%s' in %s is referenced by DSO"),
@@ -4578,9 +6482,7 @@ elf_link_output_extsym (h, data)
forced local syms when non-shared is due to a historical quirk. */
if ((h->dynindx != -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
- && ((finfo->info->shared
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && (finfo->info->shared
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
@@ -4710,6 +6612,81 @@ elf_link_output_extsym (h, data)
return TRUE;
}
+/* Copy the relocations indicated by the INTERNAL_RELOCS (which
+ originated from the section given by INPUT_REL_HDR) to the
+ OUTPUT_BFD. */
+
+static bfd_boolean
+elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
+ internal_relocs)
+ bfd *output_bfd;
+ asection *input_section;
+ Elf_Internal_Shdr *input_rel_hdr;
+ Elf_Internal_Rela *internal_relocs;
+{
+ Elf_Internal_Rela *irela;
+ Elf_Internal_Rela *irelaend;
+ bfd_byte *erel;
+ Elf_Internal_Shdr *output_rel_hdr;
+ asection *output_section;
+ unsigned int *rel_countp = NULL;
+ struct elf_backend_data *bed;
+ void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+
+ output_section = input_section->output_section;
+ output_rel_hdr = NULL;
+
+ if (elf_section_data (output_section)->rel_hdr.sh_entsize
+ == input_rel_hdr->sh_entsize)
+ {
+ output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
+ rel_countp = &elf_section_data (output_section)->rel_count;
+ }
+ else if (elf_section_data (output_section)->rel_hdr2
+ && (elf_section_data (output_section)->rel_hdr2->sh_entsize
+ == input_rel_hdr->sh_entsize))
+ {
+ output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
+ rel_countp = &elf_section_data (output_section)->rel_count2;
+ }
+ else
+ {
+ (*_bfd_error_handler)
+ (_("%s: relocation size mismatch in %s section %s"),
+ bfd_get_filename (output_bfd),
+ bfd_archive_filename (input_section->owner),
+ input_section->name);
+ bfd_set_error (bfd_error_wrong_object_format);
+ return FALSE;
+ }
+
+ bed = get_elf_backend_data (output_bfd);
+ if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+ swap_out = bed->s->swap_reloc_out;
+ else if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela))
+ swap_out = bed->s->swap_reloca_out;
+ else
+ abort ();
+
+ erel = output_rel_hdr->contents;
+ erel += *rel_countp * input_rel_hdr->sh_entsize;
+ irela = internal_relocs;
+ irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
+ * bed->s->int_rels_per_ext_rel);
+ while (irela < irelaend)
+ {
+ (*swap_out) (output_bfd, irela, erel);
+ irela += bed->s->int_rels_per_ext_rel;
+ erel += input_rel_hdr->sh_entsize;
+ }
+
+ /* Bump the counter, so that we know where to add the next set of
+ relocations. */
+ *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr);
+
+ return TRUE;
+}
+
/* Link an input file into the linker output file. This function
handles all the sections and relocations of the input file at once.
This is so that we only have to read the local symbols once, and
@@ -4930,7 +6907,7 @@ elf_link_input_bfd (finfo, input_bfd)
if ((o->flags & SEC_LINKER_CREATED) != 0)
{
- /* Section was created by _bfd_elf_link_create_dynamic_sections
+ /* Section was created by elf_link_create_dynamic_sections
or somesuch. */
continue;
}
@@ -4954,9 +6931,9 @@ elf_link_input_bfd (finfo, input_bfd)
Elf_Internal_Rela *internal_relocs;
/* Get the swapped relocs. */
- internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
- finfo->internal_relocs, FALSE);
+ internal_relocs = (NAME(_bfd_elf,link_read_relocs)
+ (input_bfd, o, finfo->external_relocs,
+ finfo->internal_relocs, FALSE));
if (internal_relocs == NULL
&& o->reloc_count > 0)
return FALSE;
@@ -5273,7 +7250,7 @@ elf_link_input_bfd (finfo, input_bfd)
|| finfo->info->emitrelocations))
reloc_emitter = bed->elf_backend_emit_relocs;
else
- reloc_emitter = _bfd_elf_link_output_relocs;
+ reloc_emitter = elf_link_output_relocs;
if (input_rel_hdr->sh_size != 0
&& ! (*reloc_emitter) (output_bfd, o, input_rel_hdr,
@@ -5847,9 +7824,9 @@ elf_gc_mark (info, sec, gc_mark_hook)
}
/* Read the relocations. */
- relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ relstart = (NAME(_bfd_elf,link_read_relocs)
+ (input_bfd, sec, NULL, (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
if (relstart == NULL)
{
ret = FALSE;
@@ -5952,10 +7929,8 @@ elf_gc_sweep (info, gc_sweep_hook)
Elf_Internal_Rela *internal_relocs;
bfd_boolean r;
- internal_relocs
- = _bfd_elf_link_read_relocs (o->owner, o, NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ internal_relocs = (NAME(_bfd_elf,link_read_relocs)
+ (o->owner, o, NULL, NULL, info->keep_memory));
if (internal_relocs == NULL)
return FALSE;
@@ -6053,9 +8028,9 @@ elf_gc_propagate_vtable_entries_used (h, okp)
{
asection *sec = h->root.u.def.section;
struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
- unsigned int log_file_align = bed->s->log_file_align;
+ int file_align = bed->s->file_align;
- n = h->vtable_parent->vtable_entries_size >> log_file_align;
+ n = h->vtable_parent->vtable_entries_size / file_align;
while (n--)
{
if (*pu)
@@ -6078,7 +8053,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
bfd_vma hstart, hend;
Elf_Internal_Rela *relstart, *relend, *rel;
struct elf_backend_data *bed;
- unsigned int log_file_align;
+ int file_align;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -6095,12 +8070,12 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
hstart = h->root.u.def.value;
hend = hstart + h->size;
- relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL,
- (Elf_Internal_Rela *) NULL, TRUE);
+ relstart = (NAME(_bfd_elf,link_read_relocs)
+ (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, TRUE));
if (!relstart)
return *(bfd_boolean *) okp = FALSE;
bed = get_elf_backend_data (sec->owner);
- log_file_align = bed->s->log_file_align;
+ file_align = bed->s->file_align;
relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
@@ -6111,7 +8086,7 @@ elf_gc_smash_unused_vtentry_relocs (h, okp)
if (h->vtable_entries_used
&& (rel->r_offset - hstart) < h->vtable_entries_size)
{
- bfd_vma entry = (rel->r_offset - hstart) >> log_file_align;
+ bfd_vma entry = (rel->r_offset - hstart) / file_align;
if (h->vtable_entries_used[entry])
continue;
}
@@ -6246,7 +8221,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
bfd_vma addend;
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- unsigned int log_file_align = bed->s->log_file_align;
+ int file_align = bed->s->file_align;
if (addend >= h->vtable_entries_size)
{
@@ -6270,7 +8245,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
/* Allocate one extra entry for use as a "done" flag for the
consolidation pass. */
- bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean);
+ bytes = (size / file_align + 1) * sizeof (bfd_boolean);
if (ptr)
{
@@ -6280,7 +8255,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
{
size_t oldbytes;
- oldbytes = (((h->vtable_entries_size >> log_file_align) + 1)
+ oldbytes = ((h->vtable_entries_size / file_align + 1)
* sizeof (bfd_boolean));
memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes);
}
@@ -6296,7 +8271,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
h->vtable_entries_size = size;
}
- h->vtable_entries_used[addend >> log_file_align] = TRUE;
+ h->vtable_entries_used[addend / file_align] = TRUE;
return TRUE;
}
@@ -6592,10 +8567,9 @@ elf_bfd_discard_info (output_bfd, info)
cookie.rels = NULL;
count = stab->reloc_count;
if (count != 0)
- cookie.rels
- = _bfd_elf_link_read_relocs (abfd, stab, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ cookie.rels = (NAME(_bfd_elf,link_read_relocs)
+ (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
if (cookie.rels != NULL)
{
cookie.rel = cookie.rels;
@@ -6616,10 +8590,9 @@ elf_bfd_discard_info (output_bfd, info)
cookie.rels = NULL;
count = eh->reloc_count;
if (count != 0)
- cookie.rels
- = _bfd_elf_link_read_relocs (abfd, eh, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ cookie.rels = (NAME(_bfd_elf,link_read_relocs)
+ (abfd, eh, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
cookie.rel = cookie.rels;
cookie.relend = cookie.rels;
if (cookie.rels != NULL)
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index ab2ff21c887..946157fd7bc 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -720,7 +720,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Load the relocations for this section. */
- internal_relocs = (_bfd_elf_link_read_relocs
+ internal_relocs = (_bfd_elfNN_link_read_relocs
(abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
@@ -796,7 +796,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
goto error_return;
}
- isym = isymbuf + ELFNN_R_SYM (irel->r_info);
+ isym = isymbuf + ELF64_R_SYM (irel->r_info);
if (isym->st_shndx == SHN_UNDEF)
continue; /* We can't do anthing with undefined symbols. */
else if (isym->st_shndx == SHN_ABS)
@@ -1089,7 +1089,7 @@ elfNN_ia64_relax_ldxmov (abfd, contents, off)
case 0: shift = 5; break;
case 1: shift = 14; off += 3; break;
case 2: shift = 23; off += 6; break;
- default:
+ case 3:
abort ();
}
@@ -1466,7 +1466,7 @@ elfNN_ia64_aix_link_add_symbols (abfd, info)
if (! elf_hash_table (info)->dynamic_sections_created
&& abfd->xvec == info->hash->creator)
{
- if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+ if (! bfd_elfNN_link_create_dynamic_sections (abfd, info))
return FALSE;
}
@@ -1792,10 +1792,7 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local)
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
- {
- dyn_i->want_plt2 = 0;
- dyn_i->want_plt = 0;
- }
+ dyn_i->want_plt2 = 0;
}
/* Create the derived linker hash table. The IA-64 ELF port uses this
@@ -2638,10 +2635,7 @@ allocate_fptr (dyn_i, data)
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if ((x->info->shared
- && (!h
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ if (x->info->shared
/* AIX needs an FPTR in this case. */
|| (elfNN_ia64_aix_vec (x->info->hash->creator)
&& (!h
@@ -2766,18 +2760,15 @@ allocate_dynrel_entries (dyn_i, data)
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
struct elfNN_ia64_link_hash_table *ia64_info;
struct elfNN_ia64_dyn_reloc_entry *rent;
- bfd_boolean dynamic_symbol, shared, resolved_zero;
+ bfd_boolean dynamic_symbol, shared;
ia64_info = elfNN_ia64_hash_table (x->info);
dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)
|| (elfNN_ia64_aix_vec (x->info->hash->creator)
/* Don't allocate an entry for __GLOB_DATA_PTR */
&& (!dyn_i->h || strcmp (dyn_i->h->root.root.string,
- "__GLOB_DATA_PTR") != 0));
+ "__GLOB_DATA_PTR") != 0));
shared = x->info->shared;
- resolved_zero = (dyn_i->h
- && ELF_ST_VISIBILITY (dyn_i->h->other)
- && dyn_i->h->root.type == bfd_link_hash_undefweak);
/* Take care of the normal data relocations. */
@@ -2822,12 +2813,8 @@ allocate_dynrel_entries (dyn_i, data)
/* Take care of the GOT and PLT relocations. */
- if ((!resolved_zero
- && (dynamic_symbol || shared)
- && (dyn_i->want_got || dyn_i->want_gotx))
- || (dyn_i->want_ltoff_fptr
- && dyn_i->h
- && dyn_i->h->dynindx != -1))
+ if (((dynamic_symbol || shared) && (dyn_i->want_got || dyn_i->want_gotx))
+ || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1))
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
if ((dynamic_symbol || shared) && dyn_i->want_tprel)
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
@@ -2836,7 +2823,7 @@ allocate_dynrel_entries (dyn_i, data)
if (dynamic_symbol && dyn_i->want_dtprel)
ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
- if (!resolved_zero && dyn_i->want_pltoff)
+ if (dyn_i->want_pltoff)
{
bfd_size_type t = 0;
@@ -3444,11 +3431,7 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type)
bfd_put_64 (abfd, value, got_sec->contents + got_offset);
/* Install a dynamic relocation if needed. */
- if ((info->shared
- && (!dyn_i->h
- || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
- || dyn_i->h->root.type != bfd_link_hash_undefweak)
- && dyn_r_type != R_IA64_DTPREL64LSB)
+ if ((info->shared && dyn_r_type != R_IA64_DTPREL64LSB)
|| elfNN_ia64_dynamic_symbol_p (dyn_i->h, info)
|| elfNN_ia64_aix_vec (abfd->xvec)
|| (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB))
@@ -3569,11 +3552,7 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt)
bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8);
/* Install dynamic relocations if needed. */
- if (!is_plt
- && info->shared
- && (!dyn_i->h
- || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
- || dyn_i->h->root.type != bfd_link_hash_undefweak))
+ if (!is_plt && info->shared)
{
unsigned int dyn_r_type;
@@ -3893,7 +3872,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
asection *sym_sec;
bfd_byte *hit_addr;
bfd_boolean dynamic_symbol_p;
- bfd_boolean local_symbol_p;
bfd_boolean undef_weak_ref;
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -4005,11 +3983,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
hit_addr = contents + rel->r_offset;
value += rel->r_addend;
dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info);
- /* Is this symbol locally defined? A protected symbol is locallly
- defined. But its function descriptor may not. Use it with
- caution. */
- local_symbol_p = (! dynamic_symbol_p
- || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);
switch (r_type)
{
@@ -4042,7 +4015,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* If we don't need dynamic symbol lookup, find a
matching RELATIVE relocation. */
dyn_r_type = r_type;
- if (! local_symbol_p)
+ if (dynamic_symbol_p)
{
dynindx = h->dynindx;
addend = rel->r_addend;
@@ -4371,7 +4344,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* If we don't need dynamic symbol lookup, install two
RELATIVE relocations. */
- if (local_symbol_p)
+ if (! dynamic_symbol_p)
{
unsigned int dyn_r_type;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 72516f71f1c..0c3a5d96fca 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -542,7 +542,7 @@ static bfd *reldyn_sorting_bfd;
/* The default alignment for sections, as a power of two. */
#define MIPS_ELF_LOG_FILE_ALIGN(abfd) \
- (get_elf_backend_data (abfd)->s->log_file_align)
+ (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2)
/* Get word-sized data. */
#define MIPS_ELF_GET_WORD(abfd, ptr) \
@@ -5106,10 +5106,10 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
sizeof CALL_FP_STUB - 1) == 0)
continue;
- sec_relocs
- = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ sec_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs)
+ (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
if (sec_relocs == NULL)
return FALSE;
@@ -5561,9 +5561,9 @@ _bfd_mips_relax_section (abfd, sec, link_info, again)
if (link_info->relocateable)
return TRUE;
- internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- link_info->keep_memory);
+ internal_relocs = (MNAME(abfd,_bfd_elf,link_read_relocs)
+ (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory));
if (internal_relocs == NULL)
return TRUE;
@@ -7887,9 +7887,10 @@ _bfd_mips_elf_discard_info (abfd, cookie, info)
if (! tdata)
return FALSE;
- cookie->rels = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
- (Elf_Internal_Rela *) NULL,
- info->keep_memory);
+ cookie->rels = (MNAME(abfd,_bfd_elf,link_read_relocs)
+ (abfd, o, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
if (!cookie->rels)
{
free (tdata);
@@ -9173,25 +9174,12 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
/* Check if we have the same endianess */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
- {
- (*_bfd_error_handler)
- (_("%s: endianness incompatible with that of the selected emulation"),
- bfd_archive_filename (ibfd));
- return FALSE;
- }
+ return FALSE;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
return TRUE;
- if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0)
- {
- (*_bfd_error_handler)
- (_("%s: ABI is incompatible with that of the selected emulation"),
- bfd_archive_filename (ibfd));
- return FALSE;
- }
-
new_flags = elf_elfheader (ibfd)->e_flags;
elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_NOREORDER;
old_flags = elf_elfheader (obfd)->e_flags;
diff --git a/bfd/version.h b/bfd/version.h
index 235b6c252c1..7939c0d8c4d 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030509
+#define BFD_VERSION_DATE 20030504
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c
index 761e5c6bb69..ffbef53dfd4 100644
--- a/bfd/xtensa-isa.c
+++ b/bfd/xtensa-isa.c
@@ -159,7 +159,7 @@ configuration.\n"
static int
xtensa_add_isa (xtensa_isa_internal *isa, libisa_module_specifier libisa)
{
- int (*get_num_opcodes_fn) (void);
+ const int (*get_num_opcodes_fn) (void);
struct config_struct *(*get_config_table_fn) (void);
xtensa_opcode_internal **(*get_opcodes_fn) (void);
int (*decode_insn_fn) (const xtensa_insnbuf);
diff --git a/bfd/xtensa-modules.c b/bfd/xtensa-modules.c
index e5d7682f09a..d023b5233e1 100644
--- a/bfd/xtensa-modules.c
+++ b/bfd/xtensa-modules.c
@@ -41,7 +41,7 @@ tie_undo_reloc_l (uint32 offset, uint32 pc)
}
xtensa_opcode_internal** get_opcodes (void);
-int get_num_opcodes (void);
+const int get_num_opcodes (void);
int decode_insn (const xtensa_insnbuf);
int interface_version (void);
@@ -5463,7 +5463,7 @@ get_opcodes (void)
return &opcodes[0];
}
-int
+const int
get_num_opcodes (void)
{
return 149;
diff --git a/config-ml.in b/config-ml.in
index e227500c4a0..e69de29bb2d 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -1,847 +0,0 @@
-# Configure fragment invoked in the post-target section for subdirs
-# wanting multilib support.
-#
-# It is advisable to support a few --enable/--disable options to let the
-# user select which libraries s/he really wants.
-#
-# Subdirectories wishing to use multilib should put the following lines
-# in the "post-target" section of configure.in.
-#
-# if [ "${srcdir}" = "." ] ; then
-# if [ "${with_target_subdir}" != "." ] ; then
-# . ${with_multisrctop}../../config-ml.in
-# else
-# . ${with_multisrctop}../config-ml.in
-# fi
-# else
-# . ${srcdir}/../config-ml.in
-# fi
-#
-#
-# Things are complicated because 6 separate cases must be handled:
-# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
-#
-# srcdir=. is special. It must handle make programs that don't handle VPATH.
-# To implement this, a symlink tree is built for each library and for each
-# multilib subdir.
-#
-# The build tree is layed out as
-#
-# ./
-# newlib
-# m68020/
-# newlib
-# m68881/
-# newlib
-#
-# The nice feature about this arrangement is that inter-library references
-# in the build tree work without having to care where you are. Note that
-# inter-library references also work in the source tree because symlink trees
-# are built when srcdir=.
-#
-# Unfortunately, trying to access the libraries in the build tree requires
-# the user to manually choose which library to use as GCC won't be able to
-# find the right one. This is viewed as the lesser of two evils.
-#
-# Configure variables:
-# ${with_target_subdir} = "." for native, or ${target_alias} for cross.
-# Set by top level Makefile.
-# ${with_multisrctop} = how many levels of multilibs there are in the source
-# tree. It exists to handle the case of configuring in the source tree:
-# ${srcdir} is not constant.
-# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881).
-#
-# Makefile variables:
-# MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
-# (FIXME: note that this is different than ${with_multisrctop}. Check out.).
-# MULTIBUILDTOP = number of multilib levels in build tree
-# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
-# (only defined in each library's main Makefile).
-# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
-# (only defined in each multilib subdir).
-
-# FIXME: Multilib is currently disabled by default for everything other than
-# newlib. It is up to each target to turn on multilib support for the other
-# libraries as desired.
-
-# Autoconf incoming variables:
-# srcdir, host, ac_configure_args
-#
-# We *could* figure srcdir and host out, but we'd have to do work that
-# our caller has already done to figure them out and requiring these two
-# seems reasonable.
-# Note that `host' in this case is GCC's `target'. Target libraries are
-# configured for a particular host.
-
-Makefile=${ac_file-Makefile}
-ml_config_shell=${CONFIG_SHELL-/bin/sh}
-ml_arguments="${ac_configure_args}"
-ml_realsrcdir=${srcdir}
-
-# Scan all the arguments and set all the ones we need.
-
-ml_verbose=--verbose
-for option in ${ml_arguments}
-do
- case $option in
- --*) ;;
- -*) option=-$option ;;
- esac
-
- case $option in
- --*=*)
- optarg=`echo $option | sed -e 's/^[^=]*=//'`
- ;;
- esac
-
- case $option in
- --disable-*)
- enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
- eval $enableopt=no
- ;;
- --enable-*)
- case "$option" in
- *=*) ;;
- *) optarg=yes ;;
- esac
- enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $enableopt="$optarg"
- ;;
- --norecursion | --no*)
- ml_norecursion=yes
- ;;
- --silent | --sil* | --quiet | --q*)
- ml_verbose=--silent
- ;;
- --verbose | --v | --verb*)
- ml_verbose=--verbose
- ;;
- --with-*)
- case "$option" in
- *=*) ;;
- *) optarg=yes ;;
- esac
- withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
- eval $withopt="$optarg"
- ;;
- --without-*)
- withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
- eval $withopt=no
- ;;
- esac
-done
-
-# Only do this if --enable-multilib.
-if [ "${enable_multilib}" = yes ]; then
-
-# Compute whether this is the library's top level directory
-# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
-# ${with_multisubdir} tells us we're in the right branch, but we could be
-# in a subdir of that.
-# ??? The previous version could void this test by separating the process into
-# two files: one that only the library's toplevel configure.in ran (to
-# configure the multilib subdirs), and another that all configure.in's ran to
-# update the Makefile. It seemed reasonable to collapse all multilib support
-# into one file, but it does leave us with having to perform this test.
-ml_toplevel_p=no
-if [ -z "${with_multisubdir}" ]; then
- if [ "${srcdir}" = "." ]; then
- # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
- # ${with_target_subdir} = "." for native, otherwise target alias.
- if [ "${with_target_subdir}" = "." ]; then
- if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
- ml_toplevel_p=yes
- fi
- else
- if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
- ml_toplevel_p=yes
- fi
- fi
- else
- # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
- if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
- ml_toplevel_p=yes
- fi
- fi
-fi
-
-# If this is the library's top level directory, set multidirs to the
-# multilib subdirs to support. This lives at the top because we need
-# `multidirs' set right away.
-
-if [ "${ml_toplevel_p}" = yes ]; then
-
-multidirs=
-for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
- dir=`echo $i | sed -e 's/;.*$//'`
- if [ "${dir}" = "." ]; then
- true
- else
- if [ -z "${multidirs}" ]; then
- multidirs="${dir}"
- else
- multidirs="${multidirs} ${dir}"
- fi
- fi
-done
-
-# Target libraries are configured for the host they run on, so we check
-# $host here, not $target.
-
-case "${host}" in
-arc-*-elf*)
- if [ x$enable_biendian != xyes ]
- then
- old_multidirs=${multidirs}
- multidirs=""
- for x in ${old_multidirs}; do
- case "${x}" in
- *be*) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- ;;
-arm-*-*)
- if [ x"$enable_fpu" = xno ]
- then
- old_multidirs=${multidirs}
- multidirs=""
- for x in ${old_multidirs}; do
- case "${x}" in
- *fpu*) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x"$enable_26bit" = xno ]
- then
- old_multidirs=${multidirs}
- multidirs=""
- for x in ${old_multidirs}; do
- case "${x}" in
- *26bit*) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x"$enable_underscore" = xno ]
- then
- old_multidirs=${multidirs}
- multidirs=""
- for x in ${old_multidirs}; do
- case "${x}" in
- *under*) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x"$enable_interwork" = xno ]
- then
- old_multidirs=${multidirs}
- multidirs=""
- for x in ${old_multidirs}; do
- case "${x}" in
- *interwork*) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_biendian = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *le* ) : ;;
- *be* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x"$enable_nofmult" = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *nofmult* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- ;;
-m68*-*-*)
- if [ x$enable_softfloat = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *soft-float* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_m68881 = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *m68881* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_m68000 = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *m68000* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_m68020 = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *m68020* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- ;;
-mips*-*-*)
- if [ x$enable_single_float = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *single* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_biendian = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *el* ) : ;;
- *eb* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_softfloat = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *soft-float* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- case " $multidirs " in
- *" mabi=64 "*)
- # We will not be able to create libraries with -mabi=64 if
- # we cannot even link a trivial program. It usually
- # indicates the 64bit libraries are missing.
- if echo 'main() {}' > conftest.c &&
- ${CC-gcc} -mabi=64 conftest.c -o conftest; then
- :
- else
- echo Could not link program with -mabi=64, disabling it.
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *mabi=64* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- rm -f conftest.c conftest
- ;;
- esac
- ;;
-powerpc*-*-* | rs6000*-*-*)
- if [ x$enable_aix64 = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *ppc64* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_pthread = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *pthread* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_softfloat = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *soft-float* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_powercpu = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- power | */power | */power/* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_powerpccpu = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *powerpc* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_powerpcos = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *mcall-linux* | *mcall-solaris* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_biendian = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *mlittle* | *mbig* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- if [ x$enable_sysv = xno ]
- then
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *mcall-sysv* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- ;;
-sparc*-*-*)
- case " $multidirs " in
- *" m64 "*)
- # We will not be able to create libraries with -m64 if
- # we cannot even link a trivial program. It usually
- # indicates the 64bit libraries are missing.
- if echo 'main() {}' > conftest.c &&
- ${CC-gcc} -m64 conftest.c -o conftest; then
- :
- else
- echo Could not link program with -m64, disabling it.
- old_multidirs="${multidirs}"
- multidirs=""
- for x in ${old_multidirs}; do
- case "$x" in
- *m64* ) : ;;
- *) multidirs="${multidirs} ${x}" ;;
- esac
- done
- fi
- rm -f conftest.c conftest
- ;;
- esac
- ;;
-esac
-
-# Remove extraneous blanks from multidirs.
-# Tests like `if [ -n "$multidirs" ]' require it.
-multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
-
-# Add code to library's top level makefile to handle building the multilib
-# subdirs.
-
-cat > Multi.tem <<\EOF
-
-PWD=$${PWDCMD-pwd}
-
-# FIXME: There should be an @-sign in front of the `if'.
-# Leave out until this is tested a bit more.
-multi-do:
- if [ -z "$(MULTIDIRS)" ]; then \
- true; \
- else \
- rootpre=`${PWD}`/; export rootpre; \
- srcrootpre=`cd $(srcdir); ${PWD}`/; export srcrootpre; \
- lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
- compiler="$(CC)"; \
- for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
- dir=`echo $$i | sed -e 's/;.*$$//'`; \
- if [ "$${dir}" = "." ]; then \
- true; \
- else \
- if [ -d ../$${dir}/$${lib} ]; then \
- flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
- if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
- CFLAGS="$(CFLAGS) $${flags}" \
- prefix="$(prefix)" \
- exec_prefix="$(exec_prefix)" \
- GCJFLAGS="$(GCJFLAGS) $${flags}" \
- CXXFLAGS="$(CXXFLAGS) $${flags}" \
- LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
- LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
- LDFLAGS="$(LDFLAGS) $${flags}" \
- DESTDIR="$(DESTDIR)" \
- $(DO)); then \
- true; \
- else \
- exit 1; \
- fi; \
- else true; \
- fi; \
- fi; \
- done; \
- fi
-
-# FIXME: There should be an @-sign in front of the `if'.
-# Leave out until this is tested a bit more.
-multi-clean:
- if [ -z "$(MULTIDIRS)" ]; then \
- true; \
- else \
- lib=`${PWD} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
- for dir in Makefile $(MULTIDIRS); do \
- if [ -f ../$${dir}/$${lib}/Makefile ]; then \
- if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
- then true; \
- else exit 1; \
- fi; \
- else true; \
- fi; \
- done; \
- fi
-EOF
-
-cat ${Makefile} Multi.tem > Makefile.tem
-rm -f ${Makefile} Multi.tem
-mv Makefile.tem ${Makefile}
-
-fi # ${ml_toplevel_p} = yes
-
-if [ "${ml_verbose}" = --verbose ]; then
- echo "Adding multilib support to Makefile in ${ml_realsrcdir}"
- if [ "${ml_toplevel_p}" = yes ]; then
- echo "multidirs=${multidirs}"
- fi
- echo "with_multisubdir=${with_multisubdir}"
-fi
-
-if [ "${srcdir}" = "." ]; then
- if [ "${with_target_subdir}" != "." ]; then
- ml_srcdotdot="../"
- else
- ml_srcdotdot=""
- fi
-else
- ml_srcdotdot=""
-fi
-
-if [ -z "${with_multisubdir}" ]; then
- ml_subdir=
- ml_builddotdot=
- : # ml_srcdotdot= # already set
-else
- ml_subdir="/${with_multisubdir}"
- # The '[^/][^/]*' appears that way to work around a SunOS sed bug.
- ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/
- if [ "$srcdir" = "." ]; then
- ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot}
- else
- : # ml_srcdotdot= # already set
- fi
-fi
-
-if [ "${ml_toplevel_p}" = yes ]; then
- ml_do='$(MAKE)'
- ml_clean='$(MAKE)'
-else
- ml_do=true
- ml_clean=true
-fi
-
-# TOP is used by newlib and should not be used elsewhere for this purpose.
-# MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty
-# when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s.
-# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can
-# delete TOP. Newlib may wish to continue to use TOP for its own purposes
-# of course.
-# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile)
-# and lists the subdirectories to recurse into.
-# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile
-# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with
-# a leading '/'.
-# MULTIDO is used for targets like all, install, and check where
-# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed.
-# MULTICLEAN is used for the *clean targets.
-#
-# ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are
-# currently kept separate because we don't want the *clean targets to require
-# the existence of the compiler (which MULTIDO currently requires) and
-# therefore we'd have to record the directory options as well as names
-# (currently we just record the names and use --print-multi-lib to get the
-# options).
-
-sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \
- -e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \
- -e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \
- -e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \
- -e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \
- -e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \
- -e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \
- ${Makefile} > Makefile.tem
-rm -f ${Makefile}
-mv Makefile.tem ${Makefile}
-
-# If this is the library's top level, configure each multilib subdir.
-# This is done at the end because this is the loop that runs configure
-# in each multilib subdir and it seemed reasonable to finish updating the
-# Makefile before going on to configure the subdirs.
-
-if [ "${ml_toplevel_p}" = yes ]; then
-
-# We must freshly configure each subdirectory. This bit of code is
-# actually partially stolen from the main configure script. FIXME.
-
-if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
-
- if [ "${ml_verbose}" = --verbose ]; then
- echo "Running configure in multilib subdirs ${multidirs}"
- echo "pwd: `${PWDCMD-pwd}`"
- fi
-
- ml_origdir=`${PWDCMD-pwd}`
- ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'`
- # cd to top-level-build-dir/${with_target_subdir}
- cd ..
-
- for ml_dir in ${multidirs}; do
-
- if [ "${ml_verbose}" = --verbose ]; then
- echo "Running configure in multilib subdir ${ml_dir}"
- echo "pwd: `${PWDCMD-pwd}`"
- fi
-
- if [ -d ${ml_dir} ]; then true; else
- # ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
- pathcomp=""
- for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
- fi
- if test ! -d "$pathcomp"; then
- exit $lasterr
- fi
- pathcomp="$pathcomp/"
- done
- fi
- if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
-
- # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
- dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
-
- case ${srcdir} in
- ".")
- echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}
- if [ "${with_target_subdir}" != "." ]; then
- ml_unsubdir="../"
- else
- ml_unsubdir=""
- fi
- (cd ${ml_dir}/${ml_libdir};
- ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
- if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then
- if [ x"${MAKE}" = x ]; then
- (cd ${ml_dir}/${ml_libdir}; make distclean)
- else
- (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean)
- fi
- fi
- ml_newsrcdir="."
- ml_srcdiroption=
- multisrctop=${dotdot}
- ;;
- *)
- case "${srcdir}" in
- /* | [A-Za-z]:[\\/]* ) # absolute path
- ml_newsrcdir=${srcdir}
- ;;
- *) # otherwise relative
- ml_newsrcdir=${dotdot}${srcdir}
- ;;
- esac
- ml_srcdiroption="-srcdir=${ml_newsrcdir}"
- multisrctop=
- ;;
- esac
-
- case "${progname}" in
- /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;;
- *) ml_recprog=${dotdot}${progname} ;;
- esac
-
- # FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
- ML_POPDIR=`${PWDCMD-pwd}`
- cd ${ml_dir}/${ml_libdir}
-
- if [ -f ${ml_newsrcdir}/configure ]; then
- ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache"
- fi
-
- # find compiler flag corresponding to ${ml_dir}
- for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
- dir=`echo $i | sed -e 's/;.*$//'`
- if [ "${dir}" = "${ml_dir}" ]; then
- flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
- break
- fi
- done
- ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"'
-
- if [ "${with_target_subdir}" = "." ]; then
- CC_=$CC' '
- CXX_=$CXX' '
- GCJ_=$GCJ' '
- else
- # Create a regular expression that matches any string as long
- # as ML_POPDIR.
- popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'`
- CC_=
- for arg in ${CC}; do
- case $arg in
- -[BIL]"${ML_POPDIR}"/*)
- CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
- "${ML_POPDIR}"/*)
- CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
- *)
- CC_="${CC_}${arg} " ;;
- esac
- done
-
- CXX_=
- for arg in ${CXX}; do
- case $arg in
- -[BIL]"${ML_POPDIR}"/*)
- CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
- "${ML_POPDIR}"/*)
- CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
- *)
- CXX_="${CXX_}${arg} " ;;
- esac
- done
-
- GCJ_=
- for arg in ${GCJ}; do
- case $arg in
- -[BIL]"${ML_POPDIR}"/*)
- GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
- "${ML_POPDIR}"/*)
- GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
- *)
- GCJ_="${GCJ_}${arg} " ;;
- esac
- done
-
- if test "x${LD_LIBRARY_PATH+set}" = xset; then
- LD_LIBRARY_PATH_=
- for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
- case "$arg" in
- "${ML_POPDIR}"/*)
- arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
- ;;
- esac
- if test "x$LD_LIBRARY_PATH_" != x; then
- LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
- else
- LD_LIBRARY_PATH_=$arg
- fi
- done
- ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
- fi
-
- if test "x${SHLIB_PATH+set}" = xset; then
- SHLIB_PATH_=
- for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
- case "$arg" in
- "${ML_POPDIR}"/*)
- arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
- ;;
- esac
- if test "x$SHLIB_PATH_" != x; then
- SHLIB_PATH_=$SHLIB_PATH_:$arg
- else
- SHLIB_PATH_=$arg
- fi
- done
- ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
- fi
- fi
-
- if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
- --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
- ${ml_arguments} ${ml_srcdiroption} ; then
- true
- else
- exit 1
- fi
-
- cd ${ML_POPDIR}
-
- done
-
- cd ${ml_origdir}
-fi
-
-fi # ${ml_toplevel_p} = yes
-fi # ${enable_multilib} = yes
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9c58b41c498..14dfacc97e5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,224 +1,3 @@
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * regcache.h (max_register_size): Delete declaration.
- * regcache.c (max_register_size): Delete function.
- (struct regcache_descr): Delete field "max_register_size".
- (init_regcache_descr, init_legacy_regcache_descr): Assert that all
- registers fit in MAX_REGISTER_SIZE.
- (regcache_save): Replace max_register_size with MAX_REGISTER_SIZE.
- (regcache_restore, regcache_xfer_part, regcache_dump): Ditto.
- * thread-db.c: Replace max_register_size with MAX_REGISTER_SIZE.
- * sh-tdep.c, rom68k-rom.c, remote-sim.c, remote-mips.c: Ditto.
- * remote-e7000.c, monitor.c, mipsv4-nat.c, mips-nat.c: Ditto.
- * m68klinux-nat.c, lynx-nat.c, irix4-nat.c: Ditto.
- * hpux-thread.c, hppah-nat.c, hppab-nat.c, hppa-tdep.c: Ditto.
- * dve3900-rom.c, hppa-tdep.c: Ditto.
-
-2003-05-08 David Carlton <carlton@math.stanford.edu>
-
- * valops.c (push_word): Fix typo.
-
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
- * gdbarch.h: Re-generate.
- * defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
- (legacy_max_register_raw_size): Delete declaration.
- * regcache.c (legacy_max_register_raw_size): Delete function.
- * valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
- * target.c, stack.c, sparc-tdep.c, sh-tdep.c: Ditto.
- * rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Ditto.
- * remote-rdp.c, remote-array.c, regcache.c: Ditto.
- * ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Ditto.
- * mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Ditto.
- * infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Ditto.
- * findvar.c, dwarf2cfi.c: Ditto.
-
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * mips-tdep.c (read_signed_register): New function, moved to here
- from "regcache.c".
- (read_signed_register_pid): Ditto.
- * regcache.c (read_signed_register_pid): Delete function, moved to
- "mips-tdep.c".
- (read_signed_register): Ditto.
- * regcache.h (read_signed_register): Delete declaration.
- (read_signed_register_pid): Delete declaration.
-
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * gdbarch.sh: Add comments on MAX_REGISTER_SIZE.
- * gdbarch.h: Re-generate.
- * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Delete macro.
- (legacy_max_register_virtual_size): Delete declaration.
- * infcmd.c (default_print_registers_info): Use MAX_REGISTER_SIZE.
- * d10v-tdep.c (d10v_print_registers_info): Ditto.
- * tracepoint.c (memrange_sortmerge): Ditto.
- * sparc-tdep.c (sparc_print_registers): Ditto.
- * regcache.c (legacy_max_register_virtual_size): Delete function.
-
-2002-05-08 J. Brobecker <brobecker@gnat.com>
-
- * fork-child.c (escape_bang_in_quoted_argument): New function.
- (fork_inferior): Escape '!' characters in quoted arguments
- only when needed.
-
-2003-05-08 J. Brobecker <brobecker@gnat.com>
-
- * dwarf2read.c (set_cu_language): Set the language to "minimal" if
- the language of the CU is not currently supported by GDB.
-
-2003-05-08 J. Brobecker <brobecker@gnat.com>
-
- * defs.h (language): Add language_minimal enum value.
- * c-lang.c (minimal_language_defn): New language definition.
- (_initialize_c_language): Add the new minimal language to the list
- of languages known to GDB.
-
-2003-05-08 Kevin Buettner <kevinb@redhat.com>
-
- * frame.c (get_frame_type): Don't attempt to lazily initialize
- frame's unwinder for legacy frames.
-
-2003-05-07 Andrew Cagney <cagney@redhat.com>
-
- * ia64-tdep.c (ia64_remote_translate_xfer_address): Add "gdbarch"
- and "regcache" parameters.
- * avr-tdep.c (avr_remote_translate_xfer_address): Ditto.
-
-2003-05-07 Jeff Johnston <jjohnstn@redhat.com>
-
- * dwarf2read.c (dwarf_decode_lines): Only use output of
- check_cu_functions() when calling record_line(). Do not update
- the current address.
-
-2003-05-07 Andrew Cagney <cagney@redhat.com>
-
- * fork-child.c (startup_inferior): Delete #ifdef STARTUP_INFERIOR
- code.
-
-2003-05-07 Jim Blandy <jimb@redhat.com>
-
- Rename commands 'maint list symtabs' and 'maint list psymtabs' to
- 'maint info symtabs' and 'maint info psymtabs'.
- * symmisc.c (maintenance_info_symtabs, maintenance_info_psymtabs):
- Renamed from maintenance_list_symtabs and maintenance_list_psymtabs.
- * symtab.h (maintenance_info_symtabs, maintenance_info_psymtabs):
- Declarations updated.
- * maint.c (maintenance_list_command): Delete.
- (_initialize_maint_cmds): Update calls to add_cmd.
- * gdbcmd.h (maintenancelistlist): Delete declaration.
- * cli/cli-cmds.c (maintenancelistlist): Delete.
- (init_cmd_lists): Don't initialize it.
- * cli/cli-cmds.h (maintenancelistlist): Delete declaration.
-
-2003-05-07 Andrew Cagney <cagney@redhat.com>
-
- * d10v-tdep.c (remote_d10v_translate_xfer_address): Add
- "regcache".
- (d10v_print_registers_info): Update.
- (d10v_dmap_register, d10v_imap_register): Delete functions.
- (struct gdbarch_tdep): Add "regcache" parameter to "dmap_register"
- and "imap_register".
- (d10v_ts2_dmap_register, d10v_ts2_imap_register): Add "regcache".
- (d10v_ts3_dmap_register, d10v_ts3_imap_register): Add "regcache".
- * arch-utils.c (generic_remote_translate_xfer_address): Add
- "regcache" and "gdbarch" parameters.
- * gdbarch.sh (REMOTE_TRANSLATE_XFER_ADDRESS): Add "regcache"
- parameter. Change class to multi-arch.
- * gdbarch.h, gdbarch.c: Re-generate.
- * remote.c (remote_xfer_memory): Use
- gdbarch_remote_translate_xfer_address.
-
-2003-05-07 Jeff Johnston <jjohnstn@redhat.com>
-
- * infrun.c (prev_pc): Move declaration ahead of proceed().
- (proceed): Refresh prev_pc value before resuming.
- (stop_stepping): Remove code to refresh prev_pc.
-
-2003-05-06 Kris Warkentin <kewarken@qnx.com>
-
- * nto-tdep.c: Removed stray comment.
-
-2003-05-06 Kris Warkentin <kewarken@qnx.com>
-
- * i386-nto-tdep.c: Fix old K&R function definitions.
- * nto-tdep.c: Likewise and change stat.h include to gdb_stat.h.
- Also change add_show_from_set() call to add_setshow_cmd().
- * nto-tdep.h: Remove PARAMS and grep ^func ARI hits.
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * dummy-frame.c: Include "command.h" and "gdbcmd.h".
- (fprint_dummy_frames): New function.
- (maintenance_print_dummy_frames): New function.
- (_initialize_dummy_frame): Add command "maint print dummy-frames".
- * frame.c (fprint_frame_id): Make global.
- * frame.h (fprint_frame_id): Declare.
- * Makefile.in (dummy-frame.o): Update dependencies.
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * gdbarch.sh (DEPRECATED_REGISTER_SIZE): Rename REGISTER_SIZE.
- (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Rename
- SIZEOF_CALL_DUMMY_WORDS.
- (DEPRECATED_CALL_DUMMY_WORDS): Rename CALL_DUMMY_WORDS.
- (DEPRECATED_FIX_CALL_DUMMY): Rename FIX_CALL_DUMMY.
- (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET): Rename
- CALL_DUMMY_BREAKPOINT_OFFSET.
- (DEPRECATED_CALL_DUMMY_START_OFFSET): Rename
- CALL_DUMMY_START_OFFSET.
- (DEPRECATED_CALL_DUMMY_LENGTH): Rename CALL_DUMMY_LENGTH.
- * gdbarch.h, gdbarch.c: Re-generate.
- * alpha-tdep.c, alphafbsd-tdep.c, arm-linux-tdep.c: Update.
- * arm-tdep.c, avr-tdep.c, breakpoint.c, cris-tdep.c: Update.
- * dummy-frame.c, dummy-frame.h, frv-tdep.c, gdbarch.c: Update.
- * gdbarch.h, gdbarch.sh, h8300-tdep.c, hppa-tdep.c: Update.
- * i386-tdep.c, ia64-tdep.c, infcall.c, inferior.h: Update.
- * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c: Update.
- * mips-tdep.c, mn10300-tdep.c, ns32k-tdep.c: Update.
- * rs6000-tdep.c, s390-tdep.c, sh-tdep.c, sol-thread.c: Update.
- * sparc-tdep.c, target.c, v850-tdep.c, valops.c: Update.
- * vax-tdep.c, x86-64-tdep.c, xstormy16-tdep.c: Update.
- * config/ia64/tm-ia64.h, config/m68k/tm-vx68.h: Update.
- * config/mips/tm-mips.h, config/pa/nm-hppah.h: Update.
- * config/pa/tm-hppa.h, config/pa/tm-hppa64.h: Update.
- * config/s390/tm-s390.h, config/sparc/tm-sp64.h: Update.
- * config/sparc/tm-sparc.h: Update.
-
-2003-05-05 Kris Warkentin <kewarken@qnx.com>
-
- * configure.tgt: Add i[3456]86-*-nto*.
- * i386-nto-tdep.c: New file. i386 specific support for QNX Neutrino.
- * nto-tdep.c: New file. Neutrino target support routines.
- * nto-tdep.h: New file. Neutrino target header.
- * config/tm-qnxnto.h: New file.
- * config/i386/i386nto.mt: New file.
- * config/i386/tm-i386nto.h: New file.
-
-2003-05-04 Andrew Cagney <cagney@redhat.com>
-
- * gdbthread.h (save_infrun_state): Drop prev_func_name parameter.
- (load_infrun_state): Ditto.
- (struct thread_info): Drop "prev_func_name" field.
- * thread.c (load_infrun_state): Update.
- (save_infrun_state): Update.
- * infrun.c (prev_func_name): Delete variable.
- (init_wait_for_inferior): Do not clear prev_func_name.
- (stop_stepping, keep_going, context_switch): Do not swap
- prev_func_name.
- (handle_inferior_event, check_sigtramp2): Use pc_in_sigtramp
- instead of PC_IN_SIGTRAMP.
-
-2003-05-04 Andrew Cagney <cagney@redhat.com>
-
- * sentinel-frame.c (sentinel_frame_prev_register): Replace
- REGISTER_BYTE with register_offset_hack.
- * regcache.c (init_regcache_descr): When REGISTER_BYTE_P, check
- that REGISTER_BYTE is consistent with the regcache.
- * gdbarch.sh (REGISTER_BYTE): Add a predicate.
- * gdbarch.h, gdbarch.c: Regenerate.
-
2003-05-04 Mark Kettenis <kettenis@gnu.org>
* i387-tdep.c (fxsave_offset): Add entries for %xmm8-%xmm15.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 43d544dab14..46b4f40cb2f 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1662,8 +1662,7 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h)
dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
- $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \
- $(command_h) $(gdbcmd_h)
+ $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h)
dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h)
dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index c1648b48b48..067fc91fd63 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -66,6 +66,8 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address;
static gdbarch_skip_prologue_ftype alpha_skip_prologue;
+static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
+
static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
struct frame_extra_info
@@ -1809,7 +1811,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM);
set_gdbarch_register_name (gdbarch, alpha_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, ALPHA_REGISTER_SIZE);
+ set_gdbarch_register_size (gdbarch, ALPHA_REGISTER_SIZE);
set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, alpha_register_byte);
set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
@@ -1857,8 +1859,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
stopping the user call is achieved via a bp_call_dummy breakpoint.
But we need a fake CALL_DUMMY definition to enable the proper
call_function_by_hand and to avoid zero length array warnings. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, alpha_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, alpha_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_frame_args_address (gdbarch, alpha_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, alpha_frame_locals_address);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, alpha_init_extra_frame_info);
@@ -1871,7 +1873,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame);
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
+ set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index 3d8eafb2927..6b1b068d9cf 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -32,7 +32,7 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type)
/* All aggregate types that won't fit in a register must be returned
in memory. */
- if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
+ if (TYPE_LENGTH (type) > REGISTER_SIZE)
return 1;
/* The only aggregate types that can be returned in a register are
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 2f555ff6fa8..fad8ed1b366 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -191,9 +191,7 @@ LONGEST legacy_call_dummy_words[1];
int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words);
void
-generic_remote_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR gdb_addr, int gdb_len,
+generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len,
CORE_ADDR * rem_addr, int *rem_len)
{
*rem_addr = gdb_addr;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 60c8ae492a9..91fa88fe0ad 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -46,7 +46,7 @@
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
-/* DEPRECATED_CALL_DUMMY_WORDS:
+/* CALL_DUMMY_WORDS:
This sequence of words is the instructions
mov lr, pc
@@ -115,10 +115,10 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Walk through the list of args and determine how large a temporary
stack is required. Need to take care here as structs may be
passed on the stack, and we have to to push them. */
- nstack_size = -4 * DEPRECATED_REGISTER_SIZE; /* Some arguments go into A1-A4. */
+ nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
if (struct_return) /* The struct address goes in A1. */
- nstack_size += DEPRECATED_REGISTER_SIZE;
+ nstack_size += REGISTER_SIZE;
/* Walk through the arguments and add their size to nstack_size. */
for (argnum = 0; argnum < nargs; argnum++)
@@ -131,7 +131,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* ANSI C code passes float arguments as integers, K&R code
passes float arguments as doubles. Correct for this here. */
- if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && DEPRECATED_REGISTER_SIZE == len)
+ if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len)
nstack_size += FP_REGISTER_VIRTUAL_SIZE;
else
nstack_size += len;
@@ -178,7 +178,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
.stabs records the type as FP_FLOAT. In this latter case
the compiler converts the float arguments to double before
calling the function. */
- if (TYPE_CODE_FLT == typecode && DEPRECATED_REGISTER_SIZE == len)
+ if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
{
DOUBLEST dblval;
dblval = deprecated_extract_floating (val, len);
@@ -203,7 +203,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
registers and stack. */
while (len > 0)
{
- int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
+ int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
if (argreg <= ARM_LAST_ARG_REGNUM)
{
@@ -214,8 +214,8 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
else
{
/* Push the arguments onto the stack. */
- write_memory ((CORE_ADDR) fp, val, DEPRECATED_REGISTER_SIZE);
- fp += DEPRECATED_REGISTER_SIZE;
+ write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
+ fp += REGISTER_SIZE;
}
len -= partial_len;
@@ -530,8 +530,9 @@ arm_linux_init_abi (struct gdbarch_info info,
tdep->jb_pc = ARM_LINUX_JB_PC;
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
- set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (arm_linux_call_dummy_words));
/* The following two overrides shouldn't be needed. */
set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index d2e3ef598a0..ee07a36282c 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1237,7 +1237,7 @@ arm_push_dummy_frame (void)
write_register (ARM_SP_REGNUM, sp);
}
-/* DEPRECATED_CALL_DUMMY_WORDS:
+/* CALL_DUMMY_WORDS:
This sequence of words is the instructions
mov lr,pc
@@ -1265,9 +1265,9 @@ static void
arm_set_call_dummy_breakpoint_offset (void)
{
if (caller_is_thumb)
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 4);
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 4);
else
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 8);
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 8);
}
/* Fix up the call dummy, based on whether the processor is currently
@@ -1430,7 +1430,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
/* Some platforms require a double-word aligned stack. Make sure sp
is correctly aligned before we start. We always do this even if
it isn't really needed -- it can never hurt things. */
- sp &= ~(CORE_ADDR)(2 * DEPRECATED_REGISTER_SIZE - 1);
+ sp &= ~(CORE_ADDR)(2 * REGISTER_SIZE - 1);
/* The struct_return pointer occupies the first parameter
passing register. */
@@ -1477,7 +1477,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
registers and stack. */
while (len > 0)
{
- int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
+ int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
if (argreg <= ARM_LAST_ARG_REGNUM)
{
@@ -1487,7 +1487,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
argnum, REGISTER_NAME (argreg),
- phex (regval, DEPRECATED_REGISTER_SIZE));
+ phex (regval, REGISTER_SIZE));
regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
}
@@ -1497,8 +1497,8 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n",
argnum, nstack);
- si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE);
- nstack += DEPRECATED_REGISTER_SIZE;
+ si = push_stack_item (si, val, REGISTER_SIZE);
+ nstack += REGISTER_SIZE;
}
len -= partial_len;
@@ -1799,7 +1799,7 @@ thumb_get_next_pc (CORE_ADDR pc)
/* Fetch the saved PC from the stack. It's stored above
all of the other registers. */
- offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE;
+ offset = bitcount (bits (inst1, 0, 7)) * REGISTER_SIZE;
sp = read_register (ARM_SP_REGNUM);
nextpc = (CORE_ADDR) read_memory_integer (sp + offset, 4);
nextpc = ADDR_BITS_REMOVE (nextpc);
@@ -2309,10 +2309,10 @@ arm_use_struct_convention (int gcc_p, struct type *type)
/* In the ARM ABI, "integer" like aggregate types are returned in
registers. For an aggregate type to be integer like, its size
- must be less than or equal to DEPRECATED_REGISTER_SIZE and the
- offset of each addressable subfield must be zero. Note that bit
- fields are not addressable, and all addressable subfields of
- unions always start at offset zero.
+ must be less than or equal to REGISTER_SIZE and the offset of
+ each addressable subfield must be zero. Note that bit fields are
+ not addressable, and all addressable subfields of unions always
+ start at offset zero.
This function is based on the behaviour of GCC 2.95.1.
See: gcc/arm.c: arm_return_in_memory() for details.
@@ -2326,7 +2326,7 @@ arm_use_struct_convention (int gcc_p, struct type *type)
/* All aggregate types that won't fit in a register must be returned
in memory. */
- if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
+ if (TYPE_LENGTH (type) > REGISTER_SIZE)
{
return 1;
}
@@ -2348,11 +2348,11 @@ arm_use_struct_convention (int gcc_p, struct type *type)
int i;
/* Need to check if this struct/union is "integer" like. For
this to be true, its size must be less than or equal to
- DEPRECATED_REGISTER_SIZE and the offset of each addressable
- subfield must be zero. Note that bit fields are not
- addressable, and unions always start at offset zero. If any
- of the subfields is a floating point type, the struct/union
- cannot be an integer type. */
+ REGISTER_SIZE and the offset of each addressable subfield
+ must be zero. Note that bit fields are not addressable, and
+ unions always start at offset zero. If any of the subfields
+ is a floating point type, the struct/union cannot be an
+ integer type. */
/* For each field in the object, check:
1) Is it FP? --> yes, nRc = 1;
@@ -2930,8 +2930,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->lowest_pc = 0x20;
tdep->jb_pc = -1; /* Longjump support not enabled by default. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
@@ -2991,7 +2991,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno);
/* Integer registers are 4 bytes. */
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_name (gdbarch, arm_register_name);
/* Returning results. */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 386b3861629..314c0a11977 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -396,9 +396,7 @@ avr_read_fp (void)
pointer? */
static void
-avr_remote_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR memaddr, int nr_bytes,
+avr_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
long out_addr;
@@ -1158,7 +1156,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM);
set_gdbarch_register_name (gdbarch, avr_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 1);
+ set_gdbarch_register_size (gdbarch, 1);
set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
set_gdbarch_register_byte (gdbarch, avr_register_byte);
set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size);
@@ -1170,7 +1168,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_print_insn (gdbarch, print_insn_avr);
set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, avr_call_dummy_words);
+ set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words);
/* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 66b319e842b..f6736a4cb74 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1697,7 +1697,7 @@ deprecated_frame_in_dummy (struct frame_info *frame)
for signals.exp in the testsuite. */
&& (get_frame_pc (frame)
>= (b->address
- - DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * DEPRECATED_REGISTER_SIZE))
+ - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
&& get_frame_pc (frame) <= b->address)
return 1;
}
@@ -5464,7 +5464,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \
- ((BYTE_SIZE) <= (DEPRECATED_REGISTER_SIZE))
+ ((BYTE_SIZE) <= (REGISTER_SIZE))
#endif
#if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT)
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index fbdf0054afa..e492b9a205e 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -651,47 +651,10 @@ const struct language_defn asm_language_defn =
LANG_MAGIC
};
-/* The following language_defn does not represent a real language.
- It just provides a minimal support a-la-C that should allow users
- to do some simple operations when debugging applications that use
- a language currently not supported by GDB. */
-
-const struct language_defn minimal_language_defn =
-{
- "minimal", /* Language name */
- language_minimal,
- c_builtin_types,
- range_check_off,
- type_check_off,
- case_sensitive_on,
- c_preprocess_and_parse,
- c_error,
- evaluate_subexp_standard,
- c_printchar, /* Print a character constant */
- c_printstr, /* Function to print string constant */
- c_emit_char, /* Print a single char */
- c_create_fundamental_type, /* Create fundamental type in this language */
- c_print_type, /* Print a type using appropriate syntax */
- c_val_print, /* Print a value using appropriate syntax */
- c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
- NULL, /* Language specific symbol demangler */
- {"", "", "", ""}, /* Binary format info */
- {"0%lo", "0", "o", ""}, /* Octal format info */
- {"%ld", "", "d", ""}, /* Decimal format info */
- {"0x%lx", "0x", "x", ""}, /* Hex format info */
- c_op_print_tab, /* expression operators for printing */
- 1, /* c-style arrays */
- 0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
- LANG_MAGIC
-};
-
void
_initialize_c_language (void)
{
add_language (&c_language_defn);
add_language (&cplus_language_defn);
add_language (&asm_language_defn);
- add_language (&minimal_language_defn);
}
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 108329a50c7..c33c242bad5 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -171,6 +171,10 @@ struct cmd_list_element *maintenanceinfolist;
struct cmd_list_element *maintenanceprintlist;
+/* Chain containing all defined "maintenance list" subcommands. */
+
+struct cmd_list_element *maintenancelistlist;
+
struct cmd_list_element *setprintlist;
struct cmd_list_element *showprintlist;
@@ -1032,6 +1036,7 @@ init_cmd_lists (void)
maintenancelist = NULL;
maintenanceinfolist = NULL;
maintenanceprintlist = NULL;
+ maintenancelistlist = NULL;
setprintlist = NULL;
showprintlist = NULL;
setchecklist = NULL;
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index a6e574edd71..1f340efa101 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -87,6 +87,10 @@ extern struct cmd_list_element *maintenanceinfolist;
extern struct cmd_list_element *maintenanceprintlist;
+/* Chain containing all defined "maintenance list" subcommands. */
+
+extern struct cmd_list_element *maintenancelistlist;
+
extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
diff --git a/gdb/config/i386/nto.mt b/gdb/config/i386/nto.mt
deleted file mode 100644
index 6655f3eee74..00000000000
--- a/gdb/config/i386/nto.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Target: Intel 386 running qnx6.
-TDEPFILES = i386-tdep.o i387-tdep.o corelow.o solib.o solib-svr4.o \
- i386-nto-tdep.o nto-tdep.o remote-nto.o
-TM_FILE = tm-nto.h
diff --git a/gdb/config/i386/tm-nto.h b/gdb/config/i386/tm-nto.h
deleted file mode 100644
index ff5eb7837e0..00000000000
--- a/gdb/config/i386/tm-nto.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* QNX Neutrino target header.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- This code was donated by QNX Software Systems Ltd.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_NTO_H
-#define TM_NTO_H 1
-
-/* Pick up most of what we need from the generic i386 target include file. */
-#include "i386/tm-i386.h"
-#include "tm-nto.h"
-
-#include "solib.h"
-
-#endif /* TM_NTO_H */
diff --git a/gdb/config/ia64/tm-ia64.h b/gdb/config/ia64/tm-ia64.h
index feeef09bb0c..dc36127e3cd 100644
--- a/gdb/config/ia64/tm-ia64.h
+++ b/gdb/config/ia64/tm-ia64.h
@@ -31,7 +31,7 @@
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define DEPRECATED_REGISTER_SIZE 8
+#define REGISTER_SIZE 8
#undef NUM_REGS
#define NUM_REGS 590
diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h
index 271eb7ef70e..f7e8fca6f2b 100644
--- a/gdb/config/m68k/tm-vx68.h
+++ b/gdb/config/m68k/tm-vx68.h
@@ -79,4 +79,4 @@
/* Number of registers in a ptrace_getfpregs call. */
#define VX_SIZE_FPREGS (8 * REGISTER_RAW_SIZE (FP0_REGNUM) \
- + (3 * DEPRECATED_REGISTER_SIZE))
+ + (3 * REGISTER_SIZE))
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index f9aebbe1f5a..dada6155713 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -49,10 +49,10 @@ extern int mips_step_skips_delay (CORE_ADDR);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define DEPRECATED_REGISTER_SIZE 4
+#define REGISTER_SIZE 4
/* The size of a register. This is predefined in tm-mips64.h. We
- can't use DEPRECATED_REGISTER_SIZE because that is used for various other
+ can't use REGISTER_SIZE because that is used for various other
things. */
#ifndef MIPS_REGSIZE
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index f8a2a117fa2..2cc1e300365 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -121,10 +121,9 @@ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot);
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
hppa_can_use_hw_watchpoint(type, cnt, ot)
-/* The PA can also watch memory regions of arbitrary size, since we're
- using a page-protection scheme. (On some targets, apparently watch
- registers are used, which can only accomodate regions of
- DEPRECATED_REGISTER_SIZE.) */
+/* The PA can also watch memory regions of arbitrary size, since we're using
+ a page-protection scheme. (On some targets, apparently watch registers
+ are used, which can only accomodate regions of REGISTER_SIZE.) */
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \
(1)
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 7daa6f5eadf..8646ab0dab3 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -274,20 +274,20 @@ extern void hppa_frame_init_saved_regs (struct frame_info *);
(DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \
(read_memory_integer((pc), 4) == BREAKPOINT32))
-/* Insert the specified number of args and function address into a
- call sequence of the above form stored at DUMMYNAME.
-
- On the hppa we need to call the stack dummy through $$dyncall.
- Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra
- argument, real_pc, which is the location where gdb should start up
- the inferior to do the function call. */
+/*
+ * Insert the specified number of args and function address
+ * into a call sequence of the above form stored at DUMMYNAME.
+ *
+ * On the hppa we need to call the stack dummy through $$dyncall.
+ * Therefore our version of FIX_CALL_DUMMY takes an extra argument,
+ * real_pc, which is the location where gdb should start up the
+ * inferior to do the function call.
+ */
/* FIXME: brobecker 2002-12-26. This macro is going to cause us some
- problems before we can go to multiarch partial as it has been
- diverted on HPUX to return the value of the PC! */
-/* NOTE: cagney/2003-05-03: This has been replaced by push_dummy_code.
- Hopefully that has all the parameters HP/UX needs. */
-#define DEPRECATED_FIX_CALL_DUMMY hppa_fix_call_dummy
+ problems before we can go to multiarch partial as it has been diverted
+ on HPUX to return the value of the PC! */
+#define FIX_CALL_DUMMY hppa_fix_call_dummy
extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
struct value **, struct type *, int);
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 81bf7caeb08..17f40aab37d 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -109,7 +109,7 @@ extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
real way to know how big a register is. */
#if !GDB_MULTI_ARCH
-#define DEPRECATED_REGISTER_SIZE 4
+#define REGISTER_SIZE 4
#endif
/* Number of machine registers */
@@ -308,11 +308,11 @@ extern void hppa_pop_frame (void);
#endif
#if !GDB_MULTI_ARCH
-#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
+#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
#endif
#if !GDB_MULTI_ARCH
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
+#define CALL_DUMMY_START_OFFSET 0
#endif
#if !GDB_MULTI_ARCH
@@ -357,8 +357,8 @@ extern CORE_ADDR hppa_target_read_fp (void);
push_word and a few other places, but REGISTER_RAW_SIZE is
the real way to know how big a register is. */
-#undef DEPRECATED_REGISTER_SIZE
-#define DEPRECATED_REGISTER_SIZE 8
+#undef REGISTER_SIZE
+#define REGISTER_SIZE 8
/* Number of bytes of storage in the actual machine representation
for register N. On the PA-RISC 2.0, all regs are 8 bytes, including
@@ -501,14 +501,14 @@ call_dummy
0xe820f0000fb110d3LL, 0x0001000400151820LL,\
0xe6c0000008000240LL}
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
+#define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
-/* DEPRECATED_CALL_DUMMY_LENGTH is computed based on the size of a
- word on the target machine, not the size of an instruction. Since
- a word on this target holds two instructions we have to divide the
- instruction size by two to get the word size of the dummy. */
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
+/* CALL_DUMMY_LENGTH is computed based on the size of a word on the target
+ machine, not the size of an instruction. Since a word on this target
+ holds two instructions we have to divide the instruction size by two to
+ get the word size of the dummy. */
+#undef CALL_DUMMY_LENGTH
+#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
/* The PA64 ABI mandates a 16 byte stack alignment. */
#undef STACK_ALIGN
@@ -540,12 +540,12 @@ call_dummy
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
memcpy ((VALBUF), \
((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
TYPE_LENGTH (TYPE)); \
else if (is_integral_type(TYPE)) \
memcpy ((VALBUF), \
(char *)(REGBUF) + REGISTER_BYTE (28) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 8) \
memcpy ((VALBUF), \
@@ -574,13 +574,13 @@ call_dummy
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
deprecated_write_register_bytes \
(REGISTER_BYTE (FP4_REGNUM) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (is_integral_type(TYPE)) \
deprecated_write_register_bytes \
(REGISTER_BYTE (28) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
+ (REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
(VALBUF), \
TYPE_LENGTH (TYPE)); \
else if (TYPE_LENGTH (TYPE) <= 8) \
diff --git a/gdb/config/s390/tm-s390.h b/gdb/config/s390/tm-s390.h
index 37bf770e94f..2bb4c2d2c30 100644
--- a/gdb/config/s390/tm-s390.h
+++ b/gdb/config/s390/tm-s390.h
@@ -24,15 +24,15 @@
#define TM_S390_H 1
#define S390_NUM_GPRS (16)
-#define S390_GPR_SIZE DEPRECATED_REGISTER_SIZE
-#define S390_PSW_MASK_SIZE DEPRECATED_REGISTER_SIZE
-#define S390_PSW_ADDR_SIZE DEPRECATED_REGISTER_SIZE
+#define S390_GPR_SIZE REGISTER_SIZE
+#define S390_PSW_MASK_SIZE REGISTER_SIZE
+#define S390_PSW_ADDR_SIZE REGISTER_SIZE
#define S390_NUM_FPRS (16)
#define S390_FPR_SIZE (8)
#define S390_FPC_SIZE (4)
#define S390_FPC_PAD_SIZE (4) /* gcc insists on aligning the fpregs */
#define S390_NUM_CRS (16)
-#define S390_CR_SIZE DEPRECATED_REGISTER_SIZE
+#define S390_CR_SIZE REGISTER_SIZE
#define S390_NUM_ACRS (16)
#define S390_ACR_SIZE (4)
@@ -94,7 +94,7 @@ int s390_cannot_fetch_register (int regno);
int s390x_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390x_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (1)
-#define DEPRECATED_REGISTER_SIZE (8)
+#define REGISTER_SIZE (8)
#define REGISTER_BYTES S390X_REGISTER_BYTES
#else /* CONFIG_ARCH_S390X */
@@ -102,7 +102,7 @@ int s390x_register_raw_size (int reg_nr);
int s390_register_raw_size (int reg_nr);
#define REGISTER_RAW_SIZE(reg_nr) s390_register_raw_size(reg_nr)
#define GDB_TARGET_IS_ESAME (0)
-#define DEPRECATED_REGISTER_SIZE (4)
+#define REGISTER_SIZE (4)
#define REGISTER_BYTES S390_REGISTER_BYTES
#endif /* CONFIG_ARCH_S390X */
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index b371d1297b3..f46d45915c1 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -90,26 +90,26 @@ struct type;
#undef CALL_DUMMY
#define CALL_DUMMY {0}
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH 0
+#undef CALL_DUMMY_LENGTH
+#define CALL_DUMMY_LENGTH 0
#undef CALL_DUMMY_CALL_OFFSET
#define CALL_DUMMY_CALL_OFFSET 0
-#undef DEPRECATED_CALL_DUMMY_START_OFFSET
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
-#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 0
+#undef CALL_DUMMY_START_OFFSET
+#define CALL_DUMMY_START_OFFSET 0
+#undef CALL_DUMMY_BREAKPOINT_OFFSET
+#define CALL_DUMMY_BREAKPOINT_OFFSET 0
#undef CALL_DUMMY_LOCATION
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
#undef DEPRECATED_PC_IN_CALL_DUMMY
#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
-#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS 0
+#undef SIZEOF_CALL_DUMMY_WORDS
+#define SIZEOF_CALL_DUMMY_WORDS 0
#undef CALL_DUMMY_ADDRESS
#define CALL_DUMMY_ADDRESS() entry_point_address()
-#undef DEPRECATED_FIX_CALL_DUMMY
-#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P)
+#undef FIX_CALL_DUMMY
+#define FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P)
#undef DEPRECATED_PUSH_RETURN_ADDRESS
#define DEPRECATED_PUSH_RETURN_ADDRESS(PC, SP) sparc_at_entry_push_return_address (PC, SP)
extern CORE_ADDR sparc_at_entry_push_return_address (CORE_ADDR pc,
@@ -147,20 +147,20 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
/* Size of the call dummy in bytes. */
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH 192
+#undef CALL_DUMMY_LENGTH
+#define CALL_DUMMY_LENGTH 192
/* Offset within CALL_DUMMY of the 'call' instruction. */
-#undef DEPRECATED_CALL_DUMMY_START_OFFSET
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 148
+#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 (DEPRECATED_CALL_DUMMY_START_OFFSET + (5 * 4))
+#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + (5 * 4))
/* Offset within CALL_DUMMY of the 'ta 1' instruction. */
-#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (8 * 4))
+#undef CALL_DUMMY_BREAKPOINT_OFFSET
+#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + (8 * 4))
/* Call dummy will be located on the stack. */
#undef CALL_DUMMY_LOCATION
@@ -169,15 +169,15 @@ extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address)
/* Insert the function address into the call dummy. */
-#undef DEPRECATED_FIX_CALL_DUMMY
-#define DEPRECATED_FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
+#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 DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+#undef SIZEOF_CALL_DUMMY_WORDS
#undef DEPRECATED_PUSH_RETURN_ADDRESS
#undef CALL_DUMMY_ADDRESS
#undef STORE_STRUCT_RETURN
@@ -376,8 +376,8 @@ extern void sp64_extract_return_value (struct type *, char[], char *, int);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#undef DEPRECATED_REGISTER_SIZE
-#define DEPRECATED_REGISTER_SIZE 8
+#undef REGISTER_SIZE
+#define REGISTER_SIZE 8
/* Number of bytes of storage in the actual machine representation
for register N. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index a44b04ed251..e997babd75b 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -174,7 +174,7 @@ extern int sparc_intreg_size (void);
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
-#define DEPRECATED_REGISTER_SIZE 4
+#define REGISTER_SIZE 4
/* Number of machine registers */
@@ -589,19 +589,19 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
/* Size of the call dummy in bytes. */
-#define DEPRECATED_CALL_DUMMY_LENGTH 0x38
+#define CALL_DUMMY_LENGTH 0x38
/* Offset within call dummy of first instruction to execute. */
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
+#define CALL_DUMMY_START_OFFSET 0
/* Offset within CALL_DUMMY of the 'call' instruction. */
-#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x24)
+#define CALL_DUMMY_CALL_OFFSET (CALL_DUMMY_START_OFFSET + 0x24)
/* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x30)
+#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 0x30)
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68
@@ -626,7 +626,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
-#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
+#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);
diff --git a/gdb/config/tm-nto.h b/gdb/config/tm-nto.h
deleted file mode 100644
index 359ff068b7a..00000000000
--- a/gdb/config/tm-nto.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Target machine sub-description for QNX Neutrino version 6.
- This is included by other tm-*.h files to specify nto specific
- stuff.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- This code was donated by QNX Software Systems Ltd.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _TM_QNXNTO_H
-#define _TM_QNXNTO_H
-
-#include "tm-sysv4.h"
-
-/* Setup the valid realtime signal range. */
-#define REALTIME_LO 41
-#define REALTIME_HI 56
-
-/* Set up the undefined useable signals. */
-#define RAW_SIGNAL_LO 32
-#define RAW_SIGNAL_HI (REALTIME_LO - 1)
-
-#define TARGET_SIGNAL_RAW_VALUES \
-TARGET_SIGNAL_RAW0, \
-TARGET_SIGNAL_RAW1, \
-TARGET_SIGNAL_RAW2, \
-TARGET_SIGNAL_RAW3, \
-TARGET_SIGNAL_RAW4, \
-TARGET_SIGNAL_RAW5, \
-TARGET_SIGNAL_RAW6, \
-TARGET_SIGNAL_RAW7, \
-TARGET_SIGNAL_RAW8
-
-#define TARGET_SIGNAL_RAW_TABLE \
-{"SIGNAL32", "Signal 32"}, \
-{"SIGNAL33", "Signal 33"}, \
-{"SIGNAL34", "Signal 34"}, \
-{"SIGNAL35", "Signal 35"}, \
-{"SIGNAL36", "Signal 36"}, \
-{"SIGNAL37", "Signal 37"}, \
-{"SIGNAL38", "Signal 38"}, \
-{"SIGNAL39", "Signal 39"}, \
-{"SIGNAL40", "Signal 40"}
-
-#endif /* _TM_QNXNTO_H */
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index fe4cc5d4856..aeb9e2718e1 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -51,7 +51,6 @@ arm*-*-linux*) gdb_target=linux
;;
arm*-*-netbsd*) gdb_target=nbsd
gdb_multi_arch=yes ;;
-arm-*-nto*) gdb_target=nto ;;
arm*-*-* | thumb*-*-* | strongarm*-*-*)
gdb_target=embed
configdirs="$configdirs rdi-share"
@@ -91,7 +90,6 @@ i[3456]86-*-netbsd*) gdb_target=nbsd ;;
i[3456]86-*-openbsd*) gdb_target=obsd ;;
i[3456]86-*-go32*) gdb_target=i386aout ;;
i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;;
-i[3456]86-*-nto*) gdb_target=nto ;;
i[3456]86-*-lynxos*) gdb_target=i386lynx ;;
i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
i[3456]86-*-sco*) gdb_target=i386v ;;
@@ -218,7 +216,6 @@ sh-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
sh*-*-netbsdelf*) gdb_target=nbsd ;;
-sh-*-nto*) gdb_target=nto ;;
sh*) gdb_target=embed ;;
sparc-*-aout*) gdb_target=sparc-em ;;
@@ -283,6 +280,5 @@ esac
case "${target}" in
*-*-linux*) gdb_osabi=GDB_OSABI_LINUX ;;
*-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;;
-*-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;;
*-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;;
esac
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index ff2d6d22abf..a963d21616f 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -971,7 +971,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf)
{
int len = TYPE_LENGTH (type);
- if (len <= DEPRECATED_REGISTER_SIZE)
+ if (len <= REGISTER_SIZE)
deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large.");
@@ -984,7 +984,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
{
int len = TYPE_LENGTH (type);
- if (len <= 2 * DEPRECATED_REGISTER_SIZE)
+ if (len <= 2 * REGISTER_SIZE)
{
/* Note that this works since R10 and R11 are consecutive registers. */
deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf,
@@ -1057,7 +1057,7 @@ cris_abi_original_extract_return_value (struct type *type, char *regbuf,
{
int len = TYPE_LENGTH (type);
- if (len <= DEPRECATED_REGISTER_SIZE)
+ if (len <= REGISTER_SIZE)
memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_extract_return_value: type length too large");
@@ -1071,7 +1071,7 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf,
{
int len = TYPE_LENGTH (type);
- if (len <= 2 * DEPRECATED_REGISTER_SIZE)
+ if (len <= 2 * REGISTER_SIZE)
memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_v2_extract_return_value: type length too large");
@@ -1311,13 +1311,13 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
/* Make sure there's space on the stack. Allocate space for data and a
parameter to refer to that data. */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
- stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + DEPRECATED_REGISTER_SIZE);
+ stack_alloc += (TYPE_LENGTH (VALUE_TYPE (args[argnum])) + REGISTER_SIZE);
sp -= stack_alloc;
/* We may over-allocate a little here, but that won't hurt anything. */
/* Initialize stack frame pointers. */
fp_params = sp;
- fp_data = sp + (nargs * DEPRECATED_REGISTER_SIZE);
+ fp_data = sp + (nargs * REGISTER_SIZE);
/* Now load as many as possible of the first arguments into
registers, and push the rest onto the stack. */
@@ -1330,14 +1330,14 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
len = TYPE_LENGTH (type);
val = (char *) VALUE_CONTENTS (args[argnum]);
- if (len <= DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
+ if (len <= REGISTER_SIZE && argreg <= ARG4_REGNUM)
{
/* Data fits in a register; put it in the first available
register. */
write_register (argreg, *(unsigned long *) val);
argreg++;
}
- else if (len > DEPRECATED_REGISTER_SIZE && argreg <= ARG4_REGNUM)
+ else if (len > REGISTER_SIZE && argreg <= ARG4_REGNUM)
{
/* Data does not fit in register; pass it on the stack and
put its address in the first available register. */
@@ -1346,21 +1346,21 @@ cris_abi_original_push_arguments (int nargs, struct value **args,
fp_data += len;
argreg++;
}
- else if (len > DEPRECATED_REGISTER_SIZE)
+ else if (len > REGISTER_SIZE)
{
/* Data does not fit in register; put both data and
parameter on the stack. */
write_memory (fp_data, val, len);
- write_memory (fp_params, (char *) (&fp_data), DEPRECATED_REGISTER_SIZE);
+ write_memory (fp_params, (char *) (&fp_data), REGISTER_SIZE);
fp_data += len;
- fp_params += DEPRECATED_REGISTER_SIZE;
+ fp_params += REGISTER_SIZE;
}
else
{
/* Data fits in a register, but we are out of registers;
put the parameter on the stack. */
- write_memory (fp_params, val, DEPRECATED_REGISTER_SIZE);
- fp_params += DEPRECATED_REGISTER_SIZE;
+ write_memory (fp_params, val, REGISTER_SIZE);
+ fp_params += REGISTER_SIZE;
}
}
@@ -1401,21 +1401,20 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int reg_demand;
len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
- reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
+ reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0);
- /* reg_demand * DEPRECATED_REGISTER_SIZE is the amount of memory
- we might need to allocate for this argument. 2 *
- DEPRECATED_REGISTER_SIZE is the amount of stack space we
- might need to pass the argument itself (either by value or by
+ /* reg_demand * REGISTER_SIZE is the amount of memory we might need to
+ allocate for this argument. 2 * REGISTER_SIZE is the amount of stack
+ space we might need to pass the argument itself (either by value or by
reference). */
- stack_alloc += (reg_demand * DEPRECATED_REGISTER_SIZE + 2 * DEPRECATED_REGISTER_SIZE);
+ stack_alloc += (reg_demand * REGISTER_SIZE + 2 * REGISTER_SIZE);
}
sp -= stack_alloc;
/* We may over-allocate a little here, but that won't hurt anything. */
/* Initialize frame pointers. */
fp_arg = sp;
- fp_mem = sp + (nargs * (2 * DEPRECATED_REGISTER_SIZE));
+ fp_mem = sp + (nargs * (2 * REGISTER_SIZE));
/* Now load as many as possible of the first arguments into registers,
and push the rest onto the stack. */
@@ -1433,9 +1432,9 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
val = (char *) VALUE_CONTENTS (args[argnum]);
/* How may registers worth of storage do we need for this argument? */
- reg_demand = (len / DEPRECATED_REGISTER_SIZE) + (len % DEPRECATED_REGISTER_SIZE != 0 ? 1 : 0);
+ reg_demand = (len / REGISTER_SIZE) + (len % REGISTER_SIZE != 0 ? 1 : 0);
- if (len <= (2 * DEPRECATED_REGISTER_SIZE)
+ if (len <= (2 * REGISTER_SIZE)
&& (argreg + reg_demand - 1 <= ARG4_REGNUM))
{
/* Data passed by value. Fits in available register(s). */
@@ -1443,10 +1442,10 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
write_register (argreg, *(unsigned long *) val);
argreg++;
- val += DEPRECATED_REGISTER_SIZE;
+ val += REGISTER_SIZE;
}
}
- else if (len <= (2 * DEPRECATED_REGISTER_SIZE) && argreg <= ARG4_REGNUM)
+ else if (len <= (2 * REGISTER_SIZE) && argreg <= ARG4_REGNUM)
{
/* Data passed by value. Does not fit in available register(s).
Use the register(s) first, then the stack. */
@@ -1456,29 +1455,28 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
write_register (argreg, *(unsigned long *) val);
argreg++;
- val += DEPRECATED_REGISTER_SIZE;
+ val += REGISTER_SIZE;
}
else
{
- /* I guess this memory write could write the
- remaining data all at once instead of in
- DEPRECATED_REGISTER_SIZE chunks. */
- write_memory (fp_arg, val, DEPRECATED_REGISTER_SIZE);
- fp_arg += DEPRECATED_REGISTER_SIZE;
- val += DEPRECATED_REGISTER_SIZE;
+ /* I guess this memory write could write the remaining data
+ all at once instead of in REGISTER_SIZE chunks. */
+ write_memory (fp_arg, val, REGISTER_SIZE);
+ fp_arg += REGISTER_SIZE;
+ val += REGISTER_SIZE;
}
}
}
- else if (len > (2 * DEPRECATED_REGISTER_SIZE))
+ else if (len > (2 * REGISTER_SIZE))
{
/* Data passed by reference. Put it on the stack. */
write_memory (fp_mem, val, len);
- write_memory (fp_arg, (char *) (&fp_mem), DEPRECATED_REGISTER_SIZE);
+ write_memory (fp_arg, (char *) (&fp_mem), REGISTER_SIZE);
/* fp_mem need not be word-aligned since it's just a chunk of
memory being pointed at. That is, += len would do. */
- fp_mem += reg_demand * DEPRECATED_REGISTER_SIZE;
- fp_arg += DEPRECATED_REGISTER_SIZE;
+ fp_mem += reg_demand * REGISTER_SIZE;
+ fp_arg += REGISTER_SIZE;
}
else
{
@@ -1488,7 +1486,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* fp_arg must be word-aligned (i.e., don't += len) to match
the function prologue. */
- fp_arg += reg_demand * DEPRECATED_REGISTER_SIZE;
+ fp_arg += reg_demand * REGISTER_SIZE;
}
}
@@ -4191,7 +4189,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Length of ordinary registers used in push_word and a few other places.
REGISTER_RAW_SIZE is the real way to know how big a register is. */
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
/* NEW */
set_gdbarch_register_bytes_ok (gdbarch, cris_register_bytes_ok);
@@ -4262,8 +4260,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Defined to 1 to indicate that the target supports inferior function
calls. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, 0);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, 0);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index c184b4457e7..348e9f4569d 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -51,8 +51,8 @@ struct gdbarch_tdep
{
int a0_regnum;
int nr_dmap_regs;
- unsigned long (*dmap_register) (void *regcache, int nr);
- unsigned long (*imap_register) (void *regcache, int nr);
+ unsigned long (*dmap_register) (int nr);
+ unsigned long (*imap_register) (int nr);
};
/* These are the addresses the D10V-EVA board maps data and
@@ -236,7 +236,7 @@ d10v_ts3_register_name (int reg_nr)
one of the segments. */
static unsigned long
-d10v_ts2_dmap_register (void *regcache, int reg_nr)
+d10v_ts2_dmap_register (int reg_nr)
{
switch (reg_nr)
{
@@ -244,38 +244,40 @@ d10v_ts2_dmap_register (void *regcache, int reg_nr)
case 1:
return 0x2000;
case 2:
- {
- ULONGEST reg;
- regcache_cooked_read_unsigned (regcache, TS2_DMAP_REGNUM, &reg);
- return reg;
- }
+ return read_register (TS2_DMAP_REGNUM);
default:
return 0;
}
}
static unsigned long
-d10v_ts3_dmap_register (void *regcache, int reg_nr)
+d10v_ts3_dmap_register (int reg_nr)
+{
+ return read_register (TS3_DMAP0_REGNUM + reg_nr);
+}
+
+static unsigned long
+d10v_dmap_register (int reg_nr)
+{
+ return gdbarch_tdep (current_gdbarch)->dmap_register (reg_nr);
+}
+
+static unsigned long
+d10v_ts2_imap_register (int reg_nr)
{
- ULONGEST reg;
- regcache_cooked_read_unsigned (regcache, TS3_DMAP0_REGNUM + reg_nr, &reg);
- return reg;
+ return read_register (TS2_IMAP0_REGNUM + reg_nr);
}
static unsigned long
-d10v_ts2_imap_register (void *regcache, int reg_nr)
+d10v_ts3_imap_register (int reg_nr)
{
- ULONGEST reg;
- regcache_cooked_read_unsigned (regcache, TS2_IMAP0_REGNUM + reg_nr, &reg);
- return reg;
+ return read_register (TS3_IMAP0_REGNUM + reg_nr);
}
static unsigned long
-d10v_ts3_imap_register (void *regcache, int reg_nr)
+d10v_imap_register (int reg_nr)
{
- ULONGEST reg;
- regcache_cooked_read_unsigned (regcache, TS3_IMAP0_REGNUM + reg_nr, &reg);
- return reg;
+ return gdbarch_tdep (current_gdbarch)->imap_register (reg_nr);
}
/* MAP GDB's internal register numbering (determined by the layout fo
@@ -802,7 +804,6 @@ static void
d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum, int all)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (regnum >= 0)
{
default_print_registers_info (gdbarch, file, frame, regnum, all);
@@ -846,26 +847,23 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
if (a > 0)
fprintf_filtered (file, " ");
- fprintf_filtered (file, "IMAP%d %04lx", a,
- tdep->imap_register (current_regcache, a));
+ fprintf_filtered (file, "IMAP%d %04lx", a, d10v_imap_register (a));
}
if (nr_dmap_regs (gdbarch) == 1)
/* Registers DMAP0 and DMAP1 are constant. Just return dmap2. */
- fprintf_filtered (file, " DMAP %04lx\n",
- tdep->dmap_register (current_regcache, 2));
+ fprintf_filtered (file, " DMAP %04lx\n", d10v_dmap_register (2));
else
{
for (a = 0; a < nr_dmap_regs (gdbarch); a++)
{
- fprintf_filtered (file, " DMAP%d %04lx", a,
- tdep->dmap_register (current_regcache, a));
+ fprintf_filtered (file, " DMAP%d %04lx", a, d10v_dmap_register (a));
}
fprintf_filtered (file, "\n");
}
}
{
- char num[MAX_REGISTER_SIZE];
+ char *num = alloca (max_register_size (gdbarch));
int a;
fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1);
for (a = a0_regnum (gdbarch); a < a0_regnum (gdbarch) + NR_A_REGS; a++)
@@ -1102,16 +1100,15 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
VM system works, we just call that to do the translation. */
static void
-remote_d10v_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR memaddr, int nr_bytes,
+remote_d10v_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
long out_addr;
long out_len;
- out_len = sim_d10v_translate_addr (memaddr, nr_bytes, &out_addr, regcache,
- tdep->dmap_register, tdep->imap_register);
+ out_len = sim_d10v_translate_addr (memaddr, nr_bytes,
+ &out_addr,
+ d10v_dmap_register,
+ d10v_imap_register);
*targ_addr = out_addr;
*targ_len = out_len;
}
diff --git a/gdb/defs.h b/gdb/defs.h
index d4427830639..35d23df9caa 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -211,8 +211,7 @@ enum language
language_m2, /* Modula-2 */
language_asm, /* Assembly language */
language_scm, /* Scheme / Guile */
- language_pascal, /* Pascal */
- language_minimal /* All other languages, minimal support only */
+ language_pascal /* Pascal */
};
enum precision_type
@@ -1086,10 +1085,28 @@ extern void *alloca ();
#include "arch-utils.h"
#endif
-/* Maximum size of a register. Something small, but large enough for
- all known ISAs. If it turns out to be too small, make it bigger. */
+/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they
+ migrate to the overhauled register cache.
+
+ The problem is that some architectures specify different sized raw
+ and cooked (nee virtual) register sizes. They shouldn't. Instead,
+ all architectures should just implement a gdbarch_register_type().
+ That can be used to compute all needed register attributes. While
+ waiting for the conversion, provide compatibility macros that keep
+ old code working. */
+
+#ifdef MAX_REGISTER_RAW_SIZE
+#error MAX_REGISTER_RAW_SIZE defined
+#endif
+extern int legacy_max_register_raw_size (void);
+#define MAX_REGISTER_RAW_SIZE legacy_max_register_raw_size ()
+
+#ifdef MAX_REGISTER_VIRTUAL_SIZE
+#error MAX_REGISTER_VIRTUAL_SIZE defined
+#endif
+extern int legacy_max_register_virtual_size (void);
+#define MAX_REGISTER_VIRTUAL_SIZE legacy_max_register_virtual_size ()
-enum { MAX_REGISTER_SIZE = 16 };
/* Static target-system-dependent parameters for GDB. */
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index e5258378b61..f8904e1f7af 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,32 +1,3 @@
-2003-05-08 Jim Blandy <jimb@redhat.com>
-
- * gdb.texinfo (Dump/Restore Files): Update documentation for
- 'dump', 'append', and 'restore': note that format argument is
- optional; simplify presentation of the command variants; and be
- more precise about the formats.
-
-2003-05-07 Jim Blandy <jimb@redhat.com>
-
- * gdb.texinfo (Symbols): Update documentation: 'maint list
- symtabs' and 'maint list psymtabs' have been renamed 'maint info
- symtabs' and 'maint info psymtabs'.
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * gdbint.texinfo (Target Architecture Definition): Make
- CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_LENGTH,
- FIX_CALL_DUMMY, CALL_DUMMY_BREAKPOINT_OFFSET and
- CALL_DUMMY_BREAKPOINT_OFFSET deprecated.
-
-2003-05-04 Andrew Cagney <cagney@redhat.com>
-
- * gdb.texinfo (Maintenance Commands): Document "maint print
- dummy-frames".
-
-2003-05-04 Andrew Cagney <cagney@redhat.com>
-
- * gdb.texinfo (GDB/MI Symbol Query): Use @{ and @}.
-
2003-05-03 J. Brobecker <brobecker@gnat.com>
Thierry Schneider <tpschneider1@yahoo.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9136e653773..7524e763dbc 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -5861,53 +5861,62 @@ Disable @value{GDBN} from caching target memory. This is the default.
@cindex append data to a file
@cindex dump data to a file
@cindex restore data from a file
+@kindex dump
+@kindex append
+@kindex restore
-You can use the commands @code{dump}, @code{append}, and
-@code{restore} to copy data between target memory and a file. The
-@code{dump} and @code{append} commands write data to a file, and the
-@code{restore} command reads data from a file back into the inferior's
-memory. Files may be in binary, Motorola S-record, Intel hex, or
-Tektronix Hex format; however, @value{GDBN} can only append to binary
-files.
+The commands @code{dump}, @code{append}, and @code{restore} are used
+for copying data between target memory and a file. Data is written
+into a file using @code{dump} or @code{append}, and restored from a
+file into memory by using @code{restore}. Files may be binary, srec,
+intel hex, or tekhex (but only binary files can be appended).
@table @code
+@kindex dump binary
+@kindex append binary
+@item dump binary memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+raw binary format file @var{filename}.
-@kindex dump
-@item dump @r{[}@var{format}@r{]} memory @var{filename} @var{start_addr} @var{end_addr}
-@itemx dump @r{[}@var{format}@r{]} value @var{filename} @var{expr}
-Dump the contents of memory from @var{start_addr} to @var{end_addr},
-or the value of @var{expr}, to @var{filename} in the given format.
+@item append binary memory @var{filename} @var{start_addr} @var{end_addr}
+Append contents of memory from @var{start_addr} to @var{end_addr} to
+raw binary format file @var{filename}.
-The @var{format} parameter may be any one of:
-@table @code
-@item binary
-Raw binary form.
-@item ihex
-Intel hex format.
-@item srec
-Motorola S-record format.
-@item tekhex
-Tektronix Hex format.
-@end table
+@item dump binary value @var{filename} @var{expression}
+Dump value of @var{expression} into raw binary format file @var{filename}.
-@value{GDBN} uses the same definitions of these formats as the
-@sc{gnu} binary utilities, like @samp{objdump} and @samp{objcopy}. If
-@var{format} is omitted, @value{GDBN} dumps the data in raw binary
-form.
+@item append binary memory @var{filename} @var{expression}
+Append value of @var{expression} to raw binary format file @var{filename}.
-@kindex append
-@item append @r{[}binary@r{]} memory @var{filename} @var{start_addr} @var{end_addr}
-@itemx append @r{[}binary@r{]} value @var{filename} @var{expr}
-Append the contents of memory from @var{start_addr} to @var{end_addr},
-or the value of @var{expr}, to @var{filename}, in raw binary form.
-(@value{GDBN} can only append data to files in raw binary form.)
+@kindex dump ihex
+@item dump ihex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+intel hex format file @var{filename}.
-@kindex restore
-@item restore @var{filename} @r{[}binary@r{]} @var{bias} @var{start} @var{end}
-Restore the contents of file @var{filename} into memory. The
-@code{restore} command can automatically recognize any known @sc{bfd}
-file format, except for raw binary. To restore a raw binary file you
-must specify the optional keyword @code{binary} after the filename.
+@item dump ihex value @var{filename} @var{expression}
+Dump value of @var{expression} into intel hex format file @var{filename}.
+
+@kindex dump srec
+@item dump srec memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+srec format file @var{filename}.
+
+@item dump srec value @var{filename} @var{expression}
+Dump value of @var{expression} into srec format file @var{filename}.
+
+@kindex dump tekhex
+@item dump tekhex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+tekhex format file @var{filename}.
+
+@item dump tekhex value @var{filename} @var{expression}
+Dump value of @var{expression} into tekhex format file @var{filename}.
+
+@item restore @var{filename} [@var{binary}] @var{bias} @var{start} @var{end}
+Restore the contents of file @var{filename} into memory. The @code{restore}
+command can automatically recognize any known bfd file format, except for
+raw binary. To restore a raw binary file you must use the optional argument
+@var{binary} after the filename.
If @var{bias} is non-zero, its value will be added to the addresses
contained in the file. Binary files always start at address zero, so
@@ -9022,14 +9031,14 @@ required for each object file from which @value{GDBN} has read some symbols.
@xref{Files, ,Commands to specify files}, for a discussion of how
@value{GDBN} reads symbols (in the description of @code{symbol-file}).
-@kindex maint info symtabs
-@kindex maint info psymtabs
+@kindex maint list symtabs
+@kindex maint list psymtabs
@cindex listing @value{GDBN}'s internal symbol tables
@cindex symbol tables, listing @value{GDBN}'s internal
@cindex full symbol tables, listing @value{GDBN}'s internal
@cindex partial symbol tables, listing @value{GDBN}'s internal
-@item maint info symtabs @r{[} @var{regexp} @r{]}
-@itemx maint info psymtabs @r{[} @var{regexp} @r{]}
+@item maint list symtabs @r{[} @var{regexp} @r{]}
+@itemx maint list psymtabs @r{[} @var{regexp} @r{]}
List the @code{struct symtab} or @code{struct partial_symtab}
structures whose names match @var{regexp}. If @var{regexp} is not
@@ -9038,7 +9047,7 @@ copy into a @value{GDBN} debugging this one to examine a particular
structure in more detail. For example:
@smallexample
-(@value{GDBP}) maint info psymtabs dwarf2read
+(@value{GDBP}) maint list psymtabs dwarf2read
@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
@{ psymtab /home/gnu/src/gdb/dwarf2read.c
@@ -9051,7 +9060,7 @@ structure in more detail. For example:
dependencies (none)
@}
@}
-(@value{GDBP}) maint info symtabs
+(@value{GDBP}) maint list symtabs
(@value{GDBP})
@end smallexample
@noindent
@@ -9065,7 +9074,7 @@ read the symtab for the compilation unit containing that function:
(@value{GDBP}) break dwarf2_psymtab_to_symtab
Breakpoint 1 at 0x814e5da: file /home/gnu/src/gdb/dwarf2read.c,
line 1574.
-(@value{GDBP}) maint info symtabs
+(@value{GDBP}) maint list symtabs
@{ objfile /home/gnu/build/gdb/gdb
((struct objfile *) 0x82e69d0)
@{ symtab /home/gnu/src/gdb/dwarf2read.c
@@ -17126,7 +17135,7 @@ There is no corresponding @value{GDBN} command.
@smallexample
(@value{GDBP})
-symbol-list-lines basics.c
-^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}]
+^done,lines=[{pc="0x08048554",line="7"},{pc="0x0804855a",line="8"}]
(@value{GDBP})
@end smallexample
@@ -19364,28 +19373,6 @@ Create a core file? (y or n) @kbd{n}
Takes an optional parameter that is used as the text of the error or
warning message.
-@kindex maint print dummy-frames
-@item maint print dummy-frames
-
-Prints the contents of @value{GDBN}'s internal dummy-frame stack.
-
-@smallexample
-(gdb) @kbd{b add}
-@dots{}
-(gdb) @kbd{print add(2,3)}
-Breakpoint 2, add (a=2, b=3) at @dots{}
-58 return (a + b);
-The program being debugged stopped while in a function called from GDB.
-@dots{}
-(gdb) @kbd{maint print dummy-frames}
-0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6
- top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@}
- call_lo=0x01014000 call_hi=0x01014001
-(gdb)
-@end smallexample
-
-Takes an optional file parameter.
-
@kindex maint print registers
@kindex maint print raw-registers
@kindex maint print cooked-registers
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 28cdc82242a..9896e79f372 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -3085,8 +3085,8 @@ custom breakpoint insertion and removal routines if
@code{BREAKPOINT_FROM_PC} needs to read the target's memory for some
reason.
-@item DEPRECATED_CALL_DUMMY_WORDS
-@findex DEPRECATED_CALL_DUMMY_WORDS
+@item CALL_DUMMY_WORDS
+@findex CALL_DUMMY_WORDS
Pointer to an array of @code{LONGEST} words of data containing
host-byte-ordered @code{REGISTER_BYTES} sized values that partially
specify the sequence of instructions needed for an inferior function
@@ -3098,18 +3098,17 @@ data.
This method has been replaced by @code{push_dummy_code}
(@pxref{push_dummy_code}).
-@item DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-@findex DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-The size of @code{DEPRECATED_CALL_DUMMY_WORDS}. This must return a
-positive value. See also @code{DEPRECATED_CALL_DUMMY_LENGTH}.
+@item SIZEOF_CALL_DUMMY_WORDS
+@findex SIZEOF_CALL_DUMMY_WORDS
+The size of @code{CALL_DUMMY_WORDS}. This must return a positive value.
+See also @code{CALL_DUMMY_LENGTH}.
This method has been replaced by @code{push_dummy_code}
(@pxref{push_dummy_code}).
@item CALL_DUMMY
@findex CALL_DUMMY
-A static initializer for @code{DEPRECATED_CALL_DUMMY_WORDS}.
-Deprecated.
+A static initializer for @code{CALL_DUMMY_WORDS}. Deprecated.
This method has been replaced by @code{push_dummy_code}
(@pxref{push_dummy_code}).
@@ -3722,7 +3721,7 @@ This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}.
@item CORE_ADDR push_dummy_code (@var{gdbarch}, @var{sp}, @var{funaddr}, @var{using_gcc}, @var{args}, @var{nargs}, @var{value_type}, @var{real_pc}, @var{bp_addr})
@findex push_dummy_code
-@findex DEPRECATED_FIX_CALL_DUMMY
+@findex FIX_CALL_DUMMY
@anchor{push_dummy_code} Given a stack based call dummy, push the
instruction sequence (including space for a breakpoint) to which the
called function should return.
@@ -3735,12 +3734,11 @@ By default, the stack is grown sufficient to hold a frame-aligned
(@pxref{frame_align}) breakpoint, @var{bp_addr} is set to the address
reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}.
-This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS},
-@code{DEPRECATED_SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY},
-@code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE},
-@code{GDB_TARGET_IS_HPPA},
-@code{DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET}, and
-@code{DEPRECATED_FIX_CALL_DUMMY}.
+This method replaces @code{CALL_DUMMY_WORDS},
+@code{SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY},
+@code{CALL_DUMMY_LOCATION}, @code{REGISTER_SIZE},
+@code{GDB_TARGET_IS_HPPA}, @code{CALL_DUMMY_BREAKPOINT_OFFSET}, and
+@code{FIX_CALL_DUMMY}.
@item DEPRECATED_PUSH_DUMMY_FRAME
@findex DEPRECATED_PUSH_DUMMY_FRAME
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index e16056c4412..7f3b2a2edc1 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -29,8 +29,6 @@
#include "inferior.h"
#include "gdb_assert.h"
#include "frame-unwind.h"
-#include "command.h"
-#include "gdbcmd.h"
static void dummy_frame_this_id (struct frame_info *next_frame,
void **this_prologue_cache,
@@ -151,9 +149,8 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
figure out what the real PC (as in the resume address) is BEFORE
calling this function (Oh, and I'm not even sure that this function
is called with an decremented PC, the call to pc_in_call_dummy() in
- that file is conditional on
- !DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
- targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
+ that file is conditional on !CALL_DUMMY_BREAKPOINT_OFFSET_P yet
+ generic dummy targets set CALL_DUMMY_BREAKPOINT_OFFSET. True?). */
int
pc_in_dummy_frame (CORE_ADDR pc)
@@ -421,49 +418,3 @@ dummy_frame_p (CORE_ADDR pc)
else
return NULL;
}
-
-static void
-fprint_dummy_frames (struct ui_file *file)
-{
- struct dummy_frame *s;
- for (s = dummy_frame_stack; s != NULL; s = s->next)
- {
- gdb_print_host_address (s, file);
- fprintf_unfiltered (file, ":");
- fprintf_unfiltered (file, " pc=0x%s", paddr (s->pc));
- fprintf_unfiltered (file, " fp=0x%s", paddr (s->fp));
- fprintf_unfiltered (file, " sp=0x%s", paddr (s->sp));
- fprintf_unfiltered (file, " top=0x%s", paddr (s->top));
- fprintf_unfiltered (file, " id=");
- fprint_frame_id (file, s->id);
- fprintf_unfiltered (file, " call_lo=0x%s", paddr (s->call_lo));
- fprintf_unfiltered (file, " call_hi=0x%s", paddr (s->call_hi));
- fprintf_unfiltered (file, "\n");
- }
-}
-
-static void
-maintenance_print_dummy_frames (char *args, int from_tty)
-{
- if (args == NULL)
- fprint_dummy_frames (gdb_stdout);
- else
- {
- struct ui_file *file = gdb_fopen (args, "w");
- if (file == NULL)
- perror_with_name ("maintenance print dummy-frames");
- fprint_dummy_frames (file);
- ui_file_delete (file);
- }
-}
-
-extern void _initialize_dummy_frame (void);
-
-void
-_initialize_dummy_frame (void)
-{
- add_cmd ("dummy-frames", class_maintenance, maintenance_print_dummy_frames,
- "Print the contents of the internal dummy-frame stack.",
- &maintenanceprintlist);
-
-}
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index 3d38cc436cc..bb41e8d7988 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -37,13 +37,12 @@ struct frame_id;
generic enough to be used by many targets.
The cheapest and most generic way to do CALL_DUMMY on a new target
- is probably to define CALL_DUMMY to be empty,
- DEPRECATED_CALL_DUMMY_LENGTH to zero, and CALL_DUMMY_LOCATION to
- AT_ENTRY. Then you must remember to define PUSH_RETURN_ADDRESS,
- because no call instruction will be being executed by the target.
- Also DEPRECATED_FRAME_CHAIN_VALID as
+ is probably to define CALL_DUMMY to be empty, CALL_DUMMY_LENGTH to
+ zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
+ to define PUSH_RETURN_ADDRESS, because no call instruction will be
+ being executed by the target. Also DEPRECATED_FRAME_CHAIN_VALID as
generic_{file,func}_frame_chain_valid and do not set
- DEPRECATED_FIX_CALL_DUMMY. */
+ FIX_CALL_DUMMY. */
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */
diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c
index 02a273c10e1..e7329f8988a 100644
--- a/gdb/dve3900-rom.c
+++ b/gdb/dve3900-rom.c
@@ -455,7 +455,7 @@ static void
fetch_bitmapped_register (int regno, struct bit_field *bf)
{
unsigned long val;
- unsigned char regbuf[MAX_REGISTER_SIZE];
+ unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
char *regname = NULL;
if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0]))
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 085c91cd311..81fa2071307 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -1751,7 +1751,7 @@ cfi_write_fp (CORE_ADDR val)
void
cfi_pop_frame (struct frame_info *fi)
{
- char regbuf[MAX_REGISTER_SIZE];
+ char *regbuf = alloca (MAX_REGISTER_RAW_SIZE);
int regnum;
for (regnum = 0; regnum < NUM_REGS; regnum++)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index a0a2f9beaaa..32a9f44b566 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4548,7 +4548,7 @@ set_cu_language (unsigned int lang)
case DW_LANG_Pascal83:
case DW_LANG_Modula2:
default:
- cu_language = language_minimal;
+ cu_language = language_unknown;
break;
}
cu_language_defn = language_def (cu_language);
@@ -4878,8 +4878,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
* lh->minimum_instruction_length;
line += lh->line_base + (adj_opcode % lh->line_range);
/* append row to matrix using current values */
- record_line (current_subfile, line,
- check_cu_functions (address));
+ address = check_cu_functions (address);
+ record_line (current_subfile, line, address);
basic_block = 1;
}
else switch (op_code)
@@ -4925,8 +4925,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
}
break;
case DW_LNS_copy:
- record_line (current_subfile, line,
- check_cu_functions (address));
+ address = check_cu_functions (address);
+ record_line (current_subfile, line, address);
basic_block = 0;
break;
case DW_LNS_advance_pc:
diff --git a/gdb/findvar.c b/gdb/findvar.c
index ca371d21e03..beab9fb8fe5 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -300,7 +300,7 @@ value_of_register (int regnum, struct frame_info *frame)
int optim;
struct value *reg_val;
int realnum;
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval;
/* Builtin registers lie completly outside of the range of normal
@@ -664,7 +664,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
struct value *
value_from_register (struct type *type, int regnum, struct frame_info *frame)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
CORE_ADDR addr;
int optim;
struct value *v = allocate_value (type);
@@ -699,7 +699,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
CORE_ADDR last_addr = 0;
CORE_ADDR first_addr = 0;
- value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE);
+ value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE);
/* Copy all of the data out, whereever it may be. */
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index e1d32b06452..1dc28e822d4 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -88,29 +88,6 @@ breakup_args (char *scratch, char **argv)
}
-/* When executing a command under the given shell, return non-zero
- if the '!' character should be escaped when embedded in a quoted
- command-line argument. */
-
-static int
-escape_bang_in_quoted_argument (const char *shell_file)
-{
- const int shell_file_len = strlen (shell_file);
-
- /* Bang should be escaped only in C Shells. For now, simply check
- that the shell name ends with 'csh', which covers at least csh
- and tcsh. This should be good enough for now. */
-
- if (shell_file_len < 3)
- return 0;
-
- if (shell_file[shell_file_len - 3] == 'c'
- && shell_file[shell_file_len - 2] == 's'
- && shell_file[shell_file_len - 1] == 'h')
- return 1;
-
- return 0;
-}
/* Start an inferior Unix child process and sets inferior_ptid to its pid.
EXEC_FILE is the file to run.
@@ -194,7 +171,6 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
char *p;
int need_to_quote;
- const int escape_bang = escape_bang_in_quoted_argument (shell_file);
strcat (shell_command, "exec ");
@@ -239,7 +215,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
{
if (*p == '\'')
strcat (shell_command, "'\\''");
- else if (*p == '!' && escape_bang)
+ else if (*p == '!')
strcat (shell_command, "\\!");
else
strncat (shell_command, p, 1);
@@ -428,6 +404,9 @@ startup_inferior (int ntraps)
inferior_ignoring_leading_exec_events =
target_reported_exec_events_per_exec_call () - 1;
+#ifdef STARTUP_INFERIOR
+ STARTUP_INFERIOR (pending_execs);
+#else
while (1)
{
/* Make wait_for_inferior be quiet */
@@ -465,5 +444,6 @@ startup_inferior (int ntraps)
resume (0, TARGET_SIGNAL_0); /* Just make it go on */
}
}
+#endif /* STARTUP_INFERIOR */
stop_soon = NO_STOP_QUIETLY;
}
diff --git a/gdb/frame.c b/gdb/frame.c
index a664b97999b..4af3d6c5474 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -139,7 +139,7 @@ static int frame_debug;
static int backtrace_below_main;
-void
+static void
fprint_frame_id (struct ui_file *file, struct frame_id id)
{
fprintf_unfiltered (file, "{stack=0x%s,code=0x%s}",
@@ -618,7 +618,7 @@ void
frame_unwind_signed_register (struct frame_info *frame, int regnum,
LONGEST *val)
{
- char buf[MAX_REGISTER_SIZE];
+ void *buf = alloca (MAX_REGISTER_RAW_SIZE);
frame_unwind_register (frame, regnum, buf);
(*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -627,7 +627,7 @@ void
frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
ULONGEST *val)
{
- char buf[MAX_REGISTER_SIZE];
+ void *buf = alloca (MAX_REGISTER_RAW_SIZE);
frame_unwind_register (frame, regnum, buf);
(*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -2069,12 +2069,7 @@ get_frame_type (struct frame_info *frame)
if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES
&& deprecated_frame_in_dummy (frame))
return DUMMY_FRAME;
-
- /* Some legacy code, e.g, mips_init_extra_frame_info() wants
- to determine the frame's type prior to it being completely
- initialized. Don't attempt to lazily initialize ->unwind for
- legacy code. It will be initialized in legacy_get_prev_frame(). */
- if (frame->unwind == NULL && !legacy_frame_p (current_gdbarch))
+ if (frame->unwind == NULL)
{
/* Initialize the frame's unwinder because it is that which
provides the frame's type. */
diff --git a/gdb/frame.h b/gdb/frame.h
index a8f05f35f8b..cb629d995c0 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -95,10 +95,6 @@ extern int frame_id_eq (struct frame_id l, struct frame_id r);
above about frameless functions. */
extern int frame_id_inner (struct frame_id l, struct frame_id r);
-/* Write the internal representation of a frame ID on the specified
- stream. */
-extern void fprint_frame_id (struct ui_file *file, struct frame_id id);
-
/* For every stopped thread, GDB tracks two frames: current and
selected. Current frame is the inner most frame of the selected
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index ce02b7fc6a8..d45a76d3eb1 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1057,7 +1057,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, pc_regnum);
set_gdbarch_register_name (gdbarch, frv_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4);
set_gdbarch_register_byte (gdbarch, frv_register_byte);
set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size);
@@ -1092,8 +1092,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_return_address (gdbarch, frv_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, frv_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, frv_init_extra_frame_info);
/* Settings that should be unnecessary. */
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index db9e76e9671..f4058ff67ab 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -167,7 +167,7 @@ struct gdbarch
gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
gdbarch_register_name_ftype *register_name;
- int deprecated_register_size;
+ int register_size;
int register_bytes;
gdbarch_register_byte_ftype *register_byte;
gdbarch_register_raw_size_ftype *register_raw_size;
@@ -188,14 +188,14 @@ struct gdbarch
int deprecated_use_generic_dummy_frames;
int call_dummy_location;
gdbarch_call_dummy_address_ftype *call_dummy_address;
- CORE_ADDR deprecated_call_dummy_start_offset;
- CORE_ADDR deprecated_call_dummy_breakpoint_offset;
- int deprecated_call_dummy_length;
+ CORE_ADDR call_dummy_start_offset;
+ CORE_ADDR call_dummy_breakpoint_offset;
+ int call_dummy_length;
gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy;
- LONGEST * deprecated_call_dummy_words;
- int deprecated_sizeof_call_dummy_words;
+ LONGEST * call_dummy_words;
+ int sizeof_call_dummy_words;
int deprecated_call_dummy_stack_adjust;
- gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy;
+ gdbarch_fix_call_dummy_ftype *fix_call_dummy;
gdbarch_push_dummy_code_ftype *push_dummy_code;
gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
@@ -402,7 +402,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- generic_remote_translate_xfer_address,
+ 0,
0,
0,
0,
@@ -527,8 +527,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
current_gdbarch->call_dummy_address = entry_point_address;
current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
- current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words;
- current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
+ current_gdbarch->call_dummy_words = legacy_call_dummy_words;
+ current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
current_gdbarch->register_convertible = generic_register_convertible_not;
current_gdbarch->convert_register_p = legacy_convert_register_p;
current_gdbarch->register_to_value = legacy_register_to_value;
@@ -643,7 +643,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
/* Skip verify of register_name, invalid_p == 0 */
- /* Skip verify of register_byte, has predicate */
+ /* Skip verify of register_byte, invalid_p == 0 */
/* Skip verify of register_raw_size, invalid_p == 0 */
/* Skip verify of deprecated_max_register_raw_size, has predicate */
/* Skip verify of register_virtual_size, invalid_p == 0 */
@@ -663,10 +663,10 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of call_dummy_location, invalid_p == 0 */
/* Skip verify of call_dummy_address, invalid_p == 0 */
/* Skip verify of deprecated_pc_in_call_dummy, has predicate */
- /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
- /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of call_dummy_words, invalid_p == 0 */
+ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
/* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */
- /* Skip verify of deprecated_fix_call_dummy, has predicate */
+ /* Skip verify of fix_call_dummy, has predicate */
/* Skip verify of push_dummy_code, has predicate */
/* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
@@ -916,6 +916,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->call_dummy_address
/*CALL_DUMMY_ADDRESS ()*/);
#endif
+#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
+ XSTRING (CALL_DUMMY_BREAKPOINT_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n",
+ (long) CALL_DUMMY_BREAKPOINT_OFFSET);
+#endif
+#ifdef CALL_DUMMY_LENGTH
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
+ XSTRING (CALL_DUMMY_LENGTH));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
+ CALL_DUMMY_LENGTH);
+#endif
#ifdef CALL_DUMMY_LOCATION
fprintf_unfiltered (file,
"gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
@@ -924,6 +940,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
CALL_DUMMY_LOCATION);
#endif
+#ifdef CALL_DUMMY_START_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_START_OFFSET # %s\n",
+ XSTRING (CALL_DUMMY_START_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_START_OFFSET = %ld\n",
+ (long) CALL_DUMMY_START_OFFSET);
+#endif
+#ifdef CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_WORDS # %s\n",
+ XSTRING (CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_WORDS = 0x%08lx\n",
+ (long) CALL_DUMMY_WORDS);
+#endif
#ifdef CANNOT_FETCH_REGISTER
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1002,22 +1034,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
(long) DECR_PC_AFTER_BREAK);
#endif
-#ifdef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
- XSTRING (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n",
- (long) DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET);
-#endif
-#ifdef DEPRECATED_CALL_DUMMY_LENGTH
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH # %s\n",
- XSTRING (DEPRECATED_CALL_DUMMY_LENGTH));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH = %d\n",
- DEPRECATED_CALL_DUMMY_LENGTH);
-#endif
#ifdef DEPRECATED_CALL_DUMMY_STACK_ADJUST_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1035,22 +1051,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_CALL_DUMMY_STACK_ADJUST = %d\n",
DEPRECATED_CALL_DUMMY_STACK_ADJUST);
#endif
-#ifdef DEPRECATED_CALL_DUMMY_START_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET # %s\n",
- XSTRING (DEPRECATED_CALL_DUMMY_START_OFFSET));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET = %ld\n",
- (long) DEPRECATED_CALL_DUMMY_START_OFFSET);
-#endif
-#ifdef DEPRECATED_CALL_DUMMY_WORDS
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS # %s\n",
- XSTRING (DEPRECATED_CALL_DUMMY_WORDS));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS = 0x%08lx\n",
- (long) DEPRECATED_CALL_DUMMY_WORDS);
-#endif
#ifdef DEPRECATED_DO_REGISTERS_INFO_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1139,29 +1139,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED);
#endif
-#ifdef DEPRECATED_FIX_CALL_DUMMY_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_FIX_CALL_DUMMY_P()",
- XSTRING (DEPRECATED_FIX_CALL_DUMMY_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY_P() = %d\n",
- DEPRECATED_FIX_CALL_DUMMY_P ());
-#endif
-#ifdef DEPRECATED_FIX_CALL_DUMMY
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
- XSTRING (DEPRECATED_FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_fix_call_dummy
- /*DEPRECATED_FIX_CALL_DUMMY ()*/);
-#endif
#ifdef DEPRECATED_FP_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
@@ -1479,14 +1456,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_push_return_address
/*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
#endif
-#ifdef DEPRECATED_REGISTER_SIZE
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
- XSTRING (DEPRECATED_REGISTER_SIZE));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
- DEPRECATED_REGISTER_SIZE);
-#endif
#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1507,14 +1476,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_saved_pc_after_call
/*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
#endif
-#ifdef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS # %s\n",
- XSTRING (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS = %d\n",
- DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
-#endif
#ifdef DEPRECATED_STORE_RETURN_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1684,6 +1645,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->extract_struct_value_address
/*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
+#ifdef FIX_CALL_DUMMY_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FIX_CALL_DUMMY_P()",
+ XSTRING (FIX_CALL_DUMMY_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FIX_CALL_DUMMY_P() = %d\n",
+ FIX_CALL_DUMMY_P ());
+#endif
+#ifdef FIX_CALL_DUMMY
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
+ XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n",
+ (long) current_gdbarch->fix_call_dummy
+ /*FIX_CALL_DUMMY ()*/);
+#endif
#ifdef FP0_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: FP0_REGNUM # %s\n",
@@ -1991,15 +1975,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: push_dummy_code = 0x%08lx\n",
(long) current_gdbarch->push_dummy_code);
-#ifdef REGISTER_BYTE_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REGISTER_BYTE_P()",
- XSTRING (REGISTER_BYTE_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTE_P() = %d\n",
- REGISTER_BYTE_P ());
-#endif
#ifdef REGISTER_BYTE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2111,6 +2086,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->register_sim_regno
/*REGISTER_SIM_REGNO ()*/);
#endif
+#ifdef REGISTER_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIZE # %s\n",
+ XSTRING (REGISTER_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIZE = %d\n",
+ REGISTER_SIZE);
+#endif
#ifdef REGISTER_TO_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -2184,10 +2167,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->reg_struct_has_addr
/*REG_STRUCT_HAS_ADDR ()*/);
#endif
+#ifdef REMOTE_TRANSLATE_XFER_ADDRESS
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len)",
+ XSTRING (REMOTE_TRANSLATE_XFER_ADDRESS (gdb_addr, gdb_len, rem_addr, rem_len)));
+#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
- (long) current_gdbarch->remote_translate_xfer_address);
+ "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->remote_translate_xfer_address
+ /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/);
+#endif
#ifdef RETURN_VALUE_ON_STACK
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2273,6 +2266,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->sigtramp_start
/*SIGTRAMP_START ()*/);
#endif
+#ifdef SIZEOF_CALL_DUMMY_WORDS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n",
+ XSTRING (SIZEOF_CALL_DUMMY_WORDS));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = %d\n",
+ SIZEOF_CALL_DUMMY_WORDS);
+#endif
#ifdef SKIP_PROLOGUE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -3285,19 +3286,19 @@ set_gdbarch_register_name (struct gdbarch *gdbarch,
}
int
-gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
+gdbarch_register_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
- return gdbarch->deprecated_register_size;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
+ return gdbarch->register_size;
}
void
-set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
- int deprecated_register_size)
+set_gdbarch_register_size (struct gdbarch *gdbarch,
+ int register_size)
{
- gdbarch->deprecated_register_size = deprecated_register_size;
+ gdbarch->register_size = register_size;
}
int
@@ -3317,20 +3318,12 @@ set_gdbarch_register_bytes (struct gdbarch *gdbarch,
}
int
-gdbarch_register_byte_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->register_byte != generic_register_byte;
-}
-
-int
gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->register_byte == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_byte invalid");
- /* Ignore predicate (gdbarch->register_byte != generic_register_byte). */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
return gdbarch->register_byte (reg_nr);
@@ -3739,51 +3732,51 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
}
CORE_ADDR
-gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch)
+gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_start_offset called\n");
- return gdbarch->deprecated_call_dummy_start_offset;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
+ return gdbarch->call_dummy_start_offset;
}
void
-set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch,
- CORE_ADDR deprecated_call_dummy_start_offset)
+set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
+ CORE_ADDR call_dummy_start_offset)
{
- gdbarch->deprecated_call_dummy_start_offset = deprecated_call_dummy_start_offset;
+ gdbarch->call_dummy_start_offset = call_dummy_start_offset;
}
CORE_ADDR
-gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
+gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_breakpoint_offset called\n");
- return gdbarch->deprecated_call_dummy_breakpoint_offset;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
+ return gdbarch->call_dummy_breakpoint_offset;
}
void
-set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
- CORE_ADDR deprecated_call_dummy_breakpoint_offset)
+set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
+ CORE_ADDR call_dummy_breakpoint_offset)
{
- gdbarch->deprecated_call_dummy_breakpoint_offset = deprecated_call_dummy_breakpoint_offset;
+ gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset;
}
int
-gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch)
+gdbarch_call_dummy_length (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_length called\n");
- return gdbarch->deprecated_call_dummy_length;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
+ return gdbarch->call_dummy_length;
}
void
-set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch,
- int deprecated_call_dummy_length)
+set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
+ int call_dummy_length)
{
- gdbarch->deprecated_call_dummy_length = deprecated_call_dummy_length;
+ gdbarch->call_dummy_length = call_dummy_length;
}
int
@@ -3814,37 +3807,37 @@ set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch,
}
LONGEST *
-gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch)
+gdbarch_call_dummy_words (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_words called\n");
- return gdbarch->deprecated_call_dummy_words;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
+ return gdbarch->call_dummy_words;
}
void
-set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch,
- LONGEST * deprecated_call_dummy_words)
+set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
+ LONGEST * call_dummy_words)
{
- gdbarch->deprecated_call_dummy_words = deprecated_call_dummy_words;
+ gdbarch->call_dummy_words = call_dummy_words;
}
int
-gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch)
+gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
+ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sizeof_call_dummy_words called\n");
- return gdbarch->deprecated_sizeof_call_dummy_words;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
+ return gdbarch->sizeof_call_dummy_words;
}
void
-set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch,
- int deprecated_sizeof_call_dummy_words)
+set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
+ int sizeof_call_dummy_words)
{
- gdbarch->deprecated_sizeof_call_dummy_words = deprecated_sizeof_call_dummy_words;
+ gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words;
}
int
@@ -3871,29 +3864,29 @@ set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch,
}
int
-gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch)
+gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->deprecated_fix_call_dummy != 0;
+ return gdbarch->fix_call_dummy != 0;
}
void
-gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
+gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->deprecated_fix_call_dummy == 0)
+ if (gdbarch->fix_call_dummy == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_deprecated_fix_call_dummy invalid");
+ "gdbarch: gdbarch_fix_call_dummy invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n");
- gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
+ gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
}
void
-set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch,
- gdbarch_deprecated_fix_call_dummy_ftype deprecated_fix_call_dummy)
+set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
+ gdbarch_fix_call_dummy_ftype fix_call_dummy)
{
- gdbarch->deprecated_fix_call_dummy = deprecated_fix_call_dummy;
+ gdbarch->fix_call_dummy = fix_call_dummy;
}
int
@@ -4756,7 +4749,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
}
void
-gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
+gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->remote_translate_xfer_address == 0)
@@ -4764,7 +4757,7 @@ gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache
"gdbarch: gdbarch_remote_translate_xfer_address invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
- gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
+ gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len);
}
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 1a8e386e1a0..f00cc34a360 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -721,13 +721,13 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register
#endif
#endif
-extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_SIZE)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE"
+extern int gdbarch_register_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE)
+#error "Non multi-arch definition of REGISTER_SIZE"
#endif
-#if !defined (DEPRECATED_REGISTER_SIZE)
-#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
+#if !defined (REGISTER_SIZE)
+#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
#endif
extern int gdbarch_register_bytes (struct gdbarch *gdbarch);
@@ -739,32 +739,6 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by
#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
#endif
-/* NOTE: cagney/2002-05-02: This function with predicate has a valid
- (callable) initial value. As a consequence, even when the predicate
- is false, the corresponding function works. This simplifies the
- migration process - old code, calling REGISTER_BYTE, doesn't need to
- be modified. */
-
-#if defined (REGISTER_BYTE)
-/* Legacy for systems yet to multi-arch REGISTER_BYTE */
-#if !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (0)
-#endif
-
-extern int gdbarch_register_byte_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P)
-#error "Non multi-arch definition of REGISTER_BYTE"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (gdbarch_register_byte_p (current_gdbarch))
-#endif
-
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE)
#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr))
@@ -782,8 +756,10 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
- REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+ by REGISTER_TYPE. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE)
@@ -802,9 +778,10 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi
#endif
#endif
-/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
- DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
- MAX_REGISTER_SIZE (a constant). */
+/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+ by REGISTER_TYPE. */
#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
@@ -842,8 +819,10 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
- REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+ by REGISTER_TYPE. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE)
@@ -862,9 +841,10 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
- DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
- MAX_REGISTER_SIZE (a constant). */
+/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+ by REGISTER_TYPE. */
#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
@@ -902,8 +882,10 @@ extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gd
#endif
#endif
-/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
- REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
+/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+ REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced
+ by REGISTER_TYPE. */
#if defined (REGISTER_VIRTUAL_TYPE)
/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */
@@ -1190,35 +1172,35 @@ extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_cal
/* Replaced by push_dummy_code. */
-extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET"
+extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET)
+#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET"
#endif
-#if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
-#define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch))
+#if !defined (CALL_DUMMY_START_OFFSET)
+#define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
#endif
/* Replaced by push_dummy_code. */
-extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET"
+extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET)
+#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET"
#endif
-#if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch))
+#if !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
+#define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
#endif
/* Replaced by push_dummy_code. */
-extern int gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, int deprecated_call_dummy_length);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_LENGTH)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_LENGTH"
+extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH)
+#error "Non multi-arch definition of CALL_DUMMY_LENGTH"
#endif
-#if !defined (DEPRECATED_CALL_DUMMY_LENGTH)
-#define DEPRECATED_CALL_DUMMY_LENGTH (gdbarch_deprecated_call_dummy_length (current_gdbarch))
+#if !defined (CALL_DUMMY_LENGTH)
+#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
#endif
/* NOTE: cagney/2002-11-24: This function with predicate has a valid
@@ -1267,33 +1249,33 @@ extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gd
/* Replaced by push_dummy_code. */
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS)
-#define DEPRECATED_CALL_DUMMY_WORDS (legacy_call_dummy_words)
+#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_WORDS)
+#define CALL_DUMMY_WORDS (legacy_call_dummy_words)
#endif
-extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS"
+extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of CALL_DUMMY_WORDS"
#endif
-#if !defined (DEPRECATED_CALL_DUMMY_WORDS)
-#define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch))
+#if !defined (CALL_DUMMY_WORDS)
+#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
#endif
/* Replaced by push_dummy_code. */
/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
+#if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS)
+#define SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
#endif
-extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS"
+extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch);
+extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS)
+#error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS"
#endif
-#if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch))
+#if !defined (SIZEOF_CALL_DUMMY_WORDS)
+#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
#endif
/* Replaced by push_dummy_code. */
@@ -1336,44 +1318,44 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba
/* Replaced by push_dummy_code. */
-#if defined (DEPRECATED_FIX_CALL_DUMMY)
-/* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */
-#if !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (1)
+#if defined (FIX_CALL_DUMMY)
+/* Legacy for systems yet to multi-arch FIX_CALL_DUMMY */
+#if !defined (FIX_CALL_DUMMY_P)
+#define FIX_CALL_DUMMY_P() (1)
#endif
#endif
/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY_P)
+#define FIX_CALL_DUMMY_P() (0)
#endif
-extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
+extern int gdbarch_fix_call_dummy_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY_P)
+#error "Non multi-arch definition of FIX_CALL_DUMMY"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY_P)
+#define FIX_CALL_DUMMY_P() (gdbarch_fix_call_dummy_p (current_gdbarch))
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY)
-#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "DEPRECATED_FIX_CALL_DUMMY"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (FIX_CALL_DUMMY)
+#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0)
#endif
-typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY)
-#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
+typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
+extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
+extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY)
+#error "Non multi-arch definition of FIX_CALL_DUMMY"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY)
-#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY)
+#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
#endif
#endif
-/* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */
+/* This is a replacement for FIX_CALL_DUMMY et.al. */
extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
@@ -2253,9 +2235,22 @@ extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADD
#endif
#endif
-typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
-extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
+#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (generic_remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len))
+#endif
+
+typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
+extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS)
+#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
+#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
+#endif
+#endif
extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 16165a9858a..37e61b0e4ee 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -472,30 +472,33 @@ f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no
f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0
-v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
+v::REGISTER_SIZE:int:register_size
v::REGISTER_BYTES:int:register_bytes
-# NOTE: cagney/2002-05-02: This function with predicate has a valid
-# (callable) initial value. As a consequence, even when the predicate
-# is false, the corresponding function works. This simplifies the
-# migration process - old code, calling REGISTER_BYTE, doesn't need to
-# be modified.
-F::REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
-# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
-# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
+f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0
+# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+# by REGISTER_TYPE.
f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
-# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
-# MAX_REGISTER_SIZE (a constant).
+# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+# by REGISTER_TYPE.
V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
-# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
-# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+# by REGISTER_TYPE.
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
-# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE are all being replaced by
-# MAX_REGISTER_SIZE (a constant).
+# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
+# by REGISTER_TYPE.
V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size
-# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
-# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
+# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
+# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced
+# by REGISTER_TYPE.
F:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0:
#
@@ -525,11 +528,11 @@ v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
# Replaced by push_dummy_code.
f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0
# Replaced by push_dummy_code.
-v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
+v::CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset
# Replaced by push_dummy_code.
-v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset
+v::CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset
# Replaced by push_dummy_code.
-v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length
+v::CALL_DUMMY_LENGTH:int:call_dummy_length
# NOTE: cagney/2002-11-24: This function with predicate has a valid
# (callable) initial value. As a consequence, even when the predicate
# is false, the corresponding function works. This simplifies the
@@ -537,14 +540,14 @@ v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length
# doesn't need to be modified.
F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy
# Replaced by push_dummy_code.
-v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
+v::CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
# Replaced by push_dummy_code.
-v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
+v::SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
# Replaced by push_dummy_code.
V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0
# Replaced by push_dummy_code.
-F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
-# This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al.
+F::FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
+# This is a replacement for FIX_CALL_DUMMY et.al.
M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr:
F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
@@ -598,7 +601,7 @@ v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
f:2:PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0
v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
#
-m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
+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
diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h
index 8c4490ec940..e626eb5f9e4 100644
--- a/gdb/gdbcmd.h
+++ b/gdb/gdbcmd.h
@@ -98,6 +98,10 @@ extern struct cmd_list_element *maintenanceinfolist;
extern struct cmd_list_element *maintenanceprintlist;
+/* Chain containing all defined "maintenance list" subcommands. */
+
+extern struct cmd_list_element *maintenancelistlist;
+
extern struct cmd_list_element *setprintlist;
extern struct cmd_list_element *showprintlist;
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 09dea26ca8c..f336d91f48d 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -44,6 +44,7 @@ struct thread_info
int num; /* Convenient handle (GDB thread id) */
/* State from wait_for_inferior */
CORE_ADDR prev_pc;
+ char *prev_func_name;
struct breakpoint *step_resume_breakpoint;
struct breakpoint *through_sigtramp_breakpoint;
CORE_ADDR step_range_start;
@@ -116,6 +117,7 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *);
/* infrun context switch: save the debugger state for the given thread. */
extern void save_infrun_state (ptid_t ptid,
CORE_ADDR prev_pc,
+ char *prev_func_name,
int trap_expected,
struct breakpoint *step_resume_breakpoint,
struct breakpoint *through_sigtramp_breakpoint,
@@ -135,6 +137,7 @@ extern void save_infrun_state (ptid_t ptid,
for the given thread. */
extern void load_infrun_state (ptid_t ptid,
CORE_ADDR *prev_pc,
+ char **prev_func_name,
int *trap_expected,
struct breakpoint **step_resume_breakpoint,
struct breakpoint **through_sigtramp_breakpoint,
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 3e12afdb7ff..614bc813e31 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1104,7 +1104,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, h8300_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, BINWORD);
+ set_gdbarch_register_size (gdbarch, BINWORD);
set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
set_gdbarch_register_byte (gdbarch, h8300_register_byte);
set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size);
@@ -1156,8 +1156,8 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index d524bae33c1..db761ac59e4 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -200,7 +200,7 @@ extern int exception_catchpoints_are_fragile;
int
hppa_use_struct_convention (int gcc_p, struct type *type)
{
- return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
+ return (TYPE_LENGTH (type) > 2 * REGISTER_SIZE);
}
@@ -904,16 +904,16 @@ hppa_frame_saved_pc (struct frame_info *frame)
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
- * DEPRECATED_CALL_DUMMY_LENGTH)
+ + ((REGISTER_SIZE / INSTRUCTION_SIZE)
+ * CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * DEPRECATED_REGISTER_SIZE)
+ + (32 * REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * DEPRECATED_REGISTER_SIZE)))))
+ + (6 * REGISTER_SIZE)))))
{
return read_memory_integer ((get_frame_base (frame)
+ (TARGET_PTR_BIT == 64 ? -16 : -20)),
@@ -1467,24 +1467,24 @@ hppa_push_dummy_frame (void)
/* The 32bit and 64bit ABIs save the return pointer into different
stack slots. */
- if (DEPRECATED_REGISTER_SIZE == 8)
- write_memory (sp - 16, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
+ if (REGISTER_SIZE == 8)
+ write_memory (sp - 16, (char *) &int_buffer, REGISTER_SIZE);
else
- write_memory (sp - 20, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
+ write_memory (sp - 20, (char *) &int_buffer, REGISTER_SIZE);
int_buffer = deprecated_read_fp ();
- write_memory (sp, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
+ write_memory (sp, (char *) &int_buffer, REGISTER_SIZE);
write_register (DEPRECATED_FP_REGNUM, sp);
- sp += 2 * DEPRECATED_REGISTER_SIZE;
+ sp += 2 * REGISTER_SIZE;
for (regnum = 1; regnum < 32; regnum++)
if (regnum != RP_REGNUM && regnum != DEPRECATED_FP_REGNUM)
sp = push_word (sp, read_register (regnum));
/* This is not necessary for the 64bit ABI. In fact it is dangerous. */
- if (DEPRECATED_REGISTER_SIZE != 8)
+ if (REGISTER_SIZE != 8)
sp += 4;
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
@@ -1510,37 +1510,37 @@ find_dummy_frame_regs (struct frame_info *frame,
int i;
/* The 32bit and 64bit ABIs save RP into different locations. */
- if (DEPRECATED_REGISTER_SIZE == 8)
+ if (REGISTER_SIZE == 8)
frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3;
else
frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3;
frame_saved_regs[DEPRECATED_FP_REGNUM] = fp;
- frame_saved_regs[1] = fp + (2 * DEPRECATED_REGISTER_SIZE);
+ frame_saved_regs[1] = fp + (2 * REGISTER_SIZE);
- for (fp += 3 * DEPRECATED_REGISTER_SIZE, i = 3; i < 32; i++)
+ for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
{
if (i != DEPRECATED_FP_REGNUM)
{
frame_saved_regs[i] = fp;
- fp += DEPRECATED_REGISTER_SIZE;
+ fp += REGISTER_SIZE;
}
}
/* This is not necessary or desirable for the 64bit ABI. */
- if (DEPRECATED_REGISTER_SIZE != 8)
+ if (REGISTER_SIZE != 8)
fp += 4;
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
frame_saved_regs[i] = fp;
frame_saved_regs[IPSW_REGNUM] = fp;
- frame_saved_regs[SAR_REGNUM] = fp + DEPRECATED_REGISTER_SIZE;
- frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * DEPRECATED_REGISTER_SIZE;
- frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * DEPRECATED_REGISTER_SIZE;
- frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * DEPRECATED_REGISTER_SIZE;
- frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE;
+ frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
+ frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
+ frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
+ frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
}
void
@@ -1564,7 +1564,7 @@ hppa_pop_frame (void)
for (regnum = 31; regnum > 0; regnum--)
if (fsr[regnum])
write_register (regnum, read_memory_integer (fsr[regnum],
- DEPRECATED_REGISTER_SIZE));
+ REGISTER_SIZE));
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
if (fsr[regnum])
@@ -1577,18 +1577,18 @@ hppa_pop_frame (void)
if (fsr[IPSW_REGNUM])
write_register (IPSW_REGNUM,
read_memory_integer (fsr[IPSW_REGNUM],
- DEPRECATED_REGISTER_SIZE));
+ REGISTER_SIZE));
if (fsr[SAR_REGNUM])
write_register (SAR_REGNUM,
read_memory_integer (fsr[SAR_REGNUM],
- DEPRECATED_REGISTER_SIZE));
+ REGISTER_SIZE));
/* If the PC was explicitly saved, then just restore it. */
if (fsr[PCOQ_TAIL_REGNUM])
{
npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM],
- DEPRECATED_REGISTER_SIZE);
+ REGISTER_SIZE);
write_register (PCOQ_TAIL_REGNUM, npc);
}
/* Else use the value in %rp to set the new PC. */
@@ -1598,7 +1598,7 @@ hppa_pop_frame (void)
write_pc (npc);
}
- write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, DEPRECATED_REGISTER_SIZE));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
if (fsr[IPSW_REGNUM]) /* call dummy */
write_register (SP_REGNUM, fp - 48);
@@ -1667,7 +1667,7 @@ restore_pc_queue (CORE_ADDR *fsr)
right place. */
write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM],
- DEPRECATED_REGISTER_SIZE));
+ REGISTER_SIZE));
write_register (22, new_pc);
for (insn_count = 0; insn_count < 3; insn_count++)
@@ -1747,7 +1747,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
the left. We do this by promoting them to full-width,
although the ABI says to pad them with garbage. */
if (is_integral_type (arg_type)
- && TYPE_LENGTH (arg_type) < DEPRECATED_REGISTER_SIZE)
+ && TYPE_LENGTH (arg_type) < REGISTER_SIZE)
{
args[i] = value_cast ((TYPE_UNSIGNED (arg_type)
? builtin_type_unsigned_long
@@ -1760,7 +1760,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
offset[i] = cum_bytes_reserved;
@@ -1772,8 +1772,8 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (bytes_reserved > 8)
{
/* Round up the offset to a multiple of two slots. */
- int new_offset = ((offset[i] + 2*DEPRECATED_REGISTER_SIZE-1)
- & -(2*DEPRECATED_REGISTER_SIZE));
+ int new_offset = ((offset[i] + 2*REGISTER_SIZE-1)
+ & -(2*REGISTER_SIZE));
/* Note the space we've wasted, if any. */
bytes_reserved += new_offset - offset[i];
@@ -1860,15 +1860,15 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
offset[i] = (cum_bytes_reserved
+ (lengths[i] > 4 ? bytes_reserved : lengths[i]));
/* If the argument is a double word argument, then it needs to be
double word aligned. */
- if ((bytes_reserved == 2 * DEPRECATED_REGISTER_SIZE)
- && (offset[i] % 2 * DEPRECATED_REGISTER_SIZE))
+ if ((bytes_reserved == 2 * REGISTER_SIZE)
+ && (offset[i] % 2 * REGISTER_SIZE))
{
int new_offset = 0;
/* BYTES_RESERVED is already aligned to the word, so we put
@@ -1876,13 +1876,13 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
This will leave one empty word on the stack, and one unused
register as mandated by the ABI. */
- new_offset = ((offset[i] + 2 * DEPRECATED_REGISTER_SIZE - 1)
- & -(2 * DEPRECATED_REGISTER_SIZE));
+ new_offset = ((offset[i] + 2 * REGISTER_SIZE - 1)
+ & -(2 * REGISTER_SIZE));
- if ((new_offset - offset[i]) >= 2 * DEPRECATED_REGISTER_SIZE)
+ if ((new_offset - offset[i]) >= 2 * REGISTER_SIZE)
{
- bytes_reserved += DEPRECATED_REGISTER_SIZE;
- offset[i] += DEPRECATED_REGISTER_SIZE;
+ bytes_reserved += REGISTER_SIZE;
+ offset[i] += REGISTER_SIZE;
}
}
@@ -2037,9 +2037,9 @@ cover_find_stub_with_shl_get (void *args_untyped)
into a call sequence of the above form stored at DUMMYNAME.
On the hppa we need to call the stack dummy through $$dyncall.
- Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra
- argument, real_pc, which is the location where gdb should start up
- the inferior to do the function call.
+ Therefore our version of FIX_CALL_DUMMY takes an extra argument,
+ real_pc, which is the location where gdb should start up the
+ inferior to do the function call.
This has to work across several versions of hpux, bsd, osf1. It has to
work regardless of what compiler was used to build the inferior program.
@@ -2195,7 +2195,7 @@ hppa_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
at *(fun+4). Note the call dummy is *NOT* allowed to
trash %r19 before calling the target function. */
write_register (19, read_memory_integer ((fun & ~0x3) + 4,
- DEPRECATED_REGISTER_SIZE));
+ REGISTER_SIZE));
/* Now get the real address for the function we are calling, it's
at *fun. */
@@ -2630,7 +2630,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val)
int start;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
long long reg_val;
if (!know_which)
@@ -2827,8 +2827,8 @@ pa_strcat_registers (char *raw_regs, int regnum, int fpregs,
static void
pa_print_fp_reg (int i)
{
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (max_register_size (current_gdbarch));
+ char *virtual_buffer = alloca (max_register_size (current_gdbarch));
/* Get 32bits of data. */
frame_register_read (deprecated_selected_frame, i, raw_buffer);
@@ -2870,8 +2870,8 @@ pa_print_fp_reg (int i)
static void
pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
{
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (max_register_size (current_gdbarch));
+ char *virtual_buffer = alloca (max_register_size (current_gdbarch));
fputs_filtered (REGISTER_NAME (i), stream);
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream);
@@ -2885,7 +2885,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
if (precision == double_precision && (i % 2) == 0)
{
- char raw_buf[MAX_REGISTER_SIZE];
+ char *raw_buf = alloca (max_register_size (current_gdbarch));
/* Get the data in raw format for the 2nd half. */
frame_register_read (deprecated_selected_frame, i + 1, raw_buf);
@@ -3882,16 +3882,16 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
- * DEPRECATED_CALL_DUMMY_LENGTH)
+ + ((REGISTER_SIZE / INSTRUCTION_SIZE)
+ * CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * DEPRECATED_REGISTER_SIZE)
+ + (32 * REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * DEPRECATED_REGISTER_SIZE)))))
+ + (6 * REGISTER_SIZE)))))
find_dummy_frame_regs (frame_info, frame_saved_regs);
/* Interrupt handlers are special too. They lay out the register
@@ -4860,7 +4860,7 @@ int
hppa_register_raw_size (int reg_nr)
{
/* All registers have the same size. */
- return DEPRECATED_REGISTER_SIZE;
+ return REGISTER_SIZE;
}
/* Index within the register vector of the first byte of the space i
@@ -4989,7 +4989,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
set_gdbarch_stack_align (gdbarch, hppa_stack_align);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_num_regs (gdbarch, hppa_num_regs);
set_gdbarch_deprecated_fp_regnum (gdbarch, 3);
set_gdbarch_sp_regnum (gdbarch, 30);
@@ -5023,8 +5023,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
- /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
+ set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
+ /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c
index dc3e6b6fb9c..3ec3a57e9ac 100644
--- a/gdb/hppab-nat.c
+++ b/gdb/hppab-nat.c
@@ -55,7 +55,7 @@ static void
fetch_register (int regno)
{
register unsigned int regaddr;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
register int i;
/* Offset of registers within the u area. */
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index 0b8b04f9778..b953d2546f6 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -190,7 +190,7 @@ store_inferior_registers (int regno)
static void
fetch_register (int regno)
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
unsigned int addr, len, offset;
int i;
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index 7a7b74174a1..b585ca540ce 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -285,7 +285,7 @@ hpux_thread_fetch_registers (int regno)
child_ops.to_fetch_registers (regno);
else
{
- unsigned char buf[MAX_REGISTER_SIZE];
+ unsigned char *buf = alloca (max_register_size (current_gdbarch));
CORE_ADDR sp;
sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
@@ -347,7 +347,7 @@ hpux_thread_store_registers (int regno)
child_ops.to_store_registers (regno);
else
{
- unsigned char buf[MAX_REGISTER_SIZE];
+ unsigned char *buf = alloca (max_register_size (current_gdbarch));
CORE_ADDR sp;
sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
deleted file mode 100644
index b35dd2a13b7..00000000000
--- a/gdb/i386-nto-tdep.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/* i386-nto-tdep.c - i386 specific functionality for QNX Neutrino.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- Contributed by QNX Software Systems Ltd.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "gdb_string.h"
-#include "gdb_assert.h"
-#include "defs.h"
-#include "frame.h"
-#include "target.h"
-#include "regcache.h"
-#include "solib-svr4.h"
-#include "i386-tdep.h"
-#include "nto-tdep.h"
-#include "osabi.h"
-#include "i387-tdep.h"
-
-#ifndef X86_CPU_FXSR
-#define X86_CPU_FXSR (1L << 12)
-#endif
-
-/* Why 13? Look in our /usr/include/x86/context.h header at the
- x86_cpu_registers structure and you'll see an 'exx' junk register
- that is just filler. Don't ask me, ask the kernel guys. */
-#define NUM_GPREGS 13
-
-/* Map a GDB register number to an offset in the reg structure. */
-static int regmap[] = {
- (7 * 4), /* eax */
- (6 * 4), /* ecx */
- (5 * 4), /* edx */
- (4 * 4), /* ebx */
- (11 * 4), /* esp */
- (2 * 4), /* epb */
- (1 * 4), /* esi */
- (0 * 4), /* edi */
- (8 * 4), /* eip */
- (10 * 4), /* eflags */
- (9 * 4), /* cs */
- (12 * 4), /* ss */
- (-1 * 4) /* filler */
-};
-
-/* Given a gdb regno, return the offset into Neutrino's register structure
- or -1 if register is unknown. */
-static int
-nto_reg_offset (int regno)
-{
- return (regno >= 0 && regno < NUM_GPREGS) ? regmap[regno] : -1;
-}
-
-static void
-i386nto_supply_gregset (char *gpregs)
-{
- unsigned regno;
- int empty = 0;
-
- for (regno = 0; regno < FP0_REGNUM; regno++)
- {
- int offset = nto_reg_offset (regno);
- if (offset == -1)
- supply_register (regno, (char *) &empty);
- else
- supply_register (regno, gpregs + offset);
- }
-}
-
-static void
-i386nto_supply_fpregset (char *fpregs)
-{
- if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
- i387_supply_fxsave (fpregs);
- else
- i387_supply_fsave (fpregs);
-}
-
-static void
-i386nto_supply_regset (int regset, char *data)
-{
- switch (regset)
- {
- case NTO_REG_GENERAL: /* QNX has different ordering of GP regs than GDB. */
- i386nto_supply_gregset (data);
- break;
- case NTO_REG_FLOAT:
- i386nto_supply_fpregset (data);
- break;
- }
-}
-
-static int
-i386nto_regset_id (int regno)
-{
- if (regno == -1)
- return NTO_REG_END;
- else if (regno < FP0_REGNUM)
- return NTO_REG_GENERAL;
- else if (regno < FPC_REGNUM)
- return NTO_REG_FLOAT;
-
- return -1; /* Error. */
-}
-
-static int
-i386nto_register_area (int regno, int regset, unsigned *off)
-{
- int len;
-
- *off = 0;
- if (regset == NTO_REG_GENERAL)
- {
- if (regno == -1)
- return NUM_GPREGS * 4;
-
- *off = nto_reg_offset (regno);
- if (*off == -1)
- return 0;
- return 4;
- }
- else if (regset == NTO_REG_FLOAT)
- {
- unsigned off_adjust, regsize, regset_size;
-
- if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
- {
- off_adjust = 32;
- regsize = 16;
- regset_size = 512;
- }
- else
- {
- off_adjust = 28;
- regsize = 10;
- regset_size = 128;
- }
-
- if (regno == -1)
- return regset_size;
-
- *off = (regno - FP0_REGNUM) * regsize + off_adjust;
- return 10;
- /* Why 10 instead of regsize? GDB only stores 10 bytes per FP
- register so if we're sending a register back to the target,
- we only want pdebug to write 10 bytes so as not to clobber
- the reserved 6 bytes in the fxsave structure. */
- }
- return -1;
-}
-
-static int
-i386nto_regset_fill (int regset, char *data)
-{
- if (regset == NTO_REG_GENERAL)
- {
- int regno;
-
- for (regno = 0; regno < NUM_GPREGS; regno++)
- {
- int offset = nto_reg_offset (regno);
- if (offset != -1)
- regcache_collect (regno, data + offset);
- }
- }
- else if (regset == NTO_REG_FLOAT)
- {
- if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
- i387_fill_fxsave (data, -1);
- else
- i387_fill_fsave (data, -1);
- }
- else
- return -1;
-
- return 0;
-}
-
-static struct link_map_offsets *
-i386nto_svr4_fetch_link_map_offsets (void)
-{
- static struct link_map_offsets lmo;
- static struct link_map_offsets *lmp = NULL;
-
- if (lmp == NULL)
- {
- lmp = &lmo;
-
- lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
- only 8 bytes are used. */
- lmo.r_map_offset = 4;
- lmo.r_map_size = 4;
-
- lmo.link_map_size = 20; /* The actual size is 552 bytes, but
- only 20 bytes are used. */
- lmo.l_addr_offset = 0;
- lmo.l_addr_size = 4;
-
- lmo.l_name_offset = 4;
- lmo.l_name_size = 4;
-
- lmo.l_next_offset = 12;
- lmo.l_next_size = 4;
-
- lmo.l_prev_offset = 16;
- lmo.l_prev_size = 4;
- }
-
- return lmp;
-}
-
-static int
-i386nto_pc_in_sigtramp (CORE_ADDR pc, char *name)
-{
- return name && strcmp ("__signalstub", name) == 0;
-}
-
-#define SIGCONTEXT_OFFSET 136
-static CORE_ADDR
-i386nto_sigcontext_addr (struct frame_info *frame)
-{
- if (get_next_frame (frame))
- return get_frame_base (get_next_frame (frame)) + SIGCONTEXT_OFFSET;
-
- return read_register (SP_REGNUM) + SIGCONTEXT_OFFSET;
-}
-
-static void
-init_i386nto_ops (void)
-{
- current_nto_target.nto_regset_id = i386nto_regset_id;
- current_nto_target.nto_supply_gregset = i386nto_supply_gregset;
- current_nto_target.nto_supply_fpregset = i386nto_supply_fpregset;
- current_nto_target.nto_supply_altregset = nto_dummy_supply_regset;
- current_nto_target.nto_supply_regset = i386nto_supply_regset;
- current_nto_target.nto_register_area = i386nto_register_area;
- current_nto_target.nto_regset_fill = i386nto_regset_fill;
- current_nto_target.nto_fetch_link_map_offsets =
- i386nto_svr4_fetch_link_map_offsets;
-}
-
-static void
-i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- /* NTO uses ELF. */
- i386_elf_init_abi (info, gdbarch);
-
- /* Neutrino rewinds to look more normal. */
- set_gdbarch_decr_pc_after_break (gdbarch, 0);
-
- /* NTO has shared libraries. */
- set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
- set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
-
- set_gdbarch_pc_in_sigtramp (gdbarch, i386nto_pc_in_sigtramp);
- tdep->sigcontext_addr = i386nto_sigcontext_addr;
- tdep->sc_pc_offset = 56;
- tdep->sc_sp_offset = 68;
-
- /* Setjmp()'s return PC saved in EDX (5). */
- tdep->jb_pc_offset = 20; /* 5x32 bit ints in. */
-
- set_solib_svr4_fetch_link_map_offsets (gdbarch,
- i386nto_svr4_fetch_link_map_offsets);
-
- /* Our loader handles solib relocations slightly differently than svr4. */
- TARGET_SO_RELOCATE_SECTION_ADDRESSES = nto_relocate_section_addresses;
-
- /* Supply a nice function to find our solibs. */
- TARGET_SO_FIND_AND_OPEN_SOLIB = nto_find_and_open_solib;
-
- init_i386nto_ops ();
-}
-
-void
-_initialize_i386nto_tdep (void)
-{
- gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_QNXNTO,
- i386nto_init_abi);
-}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 5cf63b46f86..07c82b608f0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1097,7 +1097,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char mmx_buf[MAX_REGISTER_SIZE];
+ char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Extract (always little endian). */
@@ -1114,7 +1114,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char mmx_buf[MAX_REGISTER_SIZE];
+ char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Read ... */
@@ -1486,7 +1486,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
be in use on any of the supported i386 targets. */
set_gdbarch_register_name (gdbarch, i386_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
set_gdbarch_register_type (gdbarch, i386_register_type);
@@ -1495,8 +1495,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
/* Call dummy code. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, NULL);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, NULL);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_register_convertible (gdbarch, i386_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch,
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index ce9b26c8e2e..7aff5b95171 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -1259,7 +1259,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
{
- char pr_raw_buffer[MAX_REGISTER_SIZE];
+ char *pr_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
int pr_optim;
enum lval_type pr_lval;
CORE_ADDR pr_addr;
@@ -1282,7 +1282,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
{
- char unat_raw_buffer[MAX_REGISTER_SIZE];
+ char *unat_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
int unat_optim;
enum lval_type unat_lval;
CORE_ADDR unat_addr;
@@ -2033,9 +2033,7 @@ ia64_pop_frame_regular (struct frame_info *frame)
}
static void
-ia64_remote_translate_xfer_address (struct gdbarch *gdbarch,
- struct regcache *regcache,
- CORE_ADDR memaddr, int nr_bytes,
+ia64_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
CORE_ADDR *targ_addr, int *targ_len)
{
*targ_addr = memaddr;
@@ -2175,7 +2173,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM);
set_gdbarch_register_name (gdbarch, ia64_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 8);
+ set_gdbarch_register_size (gdbarch, 8);
set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
set_gdbarch_register_byte (gdbarch, ia64_register_byte);
set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size);
@@ -2219,8 +2217,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_return_address (gdbarch, ia64_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, ia64_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info);
set_gdbarch_frame_args_address (gdbarch, ia64_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, ia64_frame_locals_address);
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 5f80e896bbc..c2ee412306e 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -222,26 +222,22 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
struct type *value_type,
CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
{
- /* CALL_DUMMY is an array of words (DEPRECATED_REGISTER_SIZE), but
- each word is in host byte order. Before calling
- DEPRECATED_FIX_CALL_DUMMY, we byteswap it and remove any extra
- bytes which might exist because ULONGEST is bigger than
- DEPRECATED_REGISTER_SIZE. */
+ /* CALL_DUMMY is an array of words (REGISTER_SIZE), but each word is
+ in host byte order. Before calling FIX_CALL_DUMMY, we byteswap
+ it and remove any extra bytes which might exist because ULONGEST
+ is bigger than REGISTER_SIZE. */
/* NOTE: This is pretty wierd, as the call dummy is actually a
sequence of instructions. But CISC machines will have to pack
- the instructions into DEPRECATED_REGISTER_SIZE units (and so will
- RISC machines for which INSTRUCTION_SIZE is not
- DEPRECATED_REGISTER_SIZE). */
+ the instructions into REGISTER_SIZE units (and so will RISC
+ machines for which INSTRUCTION_SIZE is not REGISTER_SIZE). */
/* NOTE: This is pretty stupid. CALL_DUMMY should be in strict
target byte order. */
CORE_ADDR start_sp;
- ULONGEST *dummy = alloca (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
- int sizeof_dummy1 = (DEPRECATED_REGISTER_SIZE
- * DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
+ ULONGEST *dummy = alloca (SIZEOF_CALL_DUMMY_WORDS);
+ int sizeof_dummy1 = (REGISTER_SIZE * SIZEOF_CALL_DUMMY_WORDS
/ sizeof (ULONGEST));
char *dummy1 = alloca (sizeof_dummy1);
- memcpy (dummy, DEPRECATED_CALL_DUMMY_WORDS,
- DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
+ memcpy (dummy, CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS);
if (INNER_THAN (1, 2))
{
/* Stack grows down */
@@ -256,40 +252,40 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
}
/* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack
after allocating space for the call dummy. A target can specify
- a SIZEOF_DUMMY1 (via DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) such
- that all local alignment requirements are met. */
+ a SIZEOF_DUMMY1 (via SIZEOF_CALL_DUMMY_WORDS) such that all local
+ alignment requirements are met. */
/* Create a call sequence customized for this function and the
number of arguments for it. */
{
int i;
- for (i = 0; i < (int) (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0]));
+ for (i = 0; i < (int) (SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0]));
i++)
- store_unsigned_integer (&dummy1[i * DEPRECATED_REGISTER_SIZE],
- DEPRECATED_REGISTER_SIZE,
+ store_unsigned_integer (&dummy1[i * REGISTER_SIZE],
+ REGISTER_SIZE,
(ULONGEST) dummy[i]);
}
/* NOTE: cagney/2003-04-22: This computation of REAL_PC, BP_ADDR and
DUMMY_ADDR is pretty messed up. It comes from constant tinkering
- with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement
+ with the values. Instead a FIX_CALL_DUMMY replacement
(PUSH_DUMMY_BREAKPOINT?) should just do everything. */
#ifdef GDB_TARGET_IS_HPPA
- real_pc = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
+ real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
+ value_type, using_gcc);
#else
- if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ if (FIX_CALL_DUMMY_P ())
{
/* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
- DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
- value_type, using_gcc);
+ FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, value_type,
+ using_gcc);
}
(*real_pc) = start_sp;
#endif
/* Yes, the offset is applied to the real_pc and not the dummy addr.
Ulgh! Blame the HP/UX target. */
- (*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
+ (*bp_addr) = (*real_pc) + CALL_DUMMY_BREAKPOINT_OFFSET;
/* Yes, the offset is applied to the real_pc and not the
dummy_addr. Ulgh! Blame the HP/UX target. */
- (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET;
+ (*real_pc) += CALL_DUMMY_START_OFFSET;
write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
@@ -332,8 +328,8 @@ generic_push_dummy_code (struct gdbarch *gdbarch,
return sp;
}
-/* Provide backward compatibility. Once DEPRECATED_FIX_CALL_DUMMY is
- eliminated, this can be simplified. */
+/* Provide backward compatibility. Once FIX_CALL_DUMMY is eliminated,
+ this can be simplified. */
static CORE_ADDR
push_dummy_code (struct gdbarch *gdbarch,
@@ -345,7 +341,7 @@ push_dummy_code (struct gdbarch *gdbarch,
if (gdbarch_push_dummy_code_p (gdbarch))
return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
args, nargs, value_type, real_pc, bp_addr);
- else if (DEPRECATED_FIX_CALL_DUMMY_P ())
+ else if (FIX_CALL_DUMMY_P ())
return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
args, nargs, value_type, real_pc, bp_addr);
else
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index de6c319608d..5867655b98e 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1500,8 +1500,8 @@ default_print_registers_info (struct gdbarch *gdbarch,
{
int i;
const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
if (DEPRECATED_DO_REGISTERS_INFO_P ())
{
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 1de3b25e39b..e4286e4a8f3 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -485,14 +485,13 @@ extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc,
Note that this macro is intended for targets (like HP-UX) which
require more than a single breakpoint in their call dummies, and
- therefore cannot use the DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
- mechanism.
-
- If a target does define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET,
- then this default implementation of CALL_DUMMY_HAS_COMPLETED is
- sufficient. Else, a target may wish to supply an implementation
- that works in the presense of multiple breakpoints in its call
- dummy. */
+ therefore cannot use the CALL_DUMMY_BREAKPOINT_OFFSET mechanism.
+
+ If a target does define CALL_DUMMY_BREAKPOINT_OFFSET, then this
+ default implementation of CALL_DUMMY_HAS_COMPLETED is sufficient.
+ Else, a target may wish to supply an implementation that works in
+ the presense of multiple breakpoints in its call dummy.
+ */
#if !defined(CALL_DUMMY_HAS_COMPLETED)
#define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \
DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address))
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 1225dd8a62c..a142080cf8c 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -359,7 +359,7 @@ fetch_register (int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
int tid;
if (CANNOT_FETCH_REGISTER (regno))
@@ -424,7 +424,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index df179682109..9503b106faf 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -667,12 +667,6 @@ clear_proceed_status (void)
bpstat_clear (&stop_bpstat);
}
-
-/* Record the pc of the program the last time it stopped. This is
- just used internally by wait_for_inferior, but need to be preserved
- over calls to it and cleared when the inferior is started. */
-static CORE_ADDR prev_pc;
-
/* Basic routine for continuing the program in various fashions.
ADDR is the address to resume at, or -1 for resume where stopped.
@@ -778,30 +772,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
inferior. */
gdb_flush (gdb_stdout);
- /* Refresh prev_pc value just prior to resuming. This used to be
- done in stop_stepping, however, setting prev_pc there did not handle
- scenarios such as inferior function calls or returning from
- a function via the return command. In those cases, the prev_pc
- value was not set properly for subsequent commands. The prev_pc value
- is used to initialize the starting line number in the ecs. With an
- invalid value, the gdb next command ends up stopping at the position
- represented by the next line table entry past our start position.
- On platforms that generate one line table entry per line, this
- is not a problem. However, on the ia64, the compiler generates
- extraneous line table entries that do not increase the line number.
- When we issue the gdb next command on the ia64 after an inferior call
- or a return command, we often end up a few instructions forward, still
- within the original line we started.
-
- An attempt was made to have init_execution_control_state () refresh
- the prev_pc value before calculating the line number. This approach
- did not work because on platforms that use ptrace, the pc register
- cannot be read unless the inferior is stopped. At that point, we
- are not guaranteed the inferior is stopped and so the read_pc ()
- call can fail. Setting the prev_pc value here ensures the value is
- updated correctly when the inferior is stopped. */
- prev_pc = read_pc ();
-
/* Resume inferior. */
resume (oneproc || step || bpstat_should_step (), stop_signal);
@@ -815,6 +785,13 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
normal_stop ();
}
}
+
+/* Record the pc and sp of the program the last time it stopped.
+ These are just used internally by wait_for_inferior, but need
+ to be preserved over calls to it and cleared when the inferior
+ is started. */
+static CORE_ADDR prev_pc;
+static char *prev_func_name;
/* Start remote-debugging of a machine over a serial link. */
@@ -852,6 +829,7 @@ init_wait_for_inferior (void)
{
/* These are meaningless until the first time through wait_for_inferior. */
prev_pc = 0;
+ prev_func_name = NULL;
#ifdef HP_OS_BUG
trap_expected_after_continue = 0;
@@ -1138,7 +1116,7 @@ context_switch (struct execution_control_state *ecs)
if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid))
{ /* Perform infrun state context switch: */
/* Save infrun state for the old thread. */
- save_infrun_state (inferior_ptid, prev_pc,
+ save_infrun_state (inferior_ptid, prev_pc, prev_func_name,
trap_expected, step_resume_breakpoint,
through_sigtramp_breakpoint, step_range_start,
step_range_end, &step_frame_id,
@@ -1149,7 +1127,7 @@ context_switch (struct execution_control_state *ecs)
ecs->current_line, ecs->current_symtab, step_sp);
/* Load infrun state for the new thread. */
- load_infrun_state (ecs->ptid, &prev_pc,
+ load_infrun_state (ecs->ptid, &prev_pc, &prev_func_name,
&trap_expected, &step_resume_breakpoint,
&through_sigtramp_breakpoint, &step_range_start,
&step_range_end, &step_frame_id,
@@ -1162,39 +1140,6 @@ context_switch (struct execution_control_state *ecs)
inferior_ptid = ecs->ptid;
}
-/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the
- function's name.
-
- In a classic example of "left hand VS right hand", "infrun.c" was
- trying to improve GDB's performance by caching the result of calls
- to calls to find_pc_partial_funtion, while at the same time
- find_pc_partial_function was also trying to ramp up performance by
- caching its most recent return value. The below makes the the
- function find_pc_partial_function solely responsibile for
- performance issues (the local cache that relied on a global
- variable - arrrggg - deleted).
-
- Using the testsuite and gcov, it was found that dropping the local
- "infrun.c" cache and instead relying on find_pc_partial_function
- increased the number of calls to 12000 (from 10000), but the number
- of times find_pc_partial_function's cache missed (this is what
- matters) was only increased by only 4 (to 3569). (A quick back of
- envelope caculation suggests that the extra 2000 function calls
- @1000 extra instructions per call make the 1 MIP VAX testsuite run
- take two extra seconds, oops :-)
-
- Long term, this function can be eliminated, replaced by the code:
- get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new
- architectures this is very cheap). */
-
-static int
-pc_in_sigtramp (CORE_ADDR pc)
-{
- char *name;
- find_pc_partial_function (pc, &name, NULL, NULL);
- return PC_IN_SIGTRAMP (pc, name);
-}
-
/* Given an execution control state that has been freshly filled in
by an event from the inferior, figure out what it means and take
@@ -2317,8 +2262,8 @@ process_event_stop_test:
ecs->update_step_sp = 1;
/* Did we just take a signal? */
- if (pc_in_sigtramp (stop_pc)
- && !pc_in_sigtramp (prev_pc)
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
&& INNER_THAN (read_sp (), step_sp))
{
/* We've just taken a signal; go until we are back to
@@ -2428,7 +2373,7 @@ process_event_stop_test:
{
/* We're doing a "next". */
- if (pc_in_sigtramp (stop_pc)
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
&& frame_id_inner (step_frame_id,
frame_id_build (read_sp (), 0)))
/* We stepped out of a signal handler, and into its
@@ -2617,8 +2562,8 @@ static void
check_sigtramp2 (struct execution_control_state *ecs)
{
if (trap_expected
- && pc_in_sigtramp (stop_pc)
- && !pc_in_sigtramp (prev_pc)
+ && PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
&& INNER_THAN (read_sp (), step_sp))
{
/* What has happened here is that we have just stepped the
@@ -2782,6 +2727,15 @@ step_over_function (struct execution_control_state *ecs)
static void
stop_stepping (struct execution_control_state *ecs)
{
+ if (target_has_execution)
+ {
+ /* Assuming the inferior still exists, set these up for next
+ time, just like we did above if we didn't break out of the
+ loop. */
+ prev_pc = read_pc ();
+ prev_func_name = ecs->stop_func_name;
+ }
+
/* Let callers know we don't want to wait for the inferior anymore. */
ecs->wait_some_more = 0;
}
@@ -2795,6 +2749,7 @@ keep_going (struct execution_control_state *ecs)
{
/* Save the pc before execution, to compare with pc after stop. */
prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
+ prev_func_name = ecs->stop_func_name;
if (ecs->update_step_sp)
step_sp = read_sp ();
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
index 63ca71e6bc6..b44c5bbba49 100644
--- a/gdb/irix4-nat.c
+++ b/gdb/irix4-nat.c
@@ -51,8 +51,8 @@ supply_gregset (gregset_t *gregsetp)
{
register int regi;
register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
/* FIXME: somewhere, there should be a #define for the meaning
of this magic number 32; we should use that. */
@@ -104,8 +104,8 @@ void
supply_fpregset (fpregset_t *fpregsetp)
{
register int regi;
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index f425cb9c37a..4be7fb8e1ab 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -283,7 +283,7 @@ fetch_inferior_registers (int regno)
if (whatregs & WHATREGS_GEN)
{
struct econtext ec; /* general regs */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
int retval;
int i;
@@ -512,7 +512,7 @@ fetch_inferior_registers (int regno)
ecp = registers_addr (PIDGET (inferior_ptid));
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
for (regno = reglo; regno <= reghi; regno++)
{
int ptrace_fun = PTRACE_PEEKTHREAD;
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index fb174206e2c..8b69c1113ff 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1373,15 +1373,16 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM);
set_gdbarch_deprecated_fp_regnum (gdbarch, SOFT_FP_REGNUM);
set_gdbarch_register_name (gdbarch, m68hc11_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 2);
+ set_gdbarch_register_size (gdbarch, 2);
set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type);
set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write);
set_gdbarch_call_dummy_address (gdbarch, m68hc11_call_dummy_address);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, m68hc11_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, m68hc11_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (m68hc11_call_dummy_words));
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index aabb13ab597..63d076883b1 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -429,9 +429,9 @@ void
m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
struct value **args, struct type *type, int gcc_p)
{
- bfd_putb32 (fun, (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 2);
+ bfd_putb32 (fun, (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 2);
bfd_putb32 (nargs * 4,
- (unsigned char *) dummy + DEPRECATED_CALL_DUMMY_START_OFFSET + 8);
+ (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 8);
}
@@ -1025,7 +1025,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 12);
set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type);
set_gdbarch_register_name (gdbarch, m68k_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_byte (gdbarch, m68k_register_byte);
set_gdbarch_num_regs (gdbarch, 29);
set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
@@ -1038,14 +1038,14 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 24);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, 28);
- set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 12);
+ set_gdbarch_call_dummy_length (gdbarch, 28);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 12);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words));
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words));
+ set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame);
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index e077deadc27..0f0a7d10241 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -135,7 +135,7 @@ fetch_register (int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
int tid;
if (CANNOT_FETCH_REGISTER (regno))
@@ -199,7 +199,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/maint.c b/gdb/maint.c
index aa342390765..2eb59ee5e3a 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -434,6 +434,18 @@ maintenance_print_command (char *arg, int from_tty)
help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout);
}
+/* The "maintenance list" command is defined as a prefix, with
+ allow_unknown 0. Therefore, its own definition is called only for
+ "maintenance list" with no args. */
+
+/* ARGSUSED */
+static void
+maintenance_list_command (char *arg, int from_tty)
+{
+ printf_unfiltered ("\"maintenance list\" must be followed by the name of a list command.\n");
+ help_list (maintenancelistlist, "maintenance list ", -1, gdb_stdout);
+}
+
/* The "maintenance translate-address" command converts a section and address
to a symbol. This can be called in two ways:
maintenance translate-address <secname> <addr>
@@ -732,6 +744,11 @@ lists all sections from all object files, including shared libraries.",
&maintenanceprintlist, "maintenance print ", 0,
&maintenancelist);
+ add_prefix_cmd ("list", class_maintenance, maintenance_list_command,
+ "Maintenance command for listing GDB internal state.",
+ &maintenancelistlist, "maintenance list ", 0,
+ &maintenancelist);
+
add_prefix_cmd ("set", class_maintenance, maintenance_set_cmd, "\
Set GDB internal variables used by the GDB maintainer.\n\
Configure variables internal to GDB that aid in GDB's maintenance",
@@ -810,18 +827,18 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
"Print dump of current object file definitions.",
&maintenanceprintlist);
- add_cmd ("symtabs", class_maintenance, maintenance_info_symtabs,
+ add_cmd ("symtabs", class_maintenance, maintenance_list_symtabs,
"List the full symbol tables for all object files.\n\
This does not include information about individual symbols, blocks, or\n\
linetables --- just the symbol table structures themselves.\n\
With an argument REGEXP, list the symbol tables whose names that match that.",
- &maintenanceinfolist);
+ &maintenancelistlist);
- add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs,
+ add_cmd ("psymtabs", class_maintenance, maintenance_list_psymtabs,
"List the partial symbol tables for all object files.\n\
This does not include information about individual partial symbols,\n\
just the symbol table structures themselves.",
- &maintenanceinfolist);
+ &maintenancelistlist);
add_cmd ("statistics", class_maintenance, maintenance_print_statistics,
"Print statistics about internal gdb state.",
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 484c1ec9d22..bc6e47553e4 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -683,8 +683,7 @@ mcore_frame_chain (struct frame_info * fi)
{
/* The "FP" was saved on the stack. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
- callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp],
- DEPRECATED_REGISTER_SIZE)
+ callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], REGISTER_SIZE)
+ get_frame_extra_info (dummy)->framesize;
}
else
@@ -768,7 +767,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum)
get_frame_base (fi), regnum);
else if (get_frame_saved_regs (fi)[regnum] != 0)
return read_memory_integer (get_frame_saved_regs (fi)[regnum],
- DEPRECATED_REGISTER_SIZE);
+ REGISTER_SIZE);
}
return read_register (regnum);
@@ -815,7 +814,7 @@ mcore_pop_frame (void)
ULONGEST value;
value = read_memory_unsigned_integer (get_frame_saved_regs (fi)[rn],
- DEPRECATED_REGISTER_SIZE);
+ REGISTER_SIZE);
write_register (rn, value);
}
}
@@ -831,9 +830,9 @@ mcore_pop_frame (void)
/* Setup arguments and PR for a call to the target. First six arguments
go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on to the stack.
- - Types with lengths greater than DEPRECATED_REGISTER_SIZE may not
- be split between registers and the stack, and they must start in an
- even-numbered register. Subsequent args will go onto the stack.
+ * Types with lengths greater than REGISTER_SIZE may not be split
+ between registers and the stack, and they must start in an even-numbered
+ register. Subsequent args will go onto the stack.
* Structs may be split between registers and stack, left-aligned.
@@ -885,21 +884,21 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
numbered register. */
olen = len;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > DEPRECATED_REGISTER_SIZE && argreg % 2)
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > REGISTER_SIZE && argreg % 2)
{
- mcore_insn_debug (("MCORE PUSH: %d > DEPRECATED_REGISTER_SIZE: and %s is not even\n",
+ mcore_insn_debug (("MCORE PUSH: %d > REGISTER_SIZE: and %s is not even\n",
len, mcore_register_names[argreg]));
argreg++;
}
- if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * DEPRECATED_REGISTER_SIZE)
+ if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * REGISTER_SIZE)
|| (TYPE_CODE (type) == TYPE_CODE_STRUCT))
{
/* Something that will fit entirely into registers (or a struct
which may be split between registers and stack). */
mcore_insn_debug (("MCORE PUSH: arg %d going into regs\n", argnum));
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < DEPRECATED_REGISTER_SIZE)
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < REGISTER_SIZE)
{
/* Small structs must be right aligned within the register,
the most significant bits are undefined. */
@@ -910,16 +909,16 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
while (len > 0 && argreg <= LAST_ARGREG)
{
- write_register (argreg, extract_unsigned_integer (val, DEPRECATED_REGISTER_SIZE));
+ write_register (argreg, extract_unsigned_integer (val, REGISTER_SIZE));
argreg++;
- val += DEPRECATED_REGISTER_SIZE;
- len -= DEPRECATED_REGISTER_SIZE;
+ val += REGISTER_SIZE;
+ len -= REGISTER_SIZE;
}
/* Any remainder for the stack is noted below... */
}
else if (TYPE_CODE (VALUE_TYPE (args[argnum])) != TYPE_CODE_STRUCT
- && len > DEPRECATED_REGISTER_SIZE)
+ && len > REGISTER_SIZE)
{
/* All subsequent args go onto the stack. */
mcore_insn_debug (("MCORE PUSH: does not fit into regs, going onto stack\n"));
@@ -992,7 +991,7 @@ mcore_use_struct_convention (int gcc_p, struct type *type)
CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
+ return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), REGISTER_SIZE);
}
/* Given a function which returns a value of type TYPE, extract the
@@ -1030,7 +1029,7 @@ mcore_store_return_value (struct type *type, char *valbuf)
value_size = TYPE_LENGTH (type);
/* Return value fits into registers. */
- return_size = (value_size + DEPRECATED_REGISTER_SIZE - 1) & ~(DEPRECATED_REGISTER_SIZE - 1);
+ return_size = (value_size + REGISTER_SIZE - 1) & ~(REGISTER_SIZE - 1);
offset = REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size);
zeros = alloca (return_size);
memset (zeros, 0, return_size);
@@ -1102,7 +1101,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Registers: */
/* All registers are 32 bits */
- set_gdbarch_deprecated_register_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_register_name (gdbarch, mcore_register_name);
@@ -1118,8 +1117,8 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Call Dummies: */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
set_gdbarch_function_start_offset (gdbarch, 0);
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 1580d1fc997..765143d80ce 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,17 +1,3 @@
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
- MAX_REGISTER_RAW_SIZE.
-
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * mi-main.c (get_register): Use MAX_REGISTER_SIZE.
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * mi-main.c (mi_cmd_data_write_register_values): Replace
- REGISTER_SIZE with DEPRECATED_REGISTER_SIZE.
-
2003-05-03 J. Brobecker <brobecker@gnat.com>
From Thierry Schneider <tpschneider1@yahoo.com>:
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 6158c8ff439..6ba069821ea 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -398,7 +398,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
static int
register_changed_p (int regnum)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
return -1;
@@ -511,8 +511,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
static int
get_register (int regnum, int format)
{
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
int optim;
int realnum;
CORE_ADDR addr;
@@ -636,9 +636,9 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
/* Get the value as a number */
value = parse_and_eval_address (argv[i + 1]);
/* Get the value into an array */
- buffer = xmalloc (DEPRECATED_REGISTER_SIZE);
+ buffer = xmalloc (REGISTER_SIZE);
old_chain = make_cleanup (xfree, buffer);
- store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value);
+ store_signed_integer (buffer, REGISTER_SIZE, value);
/* Write it down */
deprecated_write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
/* Free the buffer. */
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index b8072f1aba7..ae4e6897949 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -91,7 +91,7 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc)
static void
supply_32bit_reg (int regnum, const void *addr)
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
store_signed_integer (buf, REGISTER_RAW_SIZE (regnum),
extract_signed_integer (addr, 4));
supply_register (regnum, buf);
@@ -104,9 +104,9 @@ supply_gregset (elf_gregset_t *gregsetp)
{
int regi;
elf_greg_t *regp = *gregsetp;
- char zerobuf[MAX_REGISTER_SIZE];
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = EF_REG0; regi <= EF_REG31; regi++)
supply_32bit_reg ((regi - EF_REG0), (char *)(regp + regi));
@@ -192,9 +192,9 @@ void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
register int regi;
- char zerobuf[MAX_REGISTER_SIZE];
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
@@ -379,9 +379,9 @@ mips64_supply_gregset (mips64_elf_gregset_t *gregsetp)
{
int regi;
mips64_elf_greg_t *regp = *gregsetp;
- char zerobuf[MAX_REGISTER_SIZE];
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = MIPS64_EF_REG0; regi <= MIPS64_EF_REG31; regi++)
supply_register ((regi - MIPS64_EF_REG0), (char *)(regp + regi));
@@ -467,9 +467,9 @@ static void
mips64_supply_fpregset (mips64_elf_fpregset_t *fpregsetp)
{
register int regi;
- char zerobuf[MAX_REGISTER_SIZE];
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index 1a29c3e317a..3aaaa91c339 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -70,10 +70,10 @@ void
fetch_inferior_registers (int regno)
{
register unsigned int regaddr;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
register int i;
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
deprecated_registers_fetched ();
@@ -174,8 +174,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
int bad_reg = -1;
register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
/* If u.u_ar0 was an absolute address in the core file, relativize it now,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index bf19ed8d999..e04283cf4d2 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -150,36 +150,6 @@ static const char *mips_saved_regsize_string = size_auto;
#define MIPS_SAVED_REGSIZE (mips_saved_regsize())
-/* Return the contents of register REGNUM as a signed integer. */
-
-static LONGEST
-read_signed_register (int regnum)
-{
- void *buf = alloca (REGISTER_RAW_SIZE (regnum));
- deprecated_read_register_gen (regnum, buf);
- return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
-}
-
-static LONGEST
-read_signed_register_pid (int regnum, ptid_t ptid)
-{
- ptid_t save_ptid;
- LONGEST retval;
-
- if (ptid_equal (ptid, inferior_ptid))
- return read_signed_register (regnum);
-
- save_ptid = inferior_ptid;
-
- inferior_ptid = ptid;
-
- retval = read_signed_register (regnum);
-
- inferior_ptid = save_ptid;
-
- return retval;
-}
-
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi
mips_abi (struct gdbarch *gdbarch)
@@ -245,7 +215,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length,
enum bfd_endian endian, bfd_byte *in, const bfd_byte *out,
int buf_offset)
{
- bfd_byte reg[MAX_REGISTER_SIZE];
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
int reg_offset = 0;
/* Need to transfer the left or right part of the register, based on
the targets byte order. */
@@ -1642,7 +1612,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
CORE_ADDR addr;
int realnum;
enum lval_type lval;
- char raw_buffer[MAX_REGISTER_SIZE];
+ void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
if (fi == NULL)
{
@@ -2751,7 +2721,7 @@ mips_eabi_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char valbuf[MAX_REGISTER_SIZE];
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3002,7 +2972,7 @@ mips_n32n64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char valbuf[MAX_REGISTER_SIZE];
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3225,7 +3195,7 @@ mips_o32_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char valbuf[MAX_REGISTER_SIZE];
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3524,7 +3494,7 @@ mips_o64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char valbuf[MAX_REGISTER_SIZE];
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -4044,7 +4014,7 @@ mips_print_fp_register (int regnum)
static void
mips_print_register (int regnum, int all)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
int offset;
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
@@ -4100,7 +4070,7 @@ static int
do_gp_register_row (int regnum)
{
/* do values for GP (int) regs */
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */
int col, byte;
int start_regnum = regnum;
@@ -4603,7 +4573,7 @@ mips_o64_extract_return_value (struct type *valtype,
static void
mips_eabi_store_return_value (struct type *valtype, char *valbuf)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4625,7 +4595,7 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
static void
mips_o64_store_return_value (struct type *valtype, char *valbuf)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4707,7 +4677,7 @@ mips_o32_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte reg[MAX_REGISTER_SIZE];
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
@@ -4819,7 +4789,7 @@ mips_n32n64_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte reg[MAX_REGISTER_SIZE];
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
@@ -5938,9 +5908,9 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address);
set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, mips_fix_call_dummy);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, mips_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
+ set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy);
+ set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address);
set_gdbarch_frame_align (gdbarch, mips_frame_align);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index 65ffa0dc629..874bef4f399 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -47,8 +47,8 @@ supply_gregset (gregset_t *gregsetp)
{
register int regi;
register greg_t *regp = &(*gregsetp)[0];
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
for (regi = 0; regi <= CXT_RA; regi++)
supply_register (regi, (char *) (regp + regi));
@@ -102,8 +102,8 @@ void
supply_fpregset (fpregset_t *fpregsetp)
{
register int regi;
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ char *zerobuf = alloca (max_register_size (current_gdbarch));
+ memset (zerobuf, 0, max_register_size (current_gdbarch));
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 1d580342758..8d7de772992 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -695,8 +695,7 @@ mn10300_frame_chain (struct frame_info *fi)
/* Our caller has a frame pointer. So find the frame in $a3 or
in the stack. */
if (get_frame_saved_regs (fi)[A3_REGNUM])
- return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM],
- DEPRECATED_REGISTER_SIZE));
+ return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], REGISTER_SIZE));
else
return read_register (A3_REGNUM);
}
@@ -880,8 +879,7 @@ mn10300_frame_saved_pc (struct frame_info *fi)
{
int adjust = saved_regs_size (fi);
- return (read_memory_integer (get_frame_base (fi) + adjust,
- DEPRECATED_REGISTER_SIZE));
+ return (read_memory_integer (get_frame_base (fi) + adjust, REGISTER_SIZE));
}
/* Function: mn10300_init_extra_frame_info
@@ -1010,7 +1008,7 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2)
static void
mn10300_print_register (const char *name, int regnum, int reg_width)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
if (reg_width)
printf_filtered ("%*s: ", reg_width, name);
@@ -1146,8 +1144,9 @@ mn10300_gdbarch_init (struct gdbarch_info info,
/* Registers. */
set_gdbarch_num_regs (gdbarch, num_regs);
set_gdbarch_register_name (gdbarch, register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
+ set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_register_bytes (gdbarch,
+ num_regs * gdbarch_register_size (gdbarch));
set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size);
set_gdbarch_register_byte (gdbarch, mn10300_register_byte);
@@ -1187,8 +1186,9 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp);
/* Calling functions in the inferior from GDB. */
- set_gdbarch_deprecated_call_dummy_words (gdbarch, mn10300_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mn10300_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (mn10300_call_dummy_words));
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments);
set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr);
diff --git a/gdb/monitor.c b/gdb/monitor.c
index ede61bb6998..f58ed2aa6ef 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -896,7 +896,7 @@ char *
monitor_supply_register (int regno, char *valstr)
{
ULONGEST val;
- unsigned char regbuf[MAX_REGISTER_SIZE];
+ unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
char *p;
val = 0;
@@ -1181,9 +1181,9 @@ monitor_fetch_register (int regno)
char *regbuf;
int i;
- regbuf = alloca (MAX_REGISTER_SIZE * 2 + 1);
- zerobuf = alloca (MAX_REGISTER_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
+ regbuf = alloca (MAX_REGISTER_RAW_SIZE * 2 + 1);
+ zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
if (current_monitor->regname != NULL)
name = current_monitor->regname (regno);
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index ef2752d0b77..27d75999bca 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -556,7 +556,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, NS32K_PC_REGNUM);
set_gdbarch_num_regs (gdbarch, NS32K_PS_REGNUM);
- set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE);
+ set_gdbarch_register_size (gdbarch, NS32K_REGISTER_SIZE);
set_gdbarch_register_raw_size (gdbarch, ns32k_register_raw_size);
set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE);
set_gdbarch_register_virtual_size (gdbarch, ns32k_register_virtual_size);
@@ -595,11 +595,11 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
- set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15);
+ set_gdbarch_call_dummy_words (gdbarch, ns32k_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
+ set_gdbarch_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 3);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 15);
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
deleted file mode 100644
index 5003ea069eb..00000000000
--- a/gdb/nto-tdep.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/* nto-tdep.c - general QNX Neutrino target functionality.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- Contributed by QNX Software Systems Ltd.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "gdb_stat.h"
-#include "gdb_string.h"
-#include "nto-tdep.h"
-#include "top.h"
-#include "cli/cli-decode.h"
-#include "cli/cli-cmds.h"
-#include "inferior.h"
-#include "gdbarch.h"
-#include "bfd.h"
-#include "elf-bfd.h"
-#include "solib-svr4.h"
-#include "gdbcore.h"
-
-#ifdef __CYGWIN__
-#include <sys/cygwin.h>
-#endif
-
-#ifdef __CYGWIN__
-static char default_nto_target[] = "C:\\QNXsdk\\target\\qnx6";
-#elif defined(__sun__) || defined(linux)
-static char default_nto_target[] = "/opt/QNXsdk/target/qnx6";
-#else
-static char default_nto_target[] = "";
-#endif
-
-struct nto_target_ops current_nto_target;
-
-static char *
-nto_target (void)
-{
- char *p = getenv ("QNX_TARGET");
-
-#ifdef __CYGWIN__
- static char buf[PATH_MAX];
- if (p)
- cygwin_conv_to_posix_path (p, buf);
- else
- cygwin_conv_to_posix_path (default_nto_target, buf);
- return buf;
-#else
- return p ? p : default_nto_target;
-#endif
-}
-
-/* Take a string such as i386, rs6000, etc. and map it onto CPUTYPE_X86,
- CPUTYPE_PPC, etc. as defined in nto-share/dsmsgs.h. */
-int
-nto_map_arch_to_cputype (const char *arch)
-{
- if (!strcmp (arch, "i386") || !strcmp (arch, "x86"))
- return CPUTYPE_X86;
- if (!strcmp (arch, "rs6000") || !strcmp (arch, "ppc"))
- return CPUTYPE_PPC;
- if (!strcmp (arch, "mips"))
- return CPUTYPE_MIPS;
- if (!strcmp (arch, "arm"))
- return CPUTYPE_ARM;
- if (!strcmp (arch, "sh"))
- return CPUTYPE_SH;
- return CPUTYPE_UNKNOWN;
-}
-
-int
-nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
-{
- char *buf, arch_path[PATH_MAX], *nto_root, *endian;
- const char *arch;
- char *path_fmt = "%s/lib:%s/usr/lib:%s/usr/photon/lib\
-:%s/usr/photon/dll:%s/lib/dll";
-
- nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
- {
- arch = "x86";
- endian = "";
- }
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0)
- {
- arch = "ppc";
- endian = "be";
- }
- else
- {
- arch = TARGET_ARCHITECTURE->arch_name;
- endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
- }
-
- sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
-
- buf = alloca (strlen (path_fmt) + strlen (arch_path) * 5 + 1);
- sprintf (buf, path_fmt, arch_path, arch_path, arch_path, arch_path,
- arch_path);
-
- return openp (buf, 1, solib, o_flags, 0, temp_pathname);
-}
-
-void
-nto_init_solib_absolute_prefix (void)
-{
- char buf[PATH_MAX * 2], arch_path[PATH_MAX];
- char *nto_root, *endian;
- const char *arch;
-
- nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
- {
- arch = "x86";
- endian = "";
- }
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0)
- {
- arch = "ppc";
- endian = "be";
- }
- else
- {
- arch = TARGET_ARCHITECTURE->arch_name;
- endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
- }
-
- sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
-
- sprintf (buf, "set solib-absolute-prefix %s", arch_path);
- execute_command (buf, 0);
-}
-
-char **
-nto_parse_redirection (char *pargv[], char **pin, char **pout, char **perr)
-{
- char **argv;
- char *in, *out, *err, *p;
- int argc, i, n;
-
- for (n = 0; pargv[n]; n++);
- if (n == 0)
- return NULL;
- in = "";
- out = "";
- err = "";
-
- argv = xcalloc (n + 1, sizeof argv[0]);
- argc = n;
- for (i = 0, n = 0; n < argc; n++)
- {
- p = pargv[n];
- if (*p == '>')
- {
- p++;
- if (*p)
- out = p;
- else
- out = pargv[++n];
- }
- else if (*p == '<')
- {
- p++;
- if (*p)
- in = p;
- else
- in = pargv[++n];
- }
- else if (*p++ == '2' && *p++ == '>')
- {
- if (*p == '&' && *(p + 1) == '1')
- err = out;
- else if (*p)
- err = p;
- else
- err = pargv[++n];
- }
- else
- argv[i++] = pargv[n];
- }
- *pin = in;
- *pout = out;
- *perr = err;
- return argv;
-}
-
-/* The struct lm_info, LM_ADDR, and nto_truncate_ptr are copied from
- solib-svr4.c to support nto_relocate_section_addresses
- which is different from the svr4 version. */
-
-struct lm_info
-{
- /* Pointer to copy of link map from inferior. The type is char *
- rather than void *, so that we may use byte offsets to find the
- various fields without the need for a cast. */
- char *lm;
-};
-
-static CORE_ADDR
-LM_ADDR (struct so_list *so)
-{
- struct link_map_offsets *lmo = nto_fetch_link_map_offsets ();
-
- return (CORE_ADDR) extract_signed_integer (so->lm_info->lm +
- lmo->l_addr_offset,
- lmo->l_addr_size);
-}
-
-static CORE_ADDR
-nto_truncate_ptr (CORE_ADDR addr)
-{
- if (TARGET_PTR_BIT == sizeof (CORE_ADDR) * 8)
- /* We don't need to truncate anything, and the bit twiddling below
- will fail due to overflow problems. */
- return addr;
- else
- return addr & (((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1);
-}
-
-Elf_Internal_Phdr *
-find_load_phdr (bfd *abfd)
-{
- Elf_Internal_Phdr *phdr;
- unsigned int i;
-
- if (!elf_tdata (abfd))
- return NULL;
-
- phdr = elf_tdata (abfd)->phdr;
- for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
- {
- if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X))
- return phdr;
- }
- return NULL;
-}
-
-void
-nto_relocate_section_addresses (struct so_list *so, struct section_table *sec)
-{
- /* Neutrino treats the l_addr base address field in link.h as different than
- the base address in the System V ABI and so the offset needs to be
- calculated and applied to relocations. */
- Elf_Internal_Phdr *phdr = find_load_phdr (sec->bfd);
- unsigned vaddr = phdr ? phdr->p_vaddr : 0;
-
- sec->addr = nto_truncate_ptr (sec->addr + LM_ADDR (so) - vaddr);
- sec->endaddr = nto_truncate_ptr (sec->endaddr + LM_ADDR (so) - vaddr);
-}
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr)
-{
- nto_regset_t regset;
-
- nto_init_solib_absolute_prefix ();
-
- if (which == NTO_REG_GENERAL)
- {
- memcpy ((char *) &regset, core_reg_sect,
- min (core_reg_size, sizeof (regset)));
- nto_supply_gregset ((char *) &regset);
- }
- else if (which == NTO_REG_FLOAT)
- {
- memcpy ((char *) &regset, core_reg_sect,
- min (core_reg_size, sizeof (regset)));
- nto_supply_fpregset ((char *) &regset);
- }
- else if (which == NTO_REG_ALT)
- {
- memcpy ((char *) &regset, core_reg_sect,
- min (core_reg_size, sizeof (regset)));
- nto_supply_altregset ((char *) &regset);
- }
-}
-
-void
-nto_dummy_supply_regset (char *regs)
-{
- /* Do nothing. */
-}
-
-/* Register that we are able to handle ELF file formats using standard
- procfs "regset" structures. */
-static struct core_fns regset_core_fns = {
- bfd_target_elf_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
-
-void
-_initialize_nto_tdep (void)
-{
- add_setshow_cmd ("nto-debug", class_maintenance, var_zinteger,
- &nto_internal_debugging, "Set QNX NTO internal debugging.\n\
-When non-zero, nto specific debug info is\n\
-displayed. Different information is displayed\n\
-for different positive values.", "Show QNX NTO internal debugging.\n",
- NULL, NULL, &setdebuglist, &showdebuglist);
-
- /* We use SIG45 for pulses, or something, so nostop, noprint
- and pass them. */
- signal_stop_update (target_signal_from_name ("SIG45"), 0);
- signal_print_update (target_signal_from_name ("SIG45"), 0);
- signal_pass_update (target_signal_from_name ("SIG45"), 1);
-
- /* By default we don't want to stop on these two, but we do want to pass. */
-#if defined(SIGSELECT)
- signal_stop_update (SIGSELECT, 0);
- signal_print_update (SIGSELECT, 0);
- signal_pass_update (SIGSELECT, 1);
-#endif
-
-#if defined(SIGPHOTON)
- signal_stop_update (SIGPHOTON, 0);
- signal_print_update (SIGPHOTON, 0);
- signal_pass_update (SIGPHOTON, 1);
-#endif
-
- /* Register core file support. */
- add_core_fns (&regset_core_fns);
-}
diff --git a/gdb/nto-tdep.h b/gdb/nto-tdep.h
deleted file mode 100644
index e22e8fd525c..00000000000
--- a/gdb/nto-tdep.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* nto-tdep.h - QNX Neutrino target header.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- Contributed by QNX Software Systems Ltd.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _NTO_TDEP_H
-#define _NTO_TDEP_H
-
-#include "defs.h"
-#include "solist.h"
-
-/* Generic functions in nto-tdep.c. */
-
-extern void nto_init_solib_absolute_prefix (void);
-
-char **nto_parse_redirection (char *start_argv[], char **in,
- char **out, char **err);
-
-int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
-
-void nto_relocate_section_addresses (struct so_list *, struct section_table *);
-
-int nto_map_arch_to_cputype (const char *);
-
-int nto_find_and_open_solib (char *, unsigned, char **);
-
-/* Dummy function for initializing nto_target_ops on targets which do
- not define a particular regset. */
-void nto_dummy_supply_regset (char *regs);
-
-/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
-
-struct nto_target_ops
-{
- int nto_internal_debugging;
- unsigned nto_cpuinfo_flags;
- int nto_cpuinfo_valid;
-
- int (*nto_regset_id) (int);
- void (*nto_supply_gregset) (char *);
- void (*nto_supply_fpregset) (char *);
- void (*nto_supply_altregset) (char *);
- void (*nto_supply_regset) (int, char *);
- int (*nto_register_area) (int, int, unsigned *);
- int (*nto_regset_fill) (int, char *);
- struct link_map_offsets *(*nto_fetch_link_map_offsets) (void);
-};
-
-extern struct nto_target_ops current_nto_target;
-
-/* For 'maintenance debug nto-debug' command. */
-#define nto_internal_debugging \
- (current_nto_target.nto_internal_debugging)
-
-/* The CPUINFO flags from the remote. Currently used by
- i386 for fxsave but future proofing other hosts.
- This is initialized in procfs_attach or nto_start_remote
- depending on our host/target. It would only be invalid
- if we were talking to an older pdebug which didn't support
- the cpuinfo message. */
-#define nto_cpuinfo_flags \
- (current_nto_target.nto_cpuinfo_flags)
-
-/* True if successfully retrieved cpuinfo from remote. */
-#define nto_cpuinfo_valid \
- (current_nto_target.nto_cpuinfo_valid)
-
-/* Given a register, return an id that represents the Neutrino
- regset it came from. If reg == -1 update all regsets. */
-#define nto_regset_id(reg) \
- (*current_nto_target.nto_regset_id) (reg)
-
-#define nto_supply_gregset(regs) \
- (*current_nto_target.nto_supply_gregset) (regs)
-
-#define nto_supply_fpregset(regs) \
- (*current_nto_target.nto_supply_fpregset) (regs)
-
-#define nto_supply_altregset(regs) \
- (*current_nto_target.nto_supply_altregset) (regs)
-
-/* Given a regset, tell gdb about registers stored in data. */
-#define nto_supply_regset(regset, data) \
- (*current_nto_target.nto_supply_regset) (regset, data)
-
-/* Given a register and regset, calculate the offset into the regset
- and stuff it into the last argument. If regno is -1, calculate the
- size of the entire regset. Returns length of data, -1 if unknown
- regset, 0 if unknown register. */
-#define nto_register_area(reg, regset, off) \
- (*current_nto_target.nto_register_area) (reg, regset, off)
-
-/* Build the Neutrino register set info into the data buffer.
- Return -1 if unknown regset, 0 otherwise. */
-#define nto_regset_fill(regset, data) \
- (*current_nto_target.nto_regset_fill) (regset, data)
-
-/* Gives the fetch_link_map_offsets function exposure outside of
- solib-svr4.c so that we can override relocate_section_addresses(). */
-#define nto_fetch_link_map_offsets() \
- (*current_nto_target.nto_fetch_link_map_offsets) ()
-
-/* Keep this consistant with neutrino syspage.h. */
-enum
-{
- CPUTYPE_X86,
- CPUTYPE_PPC,
- CPUTYPE_MIPS,
- CPUTYPE_SPARE,
- CPUTYPE_ARM,
- CPUTYPE_SH,
- CPUTYPE_UNKNOWN
-};
-
-enum
-{
- OSTYPE_QNX4,
- OSTYPE_NTO
-};
-
-/* These correspond to the DSMSG_* versions in dsmsgs.h. */
-enum
-{
- NTO_REG_GENERAL,
- NTO_REG_FLOAT,
- NTO_REG_SYSTEM,
- NTO_REG_ALT,
- NTO_REG_END
-};
-
-typedef char qnx_reg64[8];
-
-typedef struct _debug_regs
-{
- qnx_reg64 padding[1024];
-} nto_regset_t;
-
-#endif
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 20c8adda44a..4561e4d648d 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -204,7 +204,7 @@ fetch_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
CORE_ADDR regaddr = ppc_register_u_addr (regno);
if (altivec_register_p (regno))
@@ -364,7 +364,7 @@ store_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
if (altivec_register_p (regno))
{
diff --git a/gdb/regcache.c b/gdb/regcache.c
index acf3044fa3c..e0a0b89336b 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -78,6 +78,9 @@ struct regcache_descr
long *register_offset;
long *sizeof_register;
+ /* Useful constant. Largest of all the registers. */
+ long max_register_size;
+
/* Cached table containing the type of each register. */
struct type **register_type;
};
@@ -106,6 +109,7 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
read_register_bytes() and write_register_bytes() registers. */
descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long);
descr->register_offset = XCALLOC (descr->nr_cooked_registers, long);
+ descr->max_register_size = 0;
for (i = 0; i < descr->nr_cooked_registers; i++)
{
/* FIXME: cagney/2001-12-04: This code shouldn't need to use
@@ -115,8 +119,10 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
entirely avoid this uglyness. */
descr->register_offset[i] = REGISTER_BYTE (i);
descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
- gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i));
- gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i));
+ if (descr->max_register_size < REGISTER_RAW_SIZE (i))
+ descr->max_register_size = REGISTER_RAW_SIZE (i);
+ if (descr->max_register_size < REGISTER_VIRTUAL_SIZE (i))
+ descr->max_register_size = REGISTER_VIRTUAL_SIZE (i);
}
/* Compute the real size of the register buffer. Start out by
@@ -181,12 +187,6 @@ init_regcache_descr (struct gdbarch *gdbarch)
&& !gdbarch_pseudo_register_write_p (gdbarch)
&& !gdbarch_register_type_p (gdbarch))
{
- /* NOTE: cagney/2003-05-02: Don't add a test for REGISTER_BYTE_P
- to the above. Doing that would cause all the existing
- architectures to revert back to the legacy regcache
- mechanisms, and that is not a good thing. Instead just,
- later, check that the register cache's layout is consistent
- with REGISTER_BYTE. */
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);
return descr;
@@ -213,12 +213,14 @@ init_regcache_descr (struct gdbarch *gdbarch)
long offset = 0;
descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long);
descr->register_offset = XCALLOC (descr->nr_cooked_registers, long);
+ descr->max_register_size = 0;
for (i = 0; i < descr->nr_cooked_registers; i++)
{
descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]);
descr->register_offset[i] = offset;
offset += descr->sizeof_register[i];
- gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]);
+ if (descr->max_register_size < descr->sizeof_register[i])
+ descr->max_register_size = descr->sizeof_register[i];
}
/* Set the real size of the register cache buffer. */
descr->sizeof_cooked_registers = offset;
@@ -231,19 +233,21 @@ init_regcache_descr (struct gdbarch *gdbarch)
buffer. Ulgh! */
descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
- /* Sanity check. Confirm that there is agreement between the
- regcache and the target's redundant REGISTER_BYTE (new targets
- should not even be defining it). */
+#if 0
+ /* Sanity check. Confirm that the assumptions about gdbarch are
+ true. The REGCACHE_DESCR_HANDLE is set before doing the checks
+ so that targets using the generic methods supplied by regcache
+ don't go into infinite recursion trying to, again, create the
+ regcache. */
+ set_gdbarch_data (gdbarch, regcache_descr_handle, descr);
for (i = 0; i < descr->nr_cooked_registers; i++)
{
- if (REGISTER_BYTE_P ())
- gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
-#if 0
gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
-#endif
+ gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
}
/* gdb_assert (descr->sizeof_raw_registers == REGISTER_BYTES (i)); */
+#endif
return descr;
}
@@ -282,6 +286,31 @@ register_type (struct gdbarch *gdbarch, int regnum)
the regcache descr. */
int
+max_register_size (struct gdbarch *gdbarch)
+{
+ struct regcache_descr *descr = regcache_descr (gdbarch);
+ return descr->max_register_size;
+}
+
+int
+legacy_max_register_raw_size (void)
+{
+ if (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ())
+ return DEPRECATED_MAX_REGISTER_RAW_SIZE;
+ else
+ return max_register_size (current_gdbarch);
+}
+
+int
+legacy_max_register_virtual_size (void)
+{
+ if (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ())
+ return DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE;
+ else
+ return max_register_size (current_gdbarch);
+}
+
+int
register_size (struct gdbarch *gdbarch, int regnum)
{
struct regcache_descr *descr = regcache_descr (gdbarch);
@@ -364,7 +393,7 @@ regcache_save (struct regcache *dst, regcache_cooked_read_ftype *cooked_read,
void *src)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- char buf[MAX_REGISTER_SIZE];
+ void *buf = alloca (max_register_size (gdbarch));
int regnum;
/* The DST should be `read-only', if it wasn't then the save would
end up trying to write the register values back out to the
@@ -398,7 +427,7 @@ regcache_restore (struct regcache *dst,
void *src)
{
struct gdbarch *gdbarch = dst->descr->gdbarch;
- char buf[MAX_REGISTER_SIZE];
+ void *buf = alloca (max_register_size (gdbarch));
int regnum;
/* The dst had better not be read-only. If it is, the `restore'
doesn't make much sense. */
@@ -652,7 +681,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
{
int in_end = in_start + in_len;
int regnum;
- char reg_buf[MAX_REGISTER_SIZE];
+ char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE);
/* See if we are trying to read bytes from out-of-date registers. If so,
update just those registers. */
@@ -1042,7 +1071,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
/* The register partially overlaps the range being written. */
else
{
- char regbuf[MAX_REGISTER_SIZE];
+ char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
/* What's the overlap between this register's bytes and
those the caller wants to write? */
int overlapstart = max (regstart, myregstart);
@@ -1075,7 +1104,7 @@ regcache_xfer_part (struct regcache *regcache, int regnum,
regcache_read_ftype *read, regcache_write_ftype *write)
{
struct regcache_descr *descr = regcache->descr;
- bfd_byte reg[MAX_REGISTER_SIZE];
+ bfd_byte *reg = alloca (descr->max_register_size);
gdb_assert (offset >= 0 && offset <= descr->sizeof_register[regnum]);
gdb_assert (len >= 0 && offset + len <= descr->sizeof_register[regnum]);
/* Something to do? */
@@ -1184,6 +1213,36 @@ read_register_pid (int regnum, ptid_t ptid)
return retval;
}
+/* Return the contents of register REGNUM as a signed integer. */
+
+LONGEST
+read_signed_register (int regnum)
+{
+ void *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ deprecated_read_register_gen (regnum, buf);
+ return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
+}
+
+LONGEST
+read_signed_register_pid (int regnum, ptid_t ptid)
+{
+ ptid_t save_ptid;
+ LONGEST retval;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ return read_signed_register (regnum);
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ retval = read_signed_register (regnum);
+
+ inferior_ptid = save_ptid;
+
+ return retval;
+}
+
/* Store VALUE into the raw contents of register number REGNUM. */
void
@@ -1465,7 +1524,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
int footnote_register_offset = 0;
int footnote_register_type_name_null = 0;
long register_offset = 0;
- unsigned char buf[MAX_REGISTER_SIZE];
+ unsigned char *buf = alloca (regcache->descr->max_register_size);
#if 0
fprintf_unfiltered (file, "legacy_p %d\n", regcache->descr->legacy_p);
@@ -1477,6 +1536,8 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
regcache->descr->sizeof_raw_registers);
fprintf_unfiltered (file, "sizeof_raw_register_valid_p %ld\n",
regcache->descr->sizeof_raw_register_valid_p);
+ fprintf_unfiltered (file, "max_register_size %ld\n",
+ regcache->descr->max_register_size);
fprintf_unfiltered (file, "NUM_REGS %d\n", NUM_REGS);
fprintf_unfiltered (file, "NUM_PSEUDO_REGS %d\n", NUM_PSEUDO_REGS);
#endif
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 5d77095810b..3fb43c437a4 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -127,6 +127,12 @@ extern int register_offset_hack (struct gdbarch *gdbarch, int regnum);
extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
+/* Return the size of the largest register. Used when allocating
+ space for an aribtrary register value. */
+
+extern int max_register_size (struct gdbarch *gdbarch);
+
+
/* Return the size of register REGNUM. All registers should have only
one size.
@@ -241,6 +247,10 @@ extern ULONGEST read_register (int regnum);
/* Rename to read_unsigned_register_pid()? */
extern ULONGEST read_register_pid (int regnum, ptid_t ptid);
+extern LONGEST read_signed_register (int regnum);
+
+extern LONGEST read_signed_register_pid (int regnum, ptid_t ptid);
+
extern void write_register (int regnum, LONGEST val);
extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid);
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index 8df964771a2..da9bfc70e68 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -731,7 +731,7 @@ array_wait (ptid_t ptid, struct target_waitstatus *status)
static void
array_fetch_registers (int ignored)
{
- char reg[MAX_REGISTER_SIZE];
+ char *reg = alloca (MAX_REGISTER_RAW_SIZE);
int regno;
char *p;
char *packet = alloca (PBUFSIZ);
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index 643c6b6fe1b..3b9a9414dde 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -785,7 +785,7 @@ void
fetch_regs_from_dump (int (*nextchar) (), char *want)
{
int regno;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
int thischar = nextchar ();
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index d1e3705a4c8..17994f9d4da 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1791,7 +1791,7 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
&rpc, &rfp, &rsp, flags);
if (nfields >= 3)
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
store_unsigned_integer (buf, REGISTER_RAW_SIZE (PC_REGNUM), rpc);
supply_register (PC_REGNUM, buf);
@@ -1972,7 +1972,7 @@ mips_fetch_registers (int regno)
}
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (max_register_size (current_gdbarch));
/* We got the number the register holds, but gdb expects to see a
value in the target byte ordering. */
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index a9dba9ab401..3f956e7811b 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -550,7 +550,7 @@ rdp_fetch_one_fpu_register (int mask, char *buf)
send_rdp ("bbw-SWWWWZ", RDP_COPRO_READ, FPU_COPRO_NUMBER, mask, buf + 0, buf + 4, buf + 8, &dummy);
}
#endif
- memset (buf, 0, MAX_REGISTER_SIZE);
+ memset (buf, 0, MAX_REGISTER_RAW_SIZE);
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f7b9e89b0ba..f934bd40f03 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -304,9 +304,9 @@ gdbsim_fetch_register (int regno)
{
/* For moment treat a `does not exist' register the same way
as an ``unavailable'' register. */
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
int nr_bytes;
- memset (buf, 0, MAX_REGISTER_SIZE);
+ memset (buf, 0, MAX_REGISTER_RAW_SIZE);
supply_register (regno, buf);
set_register_cached (regno, -1);
break;
@@ -314,10 +314,10 @@ gdbsim_fetch_register (int regno)
default:
{
static int warn_user = 1;
- char buf[MAX_REGISTER_SIZE];
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
int nr_bytes;
gdb_assert (regno >= 0 && regno < NUM_REGS);
- memset (buf, 0, MAX_REGISTER_SIZE);
+ memset (buf, 0, MAX_REGISTER_RAW_SIZE);
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
buf, REGISTER_RAW_SIZE (regno));
@@ -359,7 +359,7 @@ gdbsim_store_register (int regno)
}
else if (REGISTER_SIM_REGNO (regno) >= 0)
{
- char tmp[MAX_REGISTER_SIZE];
+ char *tmp = alloca (max_register_size (current_gdbarch));
int nr_bytes;
deprecated_read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc,
diff --git a/gdb/remote.c b/gdb/remote.c
index 20becee27d6..902cb5fc62d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2948,7 +2948,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char regs[MAX_REGISTER_SIZE];
+ char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3199,7 +3199,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char regs[MAX_REGISTER_SIZE];
+ char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3546,7 +3546,7 @@ store_register_using_P (int regnum)
struct packet_reg *reg = packet_reg_from_regnum (rs, regnum);
/* Try storing a single register. */
char *buf = alloca (rs->remote_packet_size);
- char regp[MAX_REGISTER_SIZE];
+ char *regp = alloca (MAX_REGISTER_RAW_SIZE);
char *p;
int i;
@@ -3973,10 +3973,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len,
int targ_len;
int res;
- /* Should this be the selected frame? */
- gdbarch_remote_translate_xfer_address (current_gdbarch, current_regcache,
- mem_addr, mem_len,
- &targ_addr, &targ_len);
+ REMOTE_TRANSLATE_XFER_ADDRESS (mem_addr, mem_len, &targ_addr, &targ_len);
if (targ_len <= 0)
return 0;
diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c
index 6b0926bf408..57c0a182327 100644
--- a/gdb/rom68k-rom.c
+++ b/gdb/rom68k-rom.c
@@ -88,7 +88,7 @@ static char *
rom68k_supply_one_register (int regno, unsigned char *hex)
{
ULONGEST value;
- unsigned char regbuf[MAX_REGISTER_SIZE];
+ unsigned char *regbuf = alloca (max_register_size (current_gdbarch));
value = 0;
while (*hex != '\0')
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index c5a0ea73d8f..4aed8d8a939 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -218,7 +218,7 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
static void
fetch_register (int regno)
{
- int addr[MAX_REGISTER_SIZE];
+ int *addr = alloca (MAX_REGISTER_RAW_SIZE);
int nr, isfloat;
/* Retrieved values may be -1, so infer errors from errno. */
@@ -275,7 +275,7 @@ fetch_register (int regno)
static void
store_register (int regno)
{
- int addr[MAX_REGISTER_SIZE];
+ int *addr = alloca (MAX_REGISTER_RAW_SIZE);
int nr, isfloat;
/* Fetch the register's value from the register cache. */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 0b239bd4180..019284901ac 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1739,7 +1739,7 @@ frame_initial_stack_address (struct frame_info *fi)
/* There is an alloca register, use its value, in the current frame,
as the initial stack pointer. */
{
- char tmpbuf[MAX_REGISTER_SIZE];
+ char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE);
if (frame_register_read (fi, fdata.alloca_reg, tmpbuf))
{
get_frame_extra_info (fi)->initial_sp
@@ -1921,7 +1921,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
@@ -1944,7 +1944,7 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
@@ -2878,7 +2878,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, v->nregs);
set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
set_gdbarch_register_name (gdbarch, rs6000_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, wordsize);
+ set_gdbarch_register_size (gdbarch, wordsize);
set_gdbarch_register_bytes (gdbarch, off);
set_gdbarch_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size);
@@ -2900,7 +2900,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_char_signed (gdbarch, 0);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
+ set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index f836c1b0516..f5a424de397 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1150,7 +1150,7 @@ void
s390_store_return_value (struct type *valtype, char *valbuf)
{
int arglen;
- char *reg_buff = alloca (max (S390_FPR_SIZE, DEPRECATED_REGISTER_SIZE)), *value;
+ char *reg_buff = alloca (max (S390_FPR_SIZE, REGISTER_SIZE)), *value;
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
{
@@ -1876,13 +1876,14 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_deprecated_push_return_address (gdbarch,
s390_push_return_address);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words));
- set_gdbarch_deprecated_call_dummy_words (gdbarch, s390_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch,
+ sizeof (s390_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words);
switch (info.bfd_arch_info->mach)
{
case bfd_mach_s390_31:
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, s390_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, s390_register_raw_size);
set_gdbarch_register_virtual_type (gdbarch, s390_register_virtual_type);
@@ -1891,7 +1892,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_bytes (gdbarch, S390_REGISTER_BYTES);
break;
case bfd_mach_s390_64:
- set_gdbarch_deprecated_register_size (gdbarch, 8);
+ set_gdbarch_register_size (gdbarch, 8);
set_gdbarch_register_raw_size (gdbarch, s390x_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, s390x_register_raw_size);
set_gdbarch_register_virtual_type (gdbarch,
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index dcc583ec98e..dab16478413 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -56,7 +56,7 @@ sentinel_frame_prev_register (struct frame_info *next_frame,
onto the corresponding hardware register. */
*optimized = 0;
*lvalp = lval_register;
- *addrp = register_offset_hack (current_gdbarch, regnum);
+ *addrp = REGISTER_BYTE (regnum);
*realnum = regnum;
/* If needed, find and return the value of the register. */
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 0ef65de2c02..6bb0237cccd 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1770,7 +1770,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi),
PC_REGNUM);
- get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
get_frame_extra_info (fi)->leaf_function = 0;
return;
}
@@ -1801,7 +1801,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
get_frame_extra_info (fi)->return_pc =
deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
- get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
get_frame_extra_info (fi)->leaf_function = 0;
return;
}
@@ -3481,7 +3481,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, void *buffer)
{
int base_regnum, portion;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3520,7 +3520,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int base_regnum;
int portion;
int offset = 0;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3684,7 +3684,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, const void *buffer)
{
int base_regnum, portion;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3721,7 +3721,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum, portion;
int offset;
- char temp_buffer[MAX_REGISTER_SIZE];
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -4087,7 +4087,7 @@ sh64_do_pseudo_register (int regnum)
static void
sh_do_register (int regnum)
{
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (max_register_size (current_gdbarch));
fputs_filtered (REGISTER_NAME (regnum), gdb_stdout);
print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout);
@@ -4367,7 +4367,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_sp_regnum (gdbarch, 15);
set_gdbarch_deprecated_fp_regnum (gdbarch, 14);
set_gdbarch_pc_regnum (gdbarch, 16);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, SH_DEFAULT_NUM_REGS * 4);
set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
@@ -4586,7 +4586,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* the number of real registers is the same whether we are in
ISA16(compact) or ISA32(media). */
set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
- set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
+ set_gdbarch_register_size (gdbarch, 8); /*????*/
set_gdbarch_register_bytes (gdbarch,
((SIM_SH64_NR_FP_REGS + 1) * 4)
+ (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
@@ -4652,8 +4652,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, sh_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words));
+ set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words));
set_gdbarch_deprecated_push_return_address (gdbarch, sh_push_return_address);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 8e2c4ad57a8..1d379e9ec19 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -647,9 +647,9 @@ sol_thread_store_registers (int regno)
if (regno != -1)
{ /* Not writing all the regs */
/* save new register value */
- char* old_value = (char*) alloca (DEPRECATED_REGISTER_SIZE);
+ char* old_value = (char*) alloca (REGISTER_SIZE);
memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_SIZE);
+ REGISTER_SIZE);
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
@@ -662,7 +662,7 @@ sol_thread_store_registers (int regno)
/* restore new register value */
memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value,
- DEPRECATED_REGISTER_SIZE);
+ REGISTER_SIZE);
#if 0
/* thread_db doesn't seem to handle this right */
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 7f0ae4b2046..b3081cd40ed 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -317,7 +317,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
deprecated_read_fp() to create_new_frame. */
if (get_next_frame (fi))
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
/* Compute ->frame as if not flat. If it is flat, we'll change
it later. */
@@ -366,7 +368,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf;
+
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
/* We definitely have a flat frame now. */
get_frame_extra_info (fi)->flat = 1;
@@ -470,9 +474,10 @@ sparc_extract_struct_value_address (char *regbuf)
CORE_ADDR
sparc_frame_saved_pc (struct frame_info *frame)
{
- char buf[MAX_REGISTER_SIZE];
+ char *buf;
CORE_ADDR addr;
+ buf = alloca (MAX_REGISTER_RAW_SIZE);
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
/* This is the signal trampoline frame.
@@ -2065,8 +2070,8 @@ sparc_print_registers (struct gdbarch *gdbarch,
{
int i;
const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
for (i = 0; i < numregs; i++)
{
@@ -2306,7 +2311,9 @@ void
sparc_store_return_value (struct type *type, char *valbuf)
{
int regno;
- char buffer[MAX_REGISTER_SIZE];
+ char *buffer;
+
+ buffer = alloca (MAX_REGISTER_RAW_SIZE);
if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
/* Floating-point values are returned in the register pair */
@@ -2350,10 +2357,9 @@ sparc_store_return_value (struct type *type, char *valbuf)
For structs and unions, if the function was compiled with Sun cc,
it expects 'unimp' after the call. But gcc doesn't use that
- (twisted) convention. So leave a nop there for gcc
- (DEPRECATED_FIX_CALL_DUMMY can assume it is operating on a pristine
- CALL_DUMMY, not one that has already been customized for a
- different function). */
+ (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
+ can assume it is operating on a pristine CALL_DUMMY, not one that
+ has already been customized for a different function). */
void
sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
@@ -2386,10 +2392,10 @@ sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
{
store_unsigned_integer (dummy + CALL_DUMMY_CALL_OFFSET + 8, 4,
TYPE_LENGTH (value_type) & 0x1fff);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x30);
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x30);
}
else
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 0x2c);
+ set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 0x2c);
if (!(GDB_TARGET_IS_SPARC64))
{
@@ -3048,7 +3054,7 @@ sparc_gdbarch_fix_call_dummy (char *dummy,
static CORE_ADDR
sparc_call_dummy_address (void)
{
- return (DEPRECATED_CALL_DUMMY_START_OFFSET) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
+ return (CALL_DUMMY_START_OFFSET) + CALL_DUMMY_BREAKPOINT_OFFSET;
}
/* Supply the Y register number to those that need it. */
@@ -3157,7 +3163,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
+ set_gdbarch_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_fp_regnum (gdbarch, SPARC_FP_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM);
@@ -3215,8 +3221,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC32_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 0x30);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, 0x38);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30);
+ set_gdbarch_call_dummy_length (gdbarch, 0x38);
/* NOTE: cagney/2003-05-01: Using the just added push_dummy_code
architecture method, it is now possible to implement a
@@ -3270,10 +3276,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
are explained in Appendix D.3. */
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_32);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_32);
#else
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
#endif
set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 68);
set_gdbarch_frame_args_skip (gdbarch, 68);
@@ -3287,14 +3293,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_byte (gdbarch, sparc32_register_byte);
set_gdbarch_register_raw_size (gdbarch, sparc32_register_size);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
+ set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_virtual_size (gdbarch, sparc32_register_size);
set_gdbarch_register_virtual_type (gdbarch,
sparc32_register_virtual_type);
#ifdef SPARC32_CALL_DUMMY_ON_STACK
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32));
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_32));
#else
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc32_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
@@ -3317,14 +3323,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC64_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, 192);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
+ set_gdbarch_call_dummy_length (gdbarch, 192);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 148);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_64);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 148);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_64);
#else
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
#endif
set_gdbarch_deprecated_call_dummy_stack_adjust (gdbarch, 128);
set_gdbarch_frame_args_skip (gdbarch, 136);
@@ -3341,14 +3347,14 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
to assume they all are (since most of them are). */
set_gdbarch_register_byte (gdbarch, sparc64_register_byte);
set_gdbarch_register_raw_size (gdbarch, sparc64_register_size);
- set_gdbarch_deprecated_register_size (gdbarch, 8);
+ set_gdbarch_register_size (gdbarch, 8);
set_gdbarch_register_virtual_size (gdbarch, sparc64_register_size);
set_gdbarch_register_virtual_type (gdbarch,
sparc64_register_virtual_type);
#ifdef SPARC64_CALL_DUMMY_ON_STACK
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64));
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_64));
#else
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
#endif
set_gdbarch_stack_align (gdbarch, sparc64_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
diff --git a/gdb/stack.c b/gdb/stack.c
index 0a0aaac2a75..cfb3605d73a 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -814,7 +814,7 @@ frame_info (char *addr_exp, int from_tty)
&realnum, NULL);
if (!optimized && lval == not_lval)
{
- char value[MAX_REGISTER_SIZE];
+ void *value = alloca (MAX_REGISTER_RAW_SIZE);
CORE_ADDR sp;
frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
&realnum, value);
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 636b1d9c1ba..70eb125c1ba 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -987,9 +987,9 @@ maintenance_print_objfiles (char *ignore, int from_tty)
}
-/* List all the symbol tables whose names match REGEXP (optional). */
+/* List all the symbol tables. */
void
-maintenance_info_symtabs (char *regexp, int from_tty)
+maintenance_list_symtabs (char *regexp, int from_tty)
{
struct objfile *objfile;
@@ -1036,9 +1036,9 @@ maintenance_info_symtabs (char *regexp, int from_tty)
}
-/* List all the partial symbol tables whose names match REGEXP (optional). */
+/* List all the partial symbol tables. */
void
-maintenance_info_psymtabs (char *regexp, int from_tty)
+maintenance_list_psymtabs (char *regexp, int from_tty)
{
struct objfile *objfile;
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4330b962257..05275363936 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1233,9 +1233,9 @@ void maintenance_print_msymbols (char *, int);
void maintenance_print_objfiles (char *, int);
-void maintenance_info_symtabs (char *, int);
+void maintenance_list_symtabs (char *, int);
-void maintenance_info_psymtabs (char *, int);
+void maintenance_list_psymtabs (char *, int);
void maintenance_check_symtabs (char *, int);
diff --git a/gdb/target.c b/gdb/target.c
index fd0165a19ba..4de246cc174 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1215,7 +1215,7 @@ find_default_create_inferior (char *exec_file, char *allargs, char **env)
static int
default_region_size_ok_for_hw_watchpoint (int byte_count)
{
- return (byte_count <= DEPRECATED_REGISTER_SIZE);
+ return (byte_count <= REGISTER_SIZE);
}
static int
@@ -1640,7 +1640,7 @@ debug_print_register (const char * func, int regno)
if (regno >= 0)
{
int i;
- unsigned char buf[MAX_REGISTER_SIZE];
+ unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE);
deprecated_read_register_gen (regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
for (i = 0; i < REGISTER_RAW_SIZE (regno); i++)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 22ac56a3c1c..cdef9e05dc6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,28 +1,3 @@
-2003-05-08 Jeff Johnston <jjohnstn@redhat.com>
-
- * gdb.threads/schedlock.exp: Remove assumption that all threads
- will run in a particular small time slice. Also ensure we break
- in one of the child threads rather than the main thread.
-
-2003-05-07 Jim Blandy <jimb@redhat.com>
-
- Add support for assembly source testing on the s390x.
- * gdb.asm/asm-source.exp: Add a case for the s390x-*-*
- architecture.
- * gdb.asm/s390x.inc: New file.
-
- * gdb.asm/asm-source.exp: Use a 'switch -glob' statement, not a
- succession of 'if' statements.
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * gdb.base/maint.exp: Add tests for "maint print dummy-frames".
-
-2003-05-05 Andrew Cagney <cagney@redhat.com>
-
- * gdb.base/watchpoint.exp: Rename CALL_DUMMY_BREAKPOINT_OFFSET to
- DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET in comments.
-
2003-05-02 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/charset.exp: Update based on new behavior of set/show
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index e4aa7be4fd9..96b7991e78d 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -35,66 +35,60 @@ set asm-arch ""
set asm-flags ""
set link-flags ""
-switch -glob -- [istarget] {
- "*arm-*-*" {
- set asm-arch arm
- }
- "xscale-*-*" {
- set asm-arch arm
- }
- "d10v-*-*" {
- set asm-arch d10v
- }
- "s390-*-*" {
- set asm-arch s390
- }
- "s390x-*-*" {
- set asm-arch s390x
- }
- "x86_64-*-*" {
- set asm-arch x86_64
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
- }
- "i\[3456\]86-*-*" {
- set asm-arch i386
- if [istarget "*-*-cygwin*"] then {
- set link-flags "--entry _start"
- }
- }
- "m32r*-*" {
- set asm-arch m32r
- }
- "m6811-*-*" {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
- }
- "m6812-*-*" {
- set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
- }
- "mips*-*" {
- set asm-arch mips
- }
- "powerpc*-*" {
- set asm-arch powerpc
- }
- "sparc-*-*" {
- set asm-arch sparc
- }
- "sparc64-*-*" {
- set asm-arch sparc64
- set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
- }
- "xstormy16-*-*" {
- set asm-arch xstormy16
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
- }
- "v850-*-*" {
- set asm-arch v850
- set gdb_wrapper_initialized 1
+if [istarget "*arm-*-*"] then {
+ set asm-arch arm
+}
+if [istarget "xscale-*-*"] then {
+ set asm-arch arm
+}
+if [istarget "d10v-*-*"] then {
+ set asm-arch d10v
+}
+if [istarget "s390-*-*"] then {
+ set asm-arch s390
+}
+if [istarget "x86_64-*-*"] then {
+ set asm-arch x86_64
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "i\[3456\]86-*-*"] then {
+ set asm-arch i386
+ if [istarget "*-*-cygwin*"] then {
+ set link-flags "--entry _start"
}
}
-
+if [istarget "m32r*-*"] then {
+ set asm-arch m32r
+}
+if [istarget "m6811-*-*"] then {
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "m6812-*-*"] then {
+ set asm-arch m68hc11
+ set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "mips*-*"] then {
+ set asm-arch mips
+}
+if [istarget "powerpc*-*"] then {
+ set asm-arch powerpc
+}
+if [istarget "sparc-*-*"] then {
+ set asm-arch sparc
+}
+if [istarget "sparc64-*-*"] then {
+ set asm-arch sparc64
+ set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "xstormy16-*-*"] then {
+ set asm-arch xstormy16
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "v850-*-*"] then {
+ set asm-arch v850
+ set gdb_wrapper_initialized 1
+}
if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
diff --git a/gdb/testsuite/gdb.asm/s390x.inc b/gdb/testsuite/gdb.asm/s390x.inc
deleted file mode 100644
index 4e5bf2ea65d..00000000000
--- a/gdb/testsuite/gdb.asm/s390x.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-### entry point code
- .macro gdbasm_startup
-
- # Align the stack pointer to an 8-byte boundary.
- lghi %r0,-16
- ngr %r15,%r0
-
- # Reserve space for the standard stack frame:
- # back chain, and space for the callee to save its registers.
- aghi %r15,-168
-
- # Zero this frame's back chain pointer.
- xc 0(8,%r15),0(%r15)
- .endm
-
-
-### Call a function.
- .macro gdbasm_call subr
- brasl %r14, \subr
- .endm
-
-
-### Exit with a zero status.
- .macro gdbasm_exit0
- lghi %r2, 0
- svc 1
- .endm
-
-### Standard subroutine prologue.
- .macro gdbasm_enter
-
- # Save all the callee-saves registers. What the heck.
- stmg %r6,%r15,48(%r15)
-
- # Allocate the stack frame, and write the back chain pointer.
- # Keep the original SP in %r11.
- lgr %r11,%r15
- aghi %r15,-168
- stg %r11,0(%r15)
- .endm
-
-
-### Standard subroutine epilogue.
- .macro gdbasm_leave
-
- # Restore all our registers. This also pops the frame, and
- # restores our return address.
- lmg %r6,%r15,216(%r15)
-
- # Jump to the return address.
- br %r14
-
- .endm
-
-### Several nops.
- .macro gdbasm_several_nops
- lr %r0, %r0
- lr %r0, %r0
- lr %r0, %r0
- lr %r0, %r0
- .endm
-
-### Declare an `int' variable.
- .macro gdbasm_datavar name value
- .data
-\name:
- .long \value
- .endm
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index f82bf0202b0..d8286508699 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -35,7 +35,6 @@
#maintenance info -- Commands for showing internal info about the program being debugged
#maintenance internal-error -- Give GDB an internal error.
#
-#maintenance print dummy-frames -- Print the dummy frame stack
#maintenance print statistics -- Print statistics about internal gdb state
#maintenance print objfiles -- Print dump of current object file definitions
#maintenance print psymbols -- Print dump of current partial symbol definitions
@@ -187,9 +186,6 @@ gdb_expect {
timeout { fail "(timeout) maint print statistics" }
}
-# There aren't any ...
-gdb_test "maint print dummy-frames" ""
-
send_gdb "maint print objfiles\n"
# To avoid timeouts, we avoid expects with many .* patterns that match
@@ -528,9 +524,6 @@ gdb_expect {
timeout { fail "(timeout) help maint print statistics" }
}
-gdb_test "help maint print dummy-frames" \
- "Print the contents of the internal dummy-frame stack."
-
send_gdb "help maint print objfiles\n"
gdb_expect {
-re "Print dump of current object file definitions\\..*$gdb_prompt $"\
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index fd5d8f286b2..c5e37d451a5 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -377,7 +377,7 @@ proc test_stepping {} {
# The problem is that GDB confuses stepping through the call
# dummy with hitting the breakpoint at the end of the call dummy.
# Will be fixed once all architectures define
- # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET.
+ # CALL_DUMMY_BREAKPOINT_OFFSET.
setup_xfail "*-*-*"
# This doesn't occur if the call dummy starts with a call,
# because we are out of the dummy by the first time the inferior
@@ -388,7 +388,7 @@ proc test_stepping {} {
clear_xfail "m68*-*-*"
clear_xfail "i*86*-*-*"
clear_xfail "vax-*-*"
- # The following architectures define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET.
+ # The following architectures define CALL_DUMMY_BREAKPOINT_OFFSET.
clear_xfail "alpha-*-*"
clear_xfail "mips*-*-*"
clear_xfail "sparc-*-*"
diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp
index 44785808ce3..28298c684a9 100644
--- a/gdb/testsuite/gdb.threads/schedlock.exp
+++ b/gdb/testsuite/gdb.threads/schedlock.exp
@@ -112,8 +112,8 @@ proc my_continue { msg } {
stop_process "stop all threads ($msg)"
- # Make sure we're in one of the non-main looping threads.
- gdb_breakpoint [concat [gdb_get_line_number "schedlock.exp: main loop"] " if arg != 5"]
+ # Make sure we're in one of the looping threads.
+ gdb_breakpoint [gdb_get_line_number "schedlock.exp: main loop"]
gdb_continue_to_breakpoint "return to loop ($msg)"
delete_breakpoints
}
@@ -230,11 +230,12 @@ if {$curthread == $newthread} {
set start_args $cont_args
set cont_args [get_args]
-set num_other_threads 0
for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
if {[lindex $start_args $i] == [lindex $cont_args $i]} {
if {$i == $curthread} {
fail "current thread stepped (didn't run)"
+ } else {
+ fail "other thread $i ran (didn't run) (1)"
}
} else {
if {$i == $curthread} {
@@ -244,15 +245,10 @@ for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
fail "current thread stepped (wrong amount)"
}
} else {
- set num_other_threads [expr $num_other_threads + 1]
+ pass "other thread $i ran (1)"
}
}
}
-if {$num_other_threads > 0} {
- pass "other threads ran (1)"
-} else {
- fail "other threads ran (no other threads ran) (1)"
-}
# Test continue with scheduler locking
gdb_test "set scheduler-locking on" ""
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index 0a6138b3afa..bac464151fa 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -945,7 +945,7 @@ thread_db_store_registers (int regno)
if (regno != -1)
{
- char raw[MAX_REGISTER_SIZE];
+ char *raw = alloca (max_register_size (current_gdbarch));
deprecated_read_register_gen (regno, raw);
thread_db_fetch_registers (-1);
diff --git a/gdb/thread.c b/gdb/thread.c
index 315f33b1c4a..53a2d4f49f4 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -292,6 +292,7 @@ gdb_list_thread_ids (struct ui_out *uiout)
void
load_infrun_state (ptid_t ptid,
CORE_ADDR *prev_pc,
+ char **prev_func_name,
int *trap_expected,
struct breakpoint **step_resume_breakpoint,
struct breakpoint **through_sigtramp_breakpoint,
@@ -315,6 +316,7 @@ load_infrun_state (ptid_t ptid,
return;
*prev_pc = tp->prev_pc;
+ *prev_func_name = tp->prev_func_name;
*trap_expected = tp->trap_expected;
*step_resume_breakpoint = tp->step_resume_breakpoint;
*through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint;
@@ -338,6 +340,7 @@ load_infrun_state (ptid_t ptid,
void
save_infrun_state (ptid_t ptid,
CORE_ADDR prev_pc,
+ char *prev_func_name,
int trap_expected,
struct breakpoint *step_resume_breakpoint,
struct breakpoint *through_sigtramp_breakpoint,
@@ -361,6 +364,7 @@ save_infrun_state (ptid_t ptid,
return;
tp->prev_pc = prev_pc;
+ tp->prev_func_name = prev_func_name;
tp->trap_expected = trap_expected;
tp->step_resume_breakpoint = step_resume_breakpoint;
tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint;
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 17ee07c898d..855a5b23b42 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1115,7 +1115,7 @@ memrange_sortmerge (struct collection_list *memranges)
{
if (memranges->list[a].type == memranges->list[b].type &&
memranges->list[b].start - memranges->list[a].end <=
- MAX_REGISTER_SIZE)
+ MAX_REGISTER_VIRTUAL_SIZE)
{
/* memrange b starts before memrange a ends; merge them. */
if (memranges->list[b].end > memranges->list[a].end)
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index f44f9aa9a48..0da559109b4 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,8 +1,3 @@
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * tuiRegs.c: Use MAX_REGISTER_SIZE instead of
- MAX_REGISTER_RAW_SIZE.
-
2003-05-03 Andrew Cagney <cagney@redhat.com>
* tuiDisassem.c (tui_disassemble): Call gdb_print_insn, instead of
diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c
index 61b933444da..6920d80d975 100644
--- a/gdb/tui/tuiRegs.c
+++ b/gdb/tui/tuiRegs.c
@@ -489,7 +489,7 @@ tuiCheckRegisterValues (struct frame_info *frame)
else
{
int i, j;
- char rawBuf[MAX_REGISTER_SIZE];
+ char rawBuf[MAX_REGISTER_RAW_SIZE];
for (i = 0;
(i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
@@ -766,7 +766,7 @@ _tuiRegValueHasChanged (TuiDataElementPtr dataElement,
if (dataElement->itemNo != UNDEFINED_ITEM &&
_tuiRegisterName (dataElement->itemNo) != (char *) NULL)
{
- char rawBuf[MAX_REGISTER_SIZE];
+ char rawBuf[MAX_REGISTER_RAW_SIZE];
int i;
if (_tuiGetRegisterRawValue (
@@ -830,7 +830,7 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
dataElement->highlight = FALSE;
}
if (dataElement->value == (Opaque) NULL)
- dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
+ dataElement->value = (Opaque) xmalloc (MAX_REGISTER_RAW_SIZE);
if (dataElement->value != (Opaque) NULL)
_tuiGetRegisterRawValue (regNum, dataElement->value, frame);
}
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 1828d1c74df..edfec072979 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1229,7 +1229,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, v850_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size);
+ set_gdbarch_register_size (gdbarch, v850_reg_size);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, v850_register_byte);
set_gdbarch_register_raw_size (gdbarch, v850_register_raw_size);
@@ -1277,9 +1277,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, v850_fix_call_dummy);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, v850_fix_call_dummy);
set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
diff --git a/gdb/valops.c b/gdb/valops.c
index e54969c3743..d8261c822f0 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -480,7 +480,7 @@ value_assign (struct value *toval, struct value *fromval)
{
register struct type *type;
struct value *val;
- char raw_buffer[MAX_REGISTER_SIZE];
+ char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
int use_buffer = 0;
struct frame_id old_frame;
@@ -634,7 +634,8 @@ value_assign (struct value *toval, struct value *fromval)
amount_to_copy = byte_offset + TYPE_LENGTH (type);
/* And a bounce buffer. Be slightly over generous. */
- buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE);
+ buffer = (char *) alloca (amount_to_copy
+ + MAX_REGISTER_RAW_SIZE);
/* Copy it in. */
for (regno = reg_offset, amount_copied = 0;
@@ -961,8 +962,8 @@ value_ind (struct value *arg1)
CORE_ADDR
push_word (CORE_ADDR sp, ULONGEST word)
{
- register int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
+ register int len = REGISTER_SIZE;
+ char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
store_unsigned_integer (buffer, len, word);
if (INNER_THAN (1, 2))
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 54ca48dd58a..4f1fcc9ab2c 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -50,6 +50,7 @@ static gdbarch_deprecated_extract_struct_value_address_ftype
vax_extract_struct_value_address;
static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
+static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
/* Return 1 if P points to an invalid floating point value.
LEN is the length in bytes -- not relevant on the Vax. */
@@ -626,7 +627,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
set_gdbarch_register_name (gdbarch, vax_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
+ set_gdbarch_register_size (gdbarch, VAX_REGISTER_SIZE);
set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, vax_register_byte);
set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
@@ -666,10 +667,10 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, vax_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, vax_fix_call_dummy);
- set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 7);
+ set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
+ set_gdbarch_fix_call_dummy (gdbarch, vax_fix_call_dummy);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7);
set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
diff --git a/gdb/version.in b/gdb/version.in
index f67ef295d96..d8e99e3ba13 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2003-05-09-cvs
+2003-05-04-cvs
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 7dd5f1e11d2..5872d5411bf 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -954,7 +954,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
in use on any of the supported x86-64 targets. */
set_gdbarch_register_name (gdbarch, x86_64_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, 8);
+ set_gdbarch_register_size (gdbarch, 8);
/* Total amount of space needed to store our copies of the machine's
register (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS +
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index d6aa0183e1e..1ff96a4ec22 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -1038,7 +1038,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_fp_regnum (gdbarch, E_FP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, xstormy16_register_name);
- set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
+ set_gdbarch_register_size (gdbarch, xstormy16_reg_size);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
@@ -1092,8 +1092,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch,
xstormy16_use_struct_convention);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
set_gdbarch_char_signed (gdbarch, 0);
diff --git a/include/ChangeLog b/include/ChangeLog
index b88ca788078..6d18714eee2 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,13 +1,3 @@
-2003-05-09 Alan Modra <amodra@bigpond.net.au>
-
- * xtensa-isa-internal.h (xtensa_isa_module_struct): Remove const on
- gen_num_opcodes_fn return type.
-
-2003-05-07 Jason Merrill <jason@redhat.com>
-
- * hashtab.h (iterative_hash): Prototype.
- (iterative_hash_object): New macro.
-
2003-04-28 H.J. Lu <hjl@gnu.org>
* bfdlink.h (bfd_link_info): Add relax_finalizing.
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index 77a8551a460..9a216a0f3e2 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,9 +1,3 @@
-2003-05-07 Andrew Cagney <cagney@redhat.com>
-
- * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter.
- (sim_d10v_translate_imap_addr): Add regcache parameter.
- (sim_d10v_translate_dmap_addr): Ditto.
-
2003-03-27 Nick Clifton <nickc@redhat.com>
* sim-arm.h (sim_arm_regs): Add iWMMXt registers.
diff --git a/include/gdb/sim-d10v.h b/include/gdb/sim-d10v.h
index 8294b14858b..f153a419478 100644
--- a/include/gdb/sim-d10v.h
+++ b/include/gdb/sim-d10v.h
@@ -58,23 +58,20 @@ extern unsigned long sim_d10v_translate_dmap_addr
(unsigned long offset,
int nr_bytes,
unsigned long *phys,
- void *regcache,
- unsigned long (*dmap_register) (void *regcache, int reg_nr));
+ unsigned long (*dmap_register) (int reg_nr));
extern unsigned long sim_d10v_translate_imap_addr
(unsigned long offset,
int nr_bytes,
unsigned long *phys,
- void *regcache,
- unsigned long (*imap_register) (void *regcache, int reg_nr));
+ unsigned long (*imap_register) (int reg_nr));
extern unsigned long sim_d10v_translate_addr
(unsigned long vaddr,
int nr_bytes,
unsigned long *phys,
- void *regcache,
- unsigned long (*dmap_register) (void *regcache, int reg_nr),
- unsigned long (*imap_register) (void *regcache, int reg_nr));
+ unsigned long (*dmap_register) (int reg_nr),
+ unsigned long (*imap_register) (int reg_nr));
/* The simulator makes use of the following register information. */
diff --git a/include/hashtab.h b/include/hashtab.h
index f7bd4ae69d3..7acb5eb2859 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -183,11 +183,6 @@ extern htab_eq htab_eq_pointer;
/* A hash function for null-terminated strings. */
extern hashval_t htab_hash_string PARAMS ((const PTR));
-/* An iterative hash function for arbitrary data. */
-extern hashval_t iterative_hash PARAMS ((const PTR, size_t, hashval_t));
-/* Shorthand for hashing something with an intrinsic size. */
-#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/xtensa-isa-internal.h b/include/xtensa-isa-internal.h
index 7f221eae48e..d2244c510a5 100644
--- a/include/xtensa-isa-internal.h
+++ b/include/xtensa-isa-internal.h
@@ -104,7 +104,7 @@ typedef struct xtensa_isa_internal_struct
typedef struct xtensa_isa_module_struct
{
- int (*get_num_opcodes_fn) (void);
+ const int (*get_num_opcodes_fn) (void);
xtensa_opcode_internal **(*get_opcodes_fn) (void);
int (*decode_insn_fn) (const xtensa_insnbuf);
struct config_struct *(*get_config_table_fn) (void);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 066980339ba..5beb09bb4fc 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,20 +1,3 @@
-2003-05-07 Josef Zlomek <zlomekj@suse.cz>
-
- * splay-tree.c (splay_tree_predecessor): Fix comment.
- (splay_tree_successor): Fix comment.
-
-2003-05-07 Jason Merrill <jason@redhat.com>
-
- * hashtab.c (iterative_hash): New fn.
- * configure.in: Add AC_C_BIGENDIAN_CROSS.
- * aclocal.m4: Include accross.m4.
- * configure, config.in: Regenerate.
-
-2003-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in (AC_CHECK_FUNCS): Don't make multiple calls.
- * configure: Regenerate.
-
2003-05-03 Carlo Wood <carlo@alinoe.com>
* cp-demangle.c: Fix typo in "char_traints" string-literal.
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index a3349f3b08f..6c5dc6ac64b 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -1,5 +1,3 @@
-sinclude(../config/accross.m4)
-
dnl See whether strncmp reads past the end of its string parameters.
dnl On some versions of SunOS4 at least, strncmp reads a word at a time
dnl but erroneously reads past the end of strings. This can cause
diff --git a/libiberty/config.in b/libiberty/config.in
index 14ab3793c5c..1cc6d6132e5 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -291,16 +291,6 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* whether byteorder is bigendian */
-#undef WORDS_BIGENDIAN
-
-/* Define if the host machine stores words of multi-word integers in
- big-endian order. */
-#undef HOST_WORDS_BIG_ENDIAN
-
-/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-#undef BYTEORDER
-
/* Define if errno must be declared even when <errno.h> is included. */
#undef NEED_DECLARATION_ERRNO
diff --git a/libiberty/configure b/libiberty/configure
index d0899a2dcbb..f1ba0c85832 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1198,142 +1198,6 @@ EOF
;;
esac
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1203: checking whether byte ordering is bigendian" >&5
-if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_cv_c_bigendian=unknown
-# See if sys/param.h defines the BYTE_ORDER macro.
-cat > conftest.$ac_ext <<EOF
-#line 1210 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/param.h>
-int main() {
-
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
-; return 0; }
-EOF
-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- # It does; now see whether it defined to BIG_ENDIAN or not.
-cat > conftest.$ac_ext <<EOF
-#line 1225 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/param.h>
-int main() {
-
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
-; return 0; }
-EOF
-if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_bigendian=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_bigendian=no
-fi
-rm -f conftest*
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-if test $ac_cv_c_bigendian = unknown; then
-if test "$cross_compiling" = yes; then
- echo $ac_n "cross-compiling... " 2>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1256 "configure"
-#include "confdefs.h"
-main () {
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long l;
- char c[sizeof (long)];
- } u;
- u.l = 1;
- exit (u.c[sizeof (long) - 1] == 1);
-}
-EOF
-if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_c_bigendian=no
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_bigendian=yes
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
-if test $ac_cv_c_bigendian = unknown; then
-echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:1287: checking to probe for byte ordering" >&5
-
-cat >conftest.c <<EOF
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
-int main() { _ascii (); _ebcdic (); return 0; }
-EOF
- if test -f conftest.c ; then
- if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
- if test `grep -l BIGenDianSyS conftest.o` ; then
- echo $ac_n ' big endian probe OK, ' 1>&6
- ac_cv_c_bigendian=yes
- fi
- if test `grep -l LiTTleEnDian conftest.o` ; then
- echo $ac_n ' little endian probe OK, ' 1>&6
- if test $ac_cv_c_bigendian = yes ; then
- ac_cv_c_bigendian=unknown;
- else
- ac_cv_c_bigendian=no
- fi
- fi
- echo $ac_n 'guessing bigendian ... ' >&6
- fi
- fi
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
-fi
-if test $ac_cv_c_bigendian = yes; then
- cat >> confdefs.h <<\EOF
-#define WORDS_BIGENDIAN 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define HOST_WORDS_BIG_ENDIAN 1
-EOF
-
- BYTEORDER=4321
-else
- BYTEORDER=1234
-fi
-cat >> confdefs.h <<EOF
-#define BYTEORDER $BYTEORDER
-EOF
-
-if test $ac_cv_c_bigendian = unknown; then
- { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
-fi
-
@@ -1352,7 +1216,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1356: checking for a BSD compatible install" >&5
+echo "configure:1220: 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
@@ -1413,7 +1277,7 @@ host_makefile_frag=${frag}
# able to link anything, it had better be able to at least compile
# something.
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1417: checking how to run the C preprocessor" >&5
+echo "configure:1281: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1428,13 +1292,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1432 "configure"
+#line 1296 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1302: \"$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
:
@@ -1445,13 +1309,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1449 "configure"
+#line 1313 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1319: \"$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
:
@@ -1462,13 +1326,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1466 "configure"
+#line 1330 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1336: \"$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
:
@@ -1496,17 +1360,17 @@ for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1500: checking for $ac_hdr" >&5
+echo "configure:1364: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1505 "configure"
+#line 1369 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1374: \"$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*
@@ -1533,12 +1397,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1406 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -1554,7 +1418,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -1575,12 +1439,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1584 "configure"
+#line 1448 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1589,7 +1453,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1611,19 +1475,19 @@ fi
echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
-echo "configure:1615: checking whether errno must be declared" >&5
+echo "configure:1479: checking whether errno must be declared" >&5
if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1620 "configure"
+#line 1484 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
int x = errno;
; return 0; }
EOF
-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libiberty_cv_declare_errno=no
else
@@ -1645,12 +1509,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1649: checking for ANSI C header files" >&5
+echo "configure:1513: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1654 "configure"
+#line 1518 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1658,7 +1522,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1526: \"$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*
@@ -1675,7 +1539,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1679 "configure"
+#line 1543 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1693,7 +1557,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1697 "configure"
+#line 1561 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1714,7 +1578,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
+#line 1582 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1725,7 +1589,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1749,12 +1613,12 @@ EOF
fi
echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
-echo "configure:1753: checking for uintptr_t" >&5
+echo "configure:1617: checking for uintptr_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
+#line 1622 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1790,12 +1654,12 @@ EOF
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1794: checking for pid_t" >&5
+echo "configure:1658: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1799 "configure"
+#line 1663 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1884,23 +1748,455 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
- getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
- memmove mempcpy memset putenv random rename rindex sigsetmask \
- strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
- strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \
- vsprintf waitpid getrusage on_exit psignal strerror strsignal \
- sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
- pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
- realpath canonicalize_file_name
+ for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1755: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1760 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1810: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1815 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in memmove mempcpy memset putenv random rename rindex sigsetmask
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1865: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1870 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1920: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1925 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1975: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1980 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2030: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2035 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in sysconf times sbrk gettimeofday ffs snprintf vsnprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2085: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2090 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2140: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2145 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in realpath canonicalize_file_name
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1899: checking for $ac_func" >&5
+echo "configure:2195: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1904 "configure"
+#line 2200 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1923,7 +2219,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2223: \"$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
@@ -2157,7 +2453,7 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2161: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2457: 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.
@@ -2168,12 +2464,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2172 "configure"
+#line 2468 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2473: \"$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
@@ -2199,19 +2495,19 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2499: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
for ac_func in $funcs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2210: checking for $ac_func" >&5
+echo "configure:2506: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2215 "configure"
+#line 2511 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2234,7 +2530,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2534: \"$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
@@ -2261,12 +2557,12 @@ done
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2265: checking whether alloca needs Cray hooks" >&5
+echo "configure:2561: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2270 "configure"
+#line 2566 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2291,12 +2587,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2295: checking for $ac_func" >&5
+echo "configure:2591: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2300 "configure"
+#line 2596 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2319,7 +2615,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2619: \"$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
@@ -2345,7 +2641,7 @@ fi
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2349: checking stack direction for C alloca" >&5
+echo "configure:2645: 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
@@ -2353,7 +2649,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2357 "configure"
+#line 2653 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2372,7 +2668,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2672: \"$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
@@ -2394,17 +2690,17 @@ EOF
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2398: checking for vfork.h" >&5
+echo "configure:2694: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2403 "configure"
+#line 2699 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2429,18 +2725,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2433: checking for working vfork" >&5
+echo "configure:2729: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2439: checking for vfork" >&5
+echo "configure:2735: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2444 "configure"
+#line 2740 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2463,7 +2759,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2485,7 +2781,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2489 "configure"
+#line 2785 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2580,7 +2876,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2612,12 +2908,12 @@ fi
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2616: checking for $ac_func" >&5
+echo "configure:2912: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2621 "configure"
+#line 2917 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2640,7 +2936,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2940: \"$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
@@ -2670,12 +2966,12 @@ done
for ac_func in _doprnt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2674: checking for $ac_func" >&5
+echo "configure:2970: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2679 "configure"
+#line 2975 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2698,7 +2994,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2998: \"$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
@@ -2726,19 +3022,19 @@ done
for v in $vars; do
echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2730: checking for $v" >&5
+echo "configure:3026: checking for $v" >&5
if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2735 "configure"
+#line 3031 "configure"
#include "confdefs.h"
int *p;
int main() {
extern int $v []; p = $v;
; return 0; }
EOF
-if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "libiberty_cv_var_$v=yes"
else
@@ -2764,12 +3060,12 @@ EOF
for ac_func in $checkfuncs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2768: checking for $ac_func" >&5
+echo "configure:3064: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2773 "configure"
+#line 3069 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2792,7 +3088,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3092: \"$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
@@ -2817,12 +3113,12 @@ fi
done
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:2821: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:3117: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2826 "configure"
+#line 3122 "configure"
#include "confdefs.h"
#include "confdefs.h"
@@ -2844,7 +3140,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libiberty_cv_decl_needed_canonicalize_file_name=no
else
@@ -2880,17 +3176,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:2884: checking for $ac_hdr" >&5
+echo "configure:3180: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2889 "configure"
+#line 3185 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3190: \"$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*
@@ -2919,12 +3215,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2923: checking for $ac_func" >&5
+echo "configure:3219: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2928 "configure"
+#line 3224 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2947,7 +3243,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3247: \"$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
@@ -2972,7 +3268,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2976: checking for working mmap" >&5
+echo "configure:3272: 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
@@ -2980,7 +3276,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2984 "configure"
+#line 3280 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3120,7 +3416,7 @@ main()
}
EOF
-if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3420: \"$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
@@ -3144,7 +3440,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3148: checking for working strncmp" >&5
+echo "configure:3444: checking for working strncmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3152,7 +3448,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3156 "configure"
+#line 3452 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3216,7 +3512,7 @@ main ()
}
EOF
-if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strncmp_works=yes
else
diff --git a/libiberty/configure.in b/libiberty/configure.in
index 4a704e8cec2..e142cf501c8 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -114,7 +114,6 @@ AC_SUBST(OUTPUT_OPTION)
AC_ISC_POSIX
AC_C_CONST
AC_C_INLINE
-AC_C_BIGENDIAN_CROSS
dnl When we start using libtool:
dnl Default to a non shared library. This may be overridden by the
@@ -218,15 +217,15 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
- getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
- memmove mempcpy memset putenv random rename rindex sigsetmask \
- strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
- strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \
- vsprintf waitpid getrusage on_exit psignal strerror strsignal \
- sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
- pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
- realpath canonicalize_file_name)
+ AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock)
+ AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy)
+ AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask)
+ AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr)
+ AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
+ AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
+ AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf)
+ AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl)
+ AC_CHECK_FUNCS(realpath canonicalize_file_name)
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 3896328717a..32067afb5b8 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -709,141 +709,3 @@ htab_hash_string (p)
return r;
}
-
-/* DERIVED FROM:
---------------------------------------------------------------------
-lookup2.c, by Bob Jenkins, December 1996, Public Domain.
-hash(), hash2(), hash3, and mix() are externally useful functions.
-Routines to test the hash are included if SELF_TEST is defined.
-You can use this free for any purpose. It has no warranty.
---------------------------------------------------------------------
-*/
-
-/*
---------------------------------------------------------------------
-mix -- mix 3 32-bit values reversibly.
-For every delta with one or two bit set, and the deltas of all three
- high bits or all three low bits, whether the original value of a,b,c
- is almost all zero or is uniformly distributed,
-* If mix() is run forward or backward, at least 32 bits in a,b,c
- have at least 1/4 probability of changing.
-* If mix() is run forward, every bit of c will change between 1/3 and
- 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
-mix() was built out of 36 single-cycle latency instructions in a
- structure that could supported 2x parallelism, like so:
- a -= b;
- a -= c; x = (c>>13);
- b -= c; a ^= x;
- b -= a; x = (a<<8);
- c -= a; b ^= x;
- c -= b; x = (b>>13);
- ...
- Unfortunately, superscalar Pentiums and Sparcs can't take advantage
- of that parallelism. They've also turned some of those single-cycle
- latency instructions into multi-cycle latency instructions. Still,
- this is the fastest good hash I could find. There were about 2^^68
- to choose from. I only looked at a billion or so.
---------------------------------------------------------------------
-*/
-/* same, but slower, works on systems that might have 8 byte hashval_t's */
-#define mix(a,b,c) \
-{ \
- a -= b; a -= c; a ^= (c>>13); \
- b -= c; b -= a; b ^= (a<< 8); \
- c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \
- a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \
- b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \
- c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \
- a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \
- b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \
- c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \
-}
-
-/*
---------------------------------------------------------------------
-hash() -- hash a variable-length key into a 32-bit value
- k : the key (the unaligned variable-length array of bytes)
- len : the length of the key, counting by bytes
- level : can be any 4-byte value
-Returns a 32-bit value. Every bit of the key affects every bit of
-the return value. Every 1-bit and 2-bit delta achieves avalanche.
-About 36+6len instructions.
-
-The best hash table sizes are powers of 2. There is no need to do
-mod a prime (mod is sooo slow!). If you need less than 32 bits,
-use a bitmask. For example, if you need only 10 bits, do
- h = (h & hashmask(10));
-In which case, the hash table should have hashsize(10) elements.
-
-If you are hashing n strings (ub1 **)k, do it like this:
- for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
-
-By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this
-code any way you wish, private, educational, or commercial. It's free.
-
-See http://burtleburtle.net/bob/hash/evahash.html
-Use for hash table lookup, or anything where one collision in 2^32 is
-acceptable. Do NOT use for cryptographic purposes.
---------------------------------------------------------------------
-*/
-
-hashval_t iterative_hash (k_in, length, initval)
- const PTR k_in; /* the key */
- register size_t length; /* the length of the key */
- register hashval_t initval; /* the previous hash, or an arbitrary value */
-{
- register const unsigned char *k = (const unsigned char *)k_in;
- register hashval_t a,b,c,len;
-
- /* Set up the internal state */
- len = length;
- a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
- c = initval; /* the previous hash value */
-
- /*---------------------------------------- handle most of the key */
-#ifndef WORDS_BIGENDIAN
- /* On a little-endian machine, if the data is 4-byte aligned we can hash
- by word for better speed. This gives nondeterministic results on
- big-endian machines. */
- if (sizeof (hashval_t) == 4 && (((size_t)k)&3) == 0)
- while (len >= 12) /* aligned */
- {
- a += *(hashval_t *)(k+0);
- b += *(hashval_t *)(k+4);
- c += *(hashval_t *)(k+8);
- mix(a,b,c);
- k += 12; len -= 12;
- }
- else /* unaligned */
-#endif
- while (len >= 12)
- {
- a += (k[0] +((hashval_t)k[1]<<8) +((hashval_t)k[2]<<16) +((hashval_t)k[3]<<24));
- b += (k[4] +((hashval_t)k[5]<<8) +((hashval_t)k[6]<<16) +((hashval_t)k[7]<<24));
- c += (k[8] +((hashval_t)k[9]<<8) +((hashval_t)k[10]<<16)+((hashval_t)k[11]<<24));
- mix(a,b,c);
- k += 12; len -= 12;
- }
-
- /*------------------------------------- handle the last 11 bytes */
- c += length;
- switch(len) /* all the case statements fall through */
- {
- case 11: c+=((hashval_t)k[10]<<24);
- case 10: c+=((hashval_t)k[9]<<16);
- case 9 : c+=((hashval_t)k[8]<<8);
- /* the first byte of c is reserved for the length */
- case 8 : b+=((hashval_t)k[7]<<24);
- case 7 : b+=((hashval_t)k[6]<<16);
- case 6 : b+=((hashval_t)k[5]<<8);
- case 5 : b+=k[4];
- case 4 : a+=((hashval_t)k[3]<<24);
- case 3 : a+=((hashval_t)k[2]<<16);
- case 2 : a+=((hashval_t)k[1]<<8);
- case 1 : a+=k[0];
- /* case 0: nothing left to add */
- }
- mix(a,b,c);
- /*-------------------------------------------- report the result */
- return c;
-}
diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c
index fc98db167f3..6f90fde05fb 100644
--- a/libiberty/splay-tree.c
+++ b/libiberty/splay-tree.c
@@ -472,7 +472,7 @@ splay_tree_predecessor (sp, key)
if (comparison < 0)
return sp->root;
- /* Otherwise, find the rightmost element of the left subtree. */
+ /* Otherwise, find the leftmost element of the right subtree. */
node = sp->root->left;
if (node)
while (node->right)
@@ -505,7 +505,7 @@ splay_tree_successor (sp, key)
if (comparison > 0)
return sp->root;
- /* Otherwise, find the leftmost element of the right subtree. */
+ /* Otherwise, find the rightmost element of the left subtree. */
node = sp->root->right;
if (node)
while (node->left)
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 97ae91eb3d0..e0eef4fe9b0 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,8 +1,3 @@
-2003-05-09 Alan Modra <amodra@bigpond.net.au>
-
- * i386-dis.c (print_insn): Test intel_syntax against (char) -1 in
- case char is unsigned.
-
2003-05-01 Christian Groessler <chris@groessler.org>
* z8k-dis.c (z8k_lookup_instr): Optimize FETCH_DATA calls.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index be78e83fef1..79faee676e5 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -1891,7 +1891,7 @@ print_insn (pc, info)
mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax
|| info->mach == bfd_mach_x86_64);
- if (intel_syntax == (char) -1)
+ if (intel_syntax == -1)
intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
|| info->mach == bfd_mach_x86_64_intel_syntax);
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index 3256284ad41..54d84e6b028 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,15 +1,3 @@
-2003-05-07 Andrew Cagney <cagney@redhat.com>
-
- * interp.c (sim_d10v_translate_addr): Add "regcache" parameter.
- (sim_d10v_translate_imap_addr): Ditto.
- (sim_d10v_translate_dmap_addr): Ditto.
- (xfer_mem): Pass NULL regcache to sim_d10v_translate_addr.
- (dmem_addr): Pass NULL regcache to sim_d10v_translate_dmap_addr.
- (dmap_register, imap_register): Add "regcache" parameter.
- (imem_addr): Pass NULL regcache to sim_d10v_translate_imap_addr.
- (sim_fetch_register): Pass NULL regcache to imap_register and
- dmap_register.
-
2003-02-27 Andrew Cagney <cagney@redhat.com>
* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 30239ab0247..718acca9936 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -363,7 +363,7 @@ set_dmap_register (int reg_nr, unsigned long value)
}
static unsigned long
-dmap_register (void *regcache, int reg_nr)
+dmap_register (int reg_nr)
{
uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA
+ DMAP0_OFFSET + 2 * reg_nr);
@@ -386,7 +386,7 @@ set_imap_register (int reg_nr, unsigned long value)
}
static unsigned long
-imap_register (void *regcache, int reg_nr)
+imap_register (int reg_nr)
{
uint8 *raw = map_memory (SIM_D10V_MEMORY_DATA
+ IMAP0_OFFSET + 2 * reg_nr);
@@ -440,9 +440,7 @@ unsigned long
sim_d10v_translate_dmap_addr (unsigned long offset,
int nr_bytes,
unsigned long *phys,
- void *regcache,
- unsigned long (*dmap_register) (void *regcache,
- int reg_nr))
+ unsigned long (*dmap_register) (int reg_nr))
{
short map;
int regno;
@@ -459,7 +457,7 @@ sim_d10v_translate_dmap_addr (unsigned long offset,
/* Don't cross a BLOCK boundary */
nr_bytes = DMAP_BLOCK_SIZE - (offset % DMAP_BLOCK_SIZE);
}
- map = dmap_register (regcache, regno);
+ map = dmap_register (regno);
if (regno == 3)
{
/* Always maps to data memory */
@@ -500,9 +498,7 @@ unsigned long
sim_d10v_translate_imap_addr (unsigned long offset,
int nr_bytes,
unsigned long *phys,
- void *regcache,
- unsigned long (*imap_register) (void *regcache,
- int reg_nr))
+ unsigned long (*imap_register) (int reg_nr))
{
short map;
int regno;
@@ -521,7 +517,7 @@ sim_d10v_translate_imap_addr (unsigned long offset,
/* Don't cross a BLOCK boundary */
nr_bytes = IMAP_BLOCK_SIZE - offset;
}
- map = imap_register (regcache, regno);
+ map = imap_register (regno);
sp = (map & 0x3000) >> 12;
segno = (map & 0x007f);
switch (sp)
@@ -553,11 +549,8 @@ unsigned long
sim_d10v_translate_addr (unsigned long memaddr,
int nr_bytes,
unsigned long *targ_addr,
- void *regcache,
- unsigned long (*dmap_register) (void *regcache,
- int reg_nr),
- unsigned long (*imap_register) (void *regcache,
- int reg_nr))
+ unsigned long (*dmap_register) (int reg_nr),
+ unsigned long (*imap_register) (int reg_nr))
{
unsigned long phys;
unsigned long seg;
@@ -621,12 +614,12 @@ sim_d10v_translate_addr (unsigned long memaddr,
break;
case 0x10: /* in logical data address segment */
- nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys, regcache,
+ nr_bytes = sim_d10v_translate_dmap_addr (off, nr_bytes, &phys,
dmap_register);
break;
case 0x11: /* in logical instruction address segment */
- nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys, regcache,
+ nr_bytes = sim_d10v_translate_imap_addr (off, nr_bytes, &phys,
imap_register);
break;
@@ -727,8 +720,10 @@ xfer_mem (SIM_ADDR virt,
uint8 *memory;
unsigned long phys;
int phys_size;
- phys_size = sim_d10v_translate_addr (virt, size, &phys, NULL,
- dmap_register, imap_register);
+ phys_size = sim_d10v_translate_addr (virt, size,
+ &phys,
+ dmap_register,
+ imap_register);
if (phys_size == 0)
return xfered;
@@ -897,7 +892,7 @@ dmem_addr (uint16 offset)
things like ``0xfffe + 0x0e60 == 0x10e5d''. Since offset's type
is uint16 this is modulo'ed onto 0x0e5d. */
- phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys, NULL,
+ phys_size = sim_d10v_translate_dmap_addr (offset, 1, &phys,
dmap_register);
if (phys_size == 0)
{
@@ -924,8 +919,7 @@ imem_addr (uint32 offset)
{
unsigned long phys;
uint8 *mem;
- int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, NULL,
- imap_register);
+ int phys_size = sim_d10v_translate_imap_addr (offset, 1, &phys, imap_register);
if (phys_size == 0)
{
return State.mem.fault;
@@ -1373,14 +1367,14 @@ sim_fetch_register (sd, rn, memory, length)
break;
case SIM_D10V_IMAP0_REGNUM:
case SIM_D10V_IMAP1_REGNUM:
- WRITE_16 (memory, imap_register (NULL, rn - SIM_D10V_IMAP0_REGNUM));
+ WRITE_16 (memory, imap_register (rn - SIM_D10V_IMAP0_REGNUM));
size = 2;
break;
case SIM_D10V_DMAP0_REGNUM:
case SIM_D10V_DMAP1_REGNUM:
case SIM_D10V_DMAP2_REGNUM:
case SIM_D10V_DMAP3_REGNUM:
- WRITE_16 (memory, dmap_register (NULL, rn - SIM_D10V_DMAP0_REGNUM));
+ WRITE_16 (memory, dmap_register (rn - SIM_D10V_DMAP0_REGNUM));
size = 2;
break;
case SIM_D10V_TS2_DMAP_REGNUM: