diff options
author | nobody <> | 2003-04-06 14:50:16 +0000 |
---|---|---|
committer | nobody <> | 2003-04-06 14:50:16 +0000 |
commit | bad7deeefd1fa35f148ce755f6ee1e00c3c0d05e (patch) | |
tree | f9bc25c254c715345304fd1bf9568103817a20ae /bfd | |
parent | 56119ffba54ea99aed55aed353725346558b2696 (diff) | |
download | fsf-binutils-gdb-kettenis_i386newframe-20030406-branch.zip fsf-binutils-gdb-kettenis_i386newframe-20030406-branch.tar.gz fsf-binutils-gdb-kettenis_i386newframe-20030406-branch.tar.bz2 |
This commit was manufactured by cvs2svn to create branchkettenis_i386newframe-20030406-branchpointkettenis_i386newframe-20030406-branch
'kettenis_i386newframe-20030406-branch'.
Sprout from cagney_frameaddr-20030403-branch 2003-04-03 16:34:49 UTC nobody 'This commit was manufactured by cvs2svn to create branch'
Cherrypick from master 2003-04-06 14:50:15 UTC Andrew Cagney <cagney@redhat.com> '2003-04-06 Andrew Cagney <cagney@redhat.com>':
bfd/ChangeLog
bfd/archures.c
bfd/bfd-in2.h
bfd/coff-tic4x.c
bfd/cpu-tic4x.c
bfd/elf32-m68hc11.c
bfd/simple.c
bfd/version.h
gdb/ChangeLog
gdb/Makefile.in
gdb/arm-tdep.c
gdb/blockframe.c
gdb/config/i386/tm-ptx.h
gdb/config/pa/tm-hppa.h
gdb/config/pa/tm-hppa64.h
gdb/config/pa/tm-hppah.h
gdb/config/sparc/tm-sparc.h
gdb/cris-tdep.c
gdb/d10v-tdep.c
gdb/dummy-frame.c
gdb/frame-unwind.h
gdb/frame.c
gdb/frame.h
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/hppa-hpux-tdep.c
gdb/hppa-tdep.c
gdb/i386-tdep.c
gdb/ia64-tdep.c
gdb/m68k-tdep.c
gdb/objc-lang.c
gdb/remote-vxsparc.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sentinel-frame.c
gdb/sh-tdep.c
gdb/sparc-tdep.c
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/break.exp
gdb/valprint.c
gdb/version.in
gdb/x86-64-tdep.c
include/ChangeLog
include/coff/tic4x.h
include/opcode/tic4x.h
opcodes/ChangeLog
opcodes/tic4x-dis.c
sim/v850/ChangeLog
sim/v850/simops.c
sim/v850/simops.h
sim/v850/v850.igen
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 24 | ||||
-rw-r--r-- | bfd/archures.c | 4 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 4 | ||||
-rw-r--r-- | bfd/coff-tic4x.c | 15 | ||||
-rw-r--r-- | bfd/cpu-tic4x.c | 22 | ||||
-rw-r--r-- | bfd/elf32-m68hc11.c | 46 | ||||
-rw-r--r-- | bfd/simple.c | 11 | ||||
-rw-r--r-- | bfd/version.h | 2 |
8 files changed, 86 insertions, 42 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 809e9f7..1264aa3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,27 @@ +2003-04-06 Andrew Cagney <cagney@redhat.com> + + * simple.c (bfd_simple_get_relocated_section_contents): Disable + free that leads to GDB vs BFD memory corruption. + +2003-04-04 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust + symbols that mark the end of the section. + (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when + converting to a relative branch so that the offset is computed after + the relaxation; also relocate a jsr into a bsr if possible but don't + relax them if they are to a far symbol as we need to call the + trampoline code. + (elf_m68hc11_howto_table): Set pcrel_offset to true. + +2003-04-04 Svein E. Seldal <Svein.Seldal@solidas.com> + + * archures.c: Namespace cleanup. Rename bfd_mach_c3x to + bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x + * bfd-in2.h: Regenerate + * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/ + * cpu-tic4x.c: Ditto + 2003-04-03 Nick Clifton <nickc@redhat.com> * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss diff --git a/bfd/archures.c b/bfd/archures.c index 9337fb1..efed993 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -241,8 +241,8 @@ DESCRIPTION . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} . bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X *} -.#define bfd_mach_c3x 30 -.#define bfd_mach_c4x 40 +.#define bfd_mach_tic3x 30 +.#define bfd_mach_tic4x 40 . bfd_arch_tic54x, {* Texas Instruments TMS320C54X *} . bfd_arch_tic80, {* TI TMS320c80 (MVP) *} . bfd_arch_v850, {* NEC V850 *} diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index a5ff0c0..749e6aa 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1707,8 +1707,8 @@ enum bfd_architecture bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ -#define bfd_mach_c3x 30 -#define bfd_mach_c4x 40 +#define bfd_mach_tic3x 30 +#define bfd_mach_tic4x 40 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ bfd_arch_tic80, /* TI TMS320c80 (MVP) */ bfd_arch_v850, /* NEC V850 */ diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 3062b9f..5c8de41 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -1,6 +1,7 @@ /* BFD back-end for TMS320C4X coff binaries. - Copyright 1996, 1997, 1998, 1999, 2000, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) This file is part of BFD, the Binary File Descriptor library. @@ -365,7 +366,7 @@ static const bfd_coff_backend_data ticoff1_swap_table = /* TI COFF v0, DOS tools (little-endian headers). */ const bfd_target tic4x_coff0_vec = { - "coff0-c4x", /* Name. */ + "coff0-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ @@ -409,7 +410,7 @@ const bfd_target tic4x_coff0_vec = /* TI COFF v0, SPARC tools (big-endian headers). */ const bfd_target tic4x_coff0_beh_vec = { - "coff0-beh-c4x", /* Name. */ + "coff0-beh-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_BIG, /* Header byte order is big. */ @@ -454,7 +455,7 @@ const bfd_target tic4x_coff0_beh_vec = /* TI COFF v1, DOS tools (little-endian headers). */ const bfd_target tic4x_coff1_vec = { - "coff1-c4x", /* Name. */ + "coff1-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ @@ -499,7 +500,7 @@ const bfd_target tic4x_coff1_vec = /* TI COFF v1, SPARC tools (big-endian headers). */ const bfd_target tic4x_coff1_beh_vec = { - "coff1-beh-c4x", /* Name. */ + "coff1-beh-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_BIG, /* Header byte order is big. */ @@ -544,7 +545,7 @@ const bfd_target tic4x_coff1_beh_vec = /* TI COFF v2, TI DOS tools output (little-endian headers). */ const bfd_target tic4x_coff2_vec = { - "coff2-c4x", /* Name. */ + "coff2-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little (DOS tools). */ @@ -589,7 +590,7 @@ const bfd_target tic4x_coff2_vec = /* TI COFF v2, TI SPARC tools output (big-endian headers). */ const bfd_target tic4x_coff2_beh_vec = { - "coff2-beh-c4x", /* Name. */ + "coff2-beh-tic4x", /* Name. */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_BIG, /* Header byte order is big. */ diff --git a/bfd/cpu-tic4x.c b/bfd/cpu-tic4x.c index 2260f70..a7f40e1 100644 --- a/bfd/cpu-tic4x.c +++ b/bfd/cpu-tic4x.c @@ -1,5 +1,5 @@ /* bfd back-end for TMS320C[34]x support - Copyright 1996, 1997, 2002 Free Software Foundation, Inc. + Copyright 1996, 1997, 2002, 2003 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) @@ -23,12 +23,12 @@ #include "sysdep.h" #include "libbfd.h" -static bfd_boolean c4x_scan +static bfd_boolean tic4x_scan PARAMS ((const struct bfd_arch_info *, const char * )); static bfd_boolean -c4x_scan (info, string) +tic4x_scan (info, string) const struct bfd_arch_info *info; const char *string; { @@ -42,9 +42,9 @@ c4x_scan (info, string) return FALSE; if (*string == '3') - return (info->mach == bfd_mach_c3x); + return (info->mach == bfd_mach_tic3x); else if (*string == '4') - return info->mach == bfd_mach_c4x; + return info->mach == bfd_mach_tic4x; return FALSE; } @@ -56,13 +56,13 @@ const bfd_arch_info_type bfd_tic3x_arch = 32, /* 32 bits in an address. */ 32, /* 32 bits in a byte. */ bfd_arch_tic4x, - bfd_mach_c3x, /* Machine number. */ - "c3x", /* Architecture name. */ + bfd_mach_tic3x, /* Machine number. */ + "tic3x", /* Architecture name. */ "tms320c3x", /* Printable name. */ 0, /* Alignment power. */ FALSE, /* Not the default architecture. */ bfd_default_compatible, - c4x_scan, + tic4x_scan, 0 }; @@ -72,13 +72,13 @@ const bfd_arch_info_type bfd_tic4x_arch = 32, /* 32 bits in an address. */ 32, /* 32 bits in a byte. */ bfd_arch_tic4x, - bfd_mach_c4x, /* Machine number. */ - "c4x", /* Architecture name. */ + bfd_mach_tic4x, /* Machine number. */ + "tic4x", /* Architecture name. */ "tms320c4x", /* Printable name. */ 0, /* Alignment power. */ TRUE, /* The default architecture. */ bfd_default_compatible, - c4x_scan, + tic4x_scan, &bfd_tic3x_arch, }; diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 98ea6a6..26fa393 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,5 +1,5 @@ /* Motorola 68HC11-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -143,7 +143,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { FALSE, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 16 bit absolute relocation */ HOWTO (R_M68HC11_16, /* type */ @@ -204,7 +204,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* GNU extension to record C++ vtable hierarchy */ HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */ @@ -247,8 +247,8 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_24", /* name */ FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A 16-bit low relocation */ @@ -445,6 +445,9 @@ elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) return TRUE; } + +/* 68HC11 Linker Relaxation. */ + struct m68hc11_direct_relax { const char *name; @@ -694,6 +697,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) bfd_vma value; Elf_Internal_Sym *isym; asection *sym_sec; + int is_far = 0; /* If this isn't something that can be relaxed, then ignore this reloc. */ @@ -747,7 +751,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) prev_insn_group = 0; /* Do nothing if this reloc is the last byte in the section. */ - if (irel->r_offset == sec->_cooked_size) + if (irel->r_offset + 2 >= sec->_cooked_size) continue; /* See if the next instruction is an unconditional pc-relative @@ -793,6 +797,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) { /* A local symbol. */ isym = isymbuf + ELF32_R_SYM (irel->r_info); + is_far = isym->st_other & STO_M68HC12_FAR; sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); symval = (isym->st_value + sym_sec->output_section->vma @@ -818,6 +823,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) continue; } + is_far = h->other & STO_M68HC12_FAR; isym = 0; sym_sec = h->root.u.def.section; symval = (h->root.u.def.value @@ -891,23 +897,25 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) { code = 0x20; bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); - bfd_put_8 (abfd, offset, + bfd_put_8 (abfd, 0xff, contents + prev_insn_branch->r_offset + 1); + irel->r_offset = prev_insn_branch->r_offset + 1; irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_M68HC11_NONE); + R_M68HC11_PCREL_8); m68hc11_elf_relax_delete_bytes (abfd, sec, - irel->r_offset, 1); + irel->r_offset + 1, 1); } else { code ^= 0x1; bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); - bfd_put_8 (abfd, offset, + bfd_put_8 (abfd, 0xff, contents + prev_insn_branch->r_offset + 1); + irel->r_offset = prev_insn_branch->r_offset + 1; irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_M68HC11_NONE); + R_M68HC11_PCREL_8); m68hc11_elf_relax_delete_bytes (abfd, sec, - irel->r_offset - 1, 3); + irel->r_offset + 1, 3); } prev_insn_branch = 0; *again = TRUE; @@ -991,14 +999,14 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) /* That will change things, so, we should relax again. */ *again = TRUE; } - else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16) + else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16 && !is_far) { unsigned char code; bfd_vma offset; prev_insn_branch = 0; code = bfd_get_8 (abfd, contents + irel->r_offset - 1); - if (code == 0x7e) + if (code == 0x7e || code == 0xbd) { offset = value - (irel->r_offset + sec->output_section->vma @@ -1021,13 +1029,13 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) free_extsyms = NULL; /* Shrink the branch. */ - code = 0x20; + code = (code == 0x7e) ? 0x20 : 0x8d; bfd_put_8 (abfd, code, contents + irel->r_offset - 1); - bfd_put_8 (abfd, offset, + bfd_put_8 (abfd, 0xff, contents + irel->r_offset); irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_M68HC11_NONE); + R_M68HC11_PCREL_8); m68hc11_elf_relax_delete_bytes (abfd, sec, irel->r_offset + 1, 1); /* That will change things, so, we should relax again. */ @@ -1220,7 +1228,7 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count) { if (isym->st_shndx == sec_shndx && isym->st_value > addr - && isym->st_value < toaddr) + && isym->st_value <= toaddr) isym->st_value -= count; } @@ -1236,7 +1244,7 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count) || sym_hash->root.type == bfd_link_hash_defweak) && sym_hash->root.u.def.section == sec && sym_hash->root.u.def.value > addr - && sym_hash->root.u.def.value < toaddr) + && sym_hash->root.u.def.value <= toaddr) { sym_hash->root.u.def.value -= count; } diff --git a/bfd/simple.c b/bfd/simple.c index a91d118..a247f11 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -261,8 +261,19 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf, symbol_table) if (contents == NULL && data != NULL) free (data); +#if 0 + /* NOTE: cagney/2003-04-05: This free, which was introduced on + 2003-03-31 to stop a memory leak, caused a memory corruption + between GDB and BFD. The problem, which is stabs specific, can + be identified by a bunch of failures in relocate.exp vis: + + gdb.base/relocate.exp: get address of static_bar + + Details of the problem can be found on the binutils@ mailing + list, see the discussion thread: "gdb.mi/mi-cli.exp failures". */ if (storage_needed != 0) free (symbol_table); +#endif bfd_map_over_sections (abfd, simple_restore_output_info, saved_offsets); free (saved_offsets); diff --git a/bfd/version.h b/bfd/version.h index bd19d02..0afe6a6 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20030403 +#define BFD_VERSION_DATE 20030406 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ |