+2008-07-18 Danny Backx <dannybackx@users.sourceforge.net>
+
+ * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
+ print compressed pdata structure as described on MSDN. This only
+ applies to a limited set of architectures (ARM, SH4).
+ (slurp_symtab, my_symbol_for_address): Define static helper
+ functions for pe_print_compressed_pdata.
+ * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
+ (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
+ * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
+ bfd_coff_backend_data, call the function if non-null.
+ * pei-mcore.c: Add target dependent initialisation for
+ bfd_coff_backend_data.
+ * coff-sh.c: Likewise.
+ * coff64-rs6000.c: Likewise.
+ * coff-rs6000.c: Likewise.
+ * libcoff-in.h: Likewise.
+ * cf-i386lynx.c: Likewise.
+ * coff-alpha.c: Likewise.
+ * coff-apollo.c: Likewise.
+ * coff-arm.c: Likewise.
+ * coff-aux.c: Likewise.
+ * coff-h8300.c: Likewise.
+ * coff-h8500.c: Likewise.
+ * coff-i386.c: Likewise.
+ * coff-i860.c: Likewise.
+ * coff-i960.c: Likewise.
+ * coff-ia64.c: Likewise.
+ * coff-m68k.c: Likewise.
+ * coff-m88k.c: Likewise.
+ * coff-maxq.c: Likewise.
+ * coff-mips.c: Likewise.
+ * coff-or32.c: Likewise.
+ * coff-sparc.c: Likewise.
+ * coff-tic30.c: Likewise.
+ * coff-tic4x.c: Likewise.
+ * coff-tic54x.c: Likewise.
+ * coff-tic80.c: Likewise.
+ * coff-w65.c: Likewise.
+ * coff-we32k.c: Likewise.
+ * coff-x86_64.c: Likewise.
+ * coff-z80.c: Likewise.
+ * coff-z8k.c: Likewise.
+ * pe-mcore.c: Likewise.
+ * pe-mips.c: Likewise.
+ * pe-ppc.c: Likewise.
+ * peXXigen.c: Likewise.
+ * pei-ppc.c: Likewise.
+ * libcoff.h: Regenerate.
+
2008-07-16 Bernd Schmidt <bernd.schmidt@analog.com>
* elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
/* BFD back-end for Intel 386 COFF LynxOS files.
- Copyright 1993, 1994, 1995, 2007 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 2007, 2008 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#define COFF_LONG_FILENAMES
+#define bfd_pe_print_pdata NULL
+
#include "coff-i386.c"
alpha_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL
+ NULL, NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_alpha,
/* BFD back-end for Apollo 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
By Troy Rollo (troy@cbme.unsw.edu.au)
Based on m68k standard COFF version Written by Cygnus Support.
#define SELECT_RELOC(external, internal) \
external.r_type = apollo_howto2rtype (internal);
+#define bfd_pe_print_pdata NULL
+
#include "coffcode.h"
#ifndef TARGET_SYM
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Written by Cygnus Support.
return bfd_arm_update_notes (abfd, ARM_NOTE_SECTION);
}
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#ifndef TARGET_LITTLE_SYM
/* BFD back-end for Apple M68K COFF A/UX 3.x files.
- Copyright 1996, 1997, 2000, 2002, 2007 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 2000, 2002, 2007, 2008
+ Free Software Foundation, Inc.
Written by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
#define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coff/aux-coff.h" /* override coff/internal.h and coff/m68k.h */
#include "coff-m68k.c"
#define coff_bfd_link_hash_table_create h8300_coff_link_hash_table_create
#define COFF_LONG_FILENAMES
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_bfd_get_relocated_section_contents
/* BFD back-end for Renesas H8/500 COFF binaries.
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007 Free Software Foundation, Inc.
+ 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
#define coff_reloc16_extra_cases extra_case
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_bfd_get_relocated_section_contents
/* BFD back-end for Intel 386 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2007
+ 2000, 2001, 2002, 2003, 2004, 2007, 2008
Free Software Foundation, Inc.
Written by Cygnus Support.
#include "coff/go32exe.h"
#endif
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "libcoff.h"
static bfd_reloc_status_type coff_i386_reloc
/* BFD back-end for Intel i860 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
#include "coff/internal.h"
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "libcoff.h"
/* BFD back-end for Intel 960 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
- 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "libbfd.h"
#include "coff/i960.h"
#include "coff/internal.h"
-#include "libcoff.h" /* to allow easier abstraction-breaking */
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
+#include "libcoff.h" /* To allow easier abstraction-breaking. */
static bfd_boolean coff_i960_is_local_label_name
PARAMS ((bfd *, const char *));
/* BFD back-end for HP/Intel IA-64 COFF files.
- Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
}
#endif
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
static const bfd_target *ia64coff_object_p PARAMS ((bfd *));
/* BFD back-end for Motorola 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
- 2000, 2001, 2002, 2003, 2005, 2007
+ 2000, 2001, 2002, 2003, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Cygnus Support.
#define coff_relocate_section _bfd_coff_generic_relocate_section
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#ifndef TARGET_SYM
/* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
}
#define BADMAG(x) MC88BADMAG(x)
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_write_armap
/* BFD back-end for MAXQ COFF binaries.
- Copyright 2004, 2007 Free Software Foundation, Inc.
+ Copyright 2004, 2007, 2008 Free Software Foundation, Inc.
Contributed by Vineet Sharma (vineets@noida.hcltech.com) Inderpreet S.
(inderpreetb@noida.hcltech.com)
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
cache_ptr->addend = ext_reloc.r_offset;
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#ifndef TARGET_UNDERSCORE
#define coff_swap_aouthdr_out mips_ecoff_swap_aouthdr_out
#define coff_swap_scnhdr_in mips_ecoff_swap_scnhdr_in
#define coff_swap_scnhdr_out mips_ecoff_swap_scnhdr_out
+
#include "coffswap.h"
/* Get the ECOFF swapping routines. */
_bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL
+ NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_mips,
/* BFD back-end for OpenRISC 1000 COFF binaries.
- Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Ivan Guzvinec <ivang@opencores.org>
This file is part of BFD, the Binary File Descriptor library.
#define coff_adjust_symndx coff_or32_adjust_symndx
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
const bfd_target or32coff_big_vec =
/* BFD back-end for IBM RS/6000 "XCOFF" files.
- Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008 Free Software Foundation, Inc.
Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore.
Archive support from Damon A. Permezel.
Contributed by IBM Corporation and Cygnus Support.
#define coff_swap_reloc_out xcoff_swap_reloc_out
#define NO_COFF_RELOCS
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
/* The main body of code is in coffcode.h. */
NULL, /* _bfd_coff_adjust_symndx */
_bfd_generic_link_add_one_symbol,
coff_link_output_has_begun,
- coff_final_link_postscript
+ coff_final_link_postscript,
+ NULL /* print_pdata. */
},
0x01DF, /* magic number */
NULL, /* _bfd_coff_adjust_symndx */
_bfd_generic_link_add_one_symbol,
coff_link_output_has_begun,
- coff_final_link_postscript
+ coff_final_link_postscript,
+ NULL /* print_pdata. */
},
0x01DF, /* magic number */
/* BFD back-end for Renesas Super-H COFF binaries.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
#endif
#endif
+#undef bfd_pe_print_pdata
+#define bfd_pe_print_pdata pe_print_ce_compressed_pdata
+extern bfd_boolean pe_print_ce_compressed_pdata (bfd *, void *);
+
#include "libcoff.h"
/* Internal functions. */
coff_classify_symbol, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
+ coff_link_output_has_begun, coff_final_link_postscript,
+ bfd_pe_print_pdata
};
#define coff_small_close_and_cleanup \
/* BFD back-end for Sparc COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#define COFF_SPARC
+#define bfd_pe_print_pdata NULL
+
#include "coffcode.h"
#ifndef TARGET_SYM
/* BFD back-end for TMS320C30 coff binaries.
- Copyright 1998, 1999, 2000, 2001, 2002, 2007
+ Copyright 1998, 1999, 2000, 2001, 2002, 2007, 2008
Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
relent->address -= section->vma;
}
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
const bfd_target tic30_coff_vec =
/* BFD back-end for TMS320C4X coff binaries.
- Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007,
+ 2008 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
instead of setting BADMAG. */
#define BADMAG(x) COFF2_BADMAG(x)
-#undef coff_rtype_to_howto
-#define coff_rtype_to_howto coff_tic4x_rtype_to_howto
+#undef coff_rtype_to_howto
+#define coff_rtype_to_howto coff_tic4x_rtype_to_howto
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
#include "coffcode.h"
/* BFD back-end for TMS320C54X coff binaries.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by Timothy Wall (twall@cygnus.com)
and COFF0 vectors use custom _bad_format_hook procs instead of setting
BADMAG. */
#define BADMAG(x) COFF2_BADMAG(x)
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
static bfd_boolean
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
- Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com)
#define TIC80COFF 1 /* Customize coffcode.h */
#undef C_AUTOARG /* Clashes with TIc80's C_UEXT */
#undef C_LASTENT /* Clashes with TIc80's C_STATLAB */
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
CREATE_LITTLE_COFF_TARGET_VEC (tic80coff_vec, "coff-tic80", D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE)
/* BFD back-end for WDC 65816 COFF binaries.
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
#define coff_reloc16_extra_cases w65_reloc16_extra_cases
#define coff_reloc16_estimate w65_reloc16_estimate
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_bfd_get_relocated_section_contents
/* BFD back-end for we32k COFF files.
- Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003, 2007
+ Copyright 1992, 1993, 1994, 1999, 2000, 2002, 2003, 2007, 2008
Free Software Foundation, Inc.
Contributed by Brendan Kehoe (brendan@cs.widener.edu).
#define RTYPE2HOWTO(cache_ptr, dst) \
(cache_ptr)->howto = howto_table + (dst)->r_type;
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#define coff_write_armap bsd_write_armap
/* BFD back-end for AMD 64 COFF files.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#endif /* TARGET_UNDERSCORE */
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#ifdef PE
/* BFD back-end for Zilog Z80 COFF binaries.
- Copyright 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Arnold Metselaar <arnold_m@operamail.com>
This file is part of BFD, the Binary File Descriptor library.
#define coff_bfd_reloc_type_lookup coff_z80_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_z80_reloc_name_lookup
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_bfd_get_relocated_section_contents
/* BFD back-end for Zilog Z800n COFF binaries.
Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
#define coff_bfd_reloc_type_lookup coff_z8k_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_z8k_reloc_name_lookup
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
#undef coff_bfd_get_relocated_section_contents
/* BFD back-end for IBM RS/6000 "XCOFF64" files.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Written Clinton Popetz.
Contributed by Cygnus Support.
#define coff_swap_reloc_out xcoff64_swap_reloc_out
#define NO_COFF_RELOCS
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
/* For XCOFF64, the effective width of symndx changes depending on
NULL, /* _bfd_coff_adjust_symndx */
_bfd_generic_link_add_one_symbol,
coff_link_output_has_begun,
- coff_final_link_postscript
+ coff_final_link_postscript,
+ NULL /* print_pdata. */
},
0x01EF, /* magic number */
NULL, /* _bfd_coff_adjust_symndx */
_bfd_generic_link_add_one_symbol,
coff_link_output_has_begun,
- coff_final_link_postscript
+ coff_final_link_postscript,
+ NULL /* print_pdata. */
},
U64_TOCMAGIC, /* magic number */
/* Support for the generic parts of most COFF variants, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Written by Cygnus Support.
. bfd_boolean (*_bfd_coff_final_link_postscript)
. (bfd *, struct coff_final_link_info *);
.
+. bfd_boolean (*_bfd_coff_print_pdata)
+. (bfd *, void *);
+.
.} bfd_coff_backend_data;
.
.#define coff_backend_info(abfd) \
.#define bfd_coff_final_link_postscript(a,p) \
. ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p))
.
+.#define bfd_coff_have_print_pdata(a) \
+. (coff_backend_info (a)->_bfd_coff_print_pdata)
+.#define bfd_coff_print_pdata(a,p) \
+. ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p))
+.
*/
/* See whether the magic number matches. */
coff_classify_symbol, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
+ coff_link_output_has_begun, coff_final_link_postscript,
+ bfd_pe_print_pdata
};
#ifdef TICOFF
coff_classify_symbol, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
+ coff_link_output_has_begun, coff_final_link_postscript,
+ bfd_pe_print_pdata
};
#endif
coff_classify_symbol, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
coff_adjust_symndx, coff_link_add_one_symbol,
- coff_link_output_has_begun, coff_final_link_postscript
+ coff_link_output_has_begun, coff_final_link_postscript,
+ bfd_pe_print_pdata /* huh */
};
#endif
/* BFD COFF object file private structure.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_boolean (*_bfd_coff_final_link_postscript)
(bfd *, struct coff_final_link_info *);
+ bfd_boolean (*_bfd_coff_print_pdata)
+ (bfd *, void *);
+
} bfd_coff_backend_data;
#define coff_backend_info(abfd) \
#define bfd_coff_final_link_postscript(a,p) \
((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p))
+#define bfd_coff_have_print_pdata(a) \
+ (coff_backend_info (a)->_bfd_coff_print_pdata)
+#define bfd_coff_print_pdata(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p))
+
/* BFD back-end for ARM WINCE PE files.
- Copyright 2006, 2007 Free Software Foundation, Inc.
+ Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define LOCAL_LABEL_PREFIX "."
+#include "sysdep.h"
+#include "bfd.h"
+
+#undef bfd_pe_print_pdata
+#define bfd_pe_print_pdata pe_print_ce_compressed_pdata
+extern bfd_boolean pe_print_ce_compressed_pdata (bfd *, void *);
+
#include "pe-arm.c"
+
+typedef struct sym_cache
+{
+ int symcount;
+ asymbol **syms;
+} sym_cache;
+
+static asymbol **
+slurp_symtab (bfd *abfd, sym_cache *psc)
+{
+ asymbol **sy = NULL;
+ long storage;
+
+ if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
+ {
+ psc->symcount = 0;
+ return NULL;
+ }
+
+ storage = bfd_get_symtab_upper_bound (abfd);
+ if (storage < 0)
+ return NULL;
+ if (storage)
+ sy = bfd_malloc (storage);
+
+ psc->symcount = bfd_canonicalize_symtab (abfd, sy);
+ if (psc->symcount < 0)
+ return NULL;
+ return sy;
+}
+
+static const char *
+my_symbol_for_address (bfd *abfd, bfd_vma func, sym_cache *psc)
+{
+ int i;
+
+ if (psc->syms == 0)
+ psc->syms = slurp_symtab (abfd, psc);
+
+ for (i = 0; i < psc->symcount; i++)
+ {
+ if (psc->syms[i]->section->vma + psc->syms[i]->value == func)
+ return psc->syms[i]->name;
+ }
+
+ return NULL;
+}
+
+static void
+cleanup_syms (sym_cache *psc)
+{
+ psc->symcount = 0;
+ free (psc->syms);
+ psc->syms = NULL;
+}
+
+/* This is the version for "compressed" pdata. */
+
+bfd_boolean
+pe_print_ce_compressed_pdata (bfd * abfd, void * vfile)
+{
+# define PDATA_ROW_SIZE (2 * 4)
+ FILE *file = (FILE *) vfile;
+ bfd_byte *data = 0;
+ asection *section = bfd_get_section_by_name (abfd, ".pdata");
+ bfd_size_type datasize = 0;
+ bfd_size_type i;
+ bfd_size_type start, stop;
+ int onaline = PDATA_ROW_SIZE;
+ struct sym_cache sym_cache = {0, 0} ;
+
+ if (section == NULL
+ || coff_section_data (abfd, section) == NULL
+ || pei_section_data (abfd, section) == NULL)
+ return TRUE;
+
+ stop = pei_section_data (abfd, section)->virt_size;
+ if ((stop % onaline) != 0)
+ fprintf (file,
+ _("Warning, .pdata section size (%ld) is not a multiple of %d\n"),
+ (long) stop, onaline);
+
+ fprintf (file,
+ _("\nThe Function Table (interpreted .pdata section contents)\n"));
+
+ fprintf (file, _("\
+ vma:\t\tBegin Prolog Function Flags Exception EH\n\
+ \t\tAddress Length Length 32b exc Handler Data\n"));
+
+ datasize = section->size;
+ if (datasize == 0)
+ return TRUE;
+
+ if (! bfd_malloc_and_get_section (abfd, section, &data))
+ {
+ if (data != NULL)
+ free (data);
+ return FALSE;
+ }
+
+ start = 0;
+
+ for (i = start; i < stop; i += onaline)
+ {
+ bfd_vma begin_addr;
+ bfd_vma other_data;
+ bfd_vma prolog_length, function_length;
+ int flag32bit, exception_flag;
+ bfd_byte *tdata = 0;
+ asection *tsection;
+
+ if (i + PDATA_ROW_SIZE > stop)
+ break;
+
+ begin_addr = GET_PDATA_ENTRY (abfd, data + i );
+ other_data = GET_PDATA_ENTRY (abfd, data + i + 4);
+
+ if (begin_addr == 0 && other_data == 0)
+ /* We are probably into the padding of the section now. */
+ break;
+
+ prolog_length = (other_data & 0x000000FF);
+ function_length = (other_data & 0x3FFFFF00) >> 8;
+ flag32bit = (int)((other_data & 0x40000000) >> 30);
+ exception_flag = (int)((other_data & 0x80000000) >> 31);
+
+ fputc (' ', file);
+ fprintf_vma (file, i + section->vma); fputc ('\t', file);
+ fprintf_vma (file, begin_addr); fputc (' ', file);
+ fprintf_vma (file, prolog_length); fputc (' ', file);
+ fprintf_vma (file, function_length); fputc (' ', file);
+ fprintf (file, "%2d %2d ", flag32bit, exception_flag);
+
+ /* Get the exception handler's address and the data passed from the
+ .text section. This is really the data that belongs with the .pdata
+ but got "compressed" out for the ARM and SH4 architectures. */
+ tsection = bfd_get_section_by_name (abfd, ".text");
+ if (tsection && coff_section_data (abfd, tsection)
+ && pei_section_data (abfd, tsection))
+ {
+ if (bfd_malloc_and_get_section (abfd, tsection, & tdata))
+ {
+ int xx = (begin_addr - 8) - tsection->vma;
+
+ tdata = bfd_malloc (8);
+ if (bfd_get_section_contents (abfd, tsection, tdata, (bfd_vma) xx, 8))
+ {
+ bfd_vma eh, eh_data;
+
+ eh = bfd_get_32 (abfd, tdata);
+ eh_data = bfd_get_32 (abfd, tdata + 4);
+ fprintf (file, "%08x ", (unsigned int) eh);
+ fprintf (file, "%08x", (unsigned int) eh_data);
+ if (eh != 0)
+ {
+ const char *s = my_symbol_for_address (abfd, eh, &sym_cache);
+
+ if (s)
+ fprintf (file, " (%s) ", s);
+ }
+ }
+ free (tdata);
+ }
+ else
+ {
+ if (tdata)
+ free (tdata);
+ }
+ }
+
+ fprintf (file, "\n");
+ }
+
+ free (data);
+
+ cleanup_syms (& sym_cache);
+
+ return TRUE;
+#undef PDATA_ROW_SIZE
+}
/* BFD back-end for MCore PECOFF files.
- Copyright 1999, 2002, 2007 Free Software Foundation, Inc.
+ Copyright 1999, 2002, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define MCORE_PE
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coff-mcore.c"
/* BFD back-end for MIPS PE COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library.
#define COFF_NO_HACK_SCNHDR_SIZE
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coffcode.h"
const bfd_target
/* BFD back-end for PowerPC PECOFF files.
- Copyright 1995, 1996, 1999, 2001, 2007 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1999, 2001, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* FIXME: This target no longer works. Search for POWERPC_LE_PE in
coff-ppc.c and peigen.c. */
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coff-ppc.c"
/* Support for the generic parts of PE/PEI; the common executable parts.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
/* This really is architecture dependent. On IA-64, a .pdata entry
consists of three dwords containing relative virtual addresses that
specify the start and end address of the code range the entry
- covers and the address of the corresponding unwind info data. */
+ covers and the address of the corresponding unwind info data.
+
+ On ARM and SH-4, a compressed PDATA structure is used :
+ _IMAGE_CE_RUNTIME_FUNCTION_ENTRY, whereas MIPS is documented to use
+ _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY.
+ See http://msdn2.microsoft.com/en-us/library/ms253988(VS.80).aspx .
+
+ The version of this function to deal with compressed pdata has been
+ moved to pe-arm-wince.c. */
static bfd_boolean
pe_print_pdata (bfd * abfd, void * vfile)
free (data);
return TRUE;
+#undef PDATA_ROW_SIZE
}
#define IMAGE_REL_BASED_HIGHADJ 4
pe_print_idata (abfd, vfile);
pe_print_edata (abfd, vfile);
- pe_print_pdata (abfd, vfile);
+ if (bfd_coff_have_print_pdata (abfd))
+ bfd_coff_print_pdata (abfd, vfile);
+ else
+ pe_print_pdata (abfd, vfile);
pe_print_reloc (abfd, vfile);
return TRUE;
/* BFD back-end for MCore PECOFF files.
- Copyright 1999, 2002, 2007 Free Software Foundation, Inc.
+ Copyright 1999, 2002, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define MCORE_PE
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coff-mcore.c"
/* BFD back-end for PowerPC PE IMAGE COFF files.
- Copyright 1995, 1996, 1999, 2007 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1999, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* FIXME: This target no longer works. Search for POWERPC_LE_PE in
coff-ppc.c and peigen.c. */
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata NULL
+#endif
+
#include "coff-ppc.c"