From 2b5c217d4551d71750840b7d76fd677075512903 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 18 Jul 2008 11:30:22 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 50 ++++++++++++ bfd/cf-i386lynx.c | 4 +- bfd/coff-alpha.c | 2 +- bfd/coff-apollo.c | 4 +- bfd/coff-arm.c | 6 +- bfd/coff-aux.c | 7 +- bfd/coff-h8300.c | 5 ++ bfd/coff-h8500.c | 6 +- bfd/coff-i386.c | 6 +- bfd/coff-i860.c | 6 +- bfd/coff-i960.c | 9 ++- bfd/coff-ia64.c | 7 +- bfd/coff-m68k.c | 6 +- bfd/coff-m88k.c | 7 +- bfd/coff-maxq.c | 6 +- bfd/coff-mips.c | 3 +- bfd/coff-or32.c | 7 +- bfd/coff-rs6000.c | 14 +++- bfd/coff-sh.c | 9 ++- bfd/coff-sparc.c | 4 +- bfd/coff-tic30.c | 6 +- bfd/coff-tic4x.c | 12 ++- bfd/coff-tic54x.c | 7 +- bfd/coff-tic80.c | 7 +- bfd/coff-w65.c | 6 +- bfd/coff-we32k.c | 6 +- bfd/coff-x86_64.c | 6 +- bfd/coff-z80.c | 6 +- bfd/coff-z8k.c | 6 +- bfd/coff64-rs6000.c | 12 ++- bfd/coffcode.h | 19 ++++- bfd/libcoff-in.h | 2 +- bfd/libcoff.h | 8 ++ bfd/pe-arm-wince.c | 189 +++++++++++++++++++++++++++++++++++++++++++- bfd/pe-mcore.c | 6 +- bfd/pe-mips.c | 7 +- bfd/pe-ppc.c | 7 +- bfd/peXXigen.c | 18 ++++- bfd/pei-mcore.c | 6 +- bfd/pei-ppc.c | 6 +- 40 files changed, 458 insertions(+), 52 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bcb636ea35b..1808f60e112 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,53 @@ +2008-07-18 Danny Backx + + * 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 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section, diff --git a/bfd/cf-i386lynx.c b/bfd/cf-i386lynx.c index 8a30ed66ae1..46951ab3935 100644 --- a/bfd/cf-i386lynx.c +++ b/bfd/cf-i386lynx.c @@ -1,5 +1,5 @@ /* 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. @@ -29,4 +29,6 @@ #define COFF_LONG_FILENAMES +#define bfd_pe_print_pdata NULL + #include "coff-i386.c" diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 52235f79f93..98bed843703 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2304,7 +2304,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = 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, diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c index 6c3047352c4..4272ba6637a 100644 --- a/bfd/coff-apollo.c +++ b/bfd/coff-apollo.c @@ -1,6 +1,6 @@ /* 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. @@ -105,6 +105,8 @@ apollo_howto2rtype (internal) #define SELECT_RELOC(external, internal) \ external.r_type = apollo_howto2rtype (internal); +#define bfd_pe_print_pdata NULL + #include "coffcode.h" #ifndef TARGET_SYM diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 3bf61e5b769..d2c27c43a8c 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1,6 +1,6 @@ /* 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. @@ -2528,6 +2528,10 @@ coff_arm_final_link_postscript (bfd * abfd ATTRIBUTE_UNUSED, 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 diff --git a/bfd/coff-aux.c b/bfd/coff-aux.c index eb7b2256a11..2101dd348c4 100644 --- a/bfd/coff-aux.c +++ b/bfd/coff-aux.c @@ -1,5 +1,6 @@ /* 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 . This file is part of BFD, the Binary File Descriptor library. @@ -48,6 +49,10 @@ static bfd_boolean coff_m68k_aux_link_add_one_symbol #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" diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index 5ff87aec8f6..e2a10a6c5ce 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -1429,6 +1429,11 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info) #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 diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index 186923a9d1c..139a8ed1b6b 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -1,6 +1,6 @@ /* 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, . @@ -298,6 +298,10 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) #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 diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 115fdf2fd34..30c81885d4c 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* 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. @@ -37,6 +37,10 @@ #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 diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index bde75b1a6ac..e5ca0c17bc5 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,6 +1,6 @@ /* 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 , October 1995 @@ -29,6 +29,10 @@ #include "coff/internal.h" +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "libcoff.h" diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index 7233c43dce6..dc74a390c69 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,6 +1,6 @@ /* 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. @@ -28,7 +28,12 @@ #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 *)); diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index e8d6674c40c..0037c2f6917 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -1,5 +1,6 @@ /* 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 This file is part of BFD, the Binary File Descriptor library. @@ -64,6 +65,10 @@ in_reloc_p(abfd, howto) } #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 *)); diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index 185b0590277..b53cc5fb769 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -1,6 +1,6 @@ /* 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. @@ -545,6 +545,10 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) #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 diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index b2774256e14..dd7704d6b6c 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -1,6 +1,6 @@ /* 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. @@ -284,6 +284,11 @@ reloc_processing (relent, reloc, symbols, abfd, section) } #define BADMAG(x) MC88BADMAG(x) + +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "coffcode.h" #undef coff_write_armap diff --git a/bfd/coff-maxq.c b/bfd/coff-maxq.c index 927ba993fba..165d7c86a9b 100644 --- a/bfd/coff-maxq.c +++ b/bfd/coff-maxq.c @@ -1,5 +1,5 @@ /* 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) @@ -427,6 +427,10 @@ maxq_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) #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 diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 38010ef8219..929b3c16919 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -85,6 +85,7 @@ static reloc_howto_type *mips_bfd_reloc_type_lookup #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. */ @@ -1318,7 +1319,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = _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, diff --git a/bfd/coff-or32.c b/bfd/coff-or32.c index 39a47fd5228..9f57eb06eec 100644 --- a/bfd/coff-or32.c +++ b/bfd/coff-or32.c @@ -1,5 +1,6 @@ /* 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 This file is part of BFD, the Binary File Descriptor library. @@ -570,6 +571,10 @@ coff_or32_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) #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 = diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index d2d443f9f31..17c6907a3c5 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,6 +1,6 @@ /* 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. @@ -128,6 +128,10 @@ extern int rs6000coff_core_file_failing_signal #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. */ @@ -4034,7 +4038,8 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = 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 */ @@ -4285,7 +4290,8 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = 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 */ diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 796a88e9287..07208674b45 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -1,6 +1,6 @@ /* 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, . Relaxing code written by Ian Lance Taylor, . @@ -43,6 +43,10 @@ static bfd_boolean sh_align_load_span #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. */ @@ -3149,7 +3153,8 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table = 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 \ diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c index eb8e08b6727..a9a699aec92 100644 --- a/bfd/coff-sparc.c +++ b/bfd/coff-sparc.c @@ -1,6 +1,6 @@ /* 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. @@ -206,6 +206,8 @@ rtype2howto (cache_ptr, dst) #define COFF_SPARC +#define bfd_pe_print_pdata NULL + #include "coffcode.h" #ifndef TARGET_SYM diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c index a732a00bcef..033f79db05e 100644 --- a/bfd/coff-tic30.c +++ b/bfd/coff-tic30.c @@ -1,5 +1,5 @@ /* 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) @@ -182,6 +182,10 @@ reloc_processing (relent, reloc, symbols, abfd, section) 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 = diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 7015becc8d1..4259dd91465 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -1,6 +1,6 @@ /* 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) @@ -69,8 +69,12 @@ ticoff_bfd_is_local_label_name (abfd, name) 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" diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index 098a8887afb..672897d1d11 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -1,5 +1,5 @@ /* 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) @@ -359,6 +359,11 @@ ticoff_bfd_is_local_label_name (abfd, name) 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 diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index e6c4e5c1264..6455e492334 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -1,5 +1,5 @@ /* 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) @@ -734,6 +734,11 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd, #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) diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c index ced7d9b63cc..308d4484fe0 100644 --- a/bfd/coff-w65.c +++ b/bfd/coff-w65.c @@ -1,6 +1,6 @@ /* 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, . This file is part of BFD, the Binary File Descriptor library. @@ -375,6 +375,10 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, #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 diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c index 7bd2d4f7e74..1ba62007cf0 100644 --- a/bfd/coff-we32k.c +++ b/bfd/coff-we32k.c @@ -1,5 +1,5 @@ /* 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). @@ -63,6 +63,10 @@ static reloc_howto_type howto_table[] = #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 diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index 0368434f8a5..78a788670b9 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -1,5 +1,5 @@ /* 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. @@ -711,6 +711,10 @@ coff_amd64_is_local_label_name (bfd *abfd, const char *name) #endif /* TARGET_UNDERSCORE */ +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "coffcode.h" #ifdef PE diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c index b866d2f1c42..7e546063048 100644 --- a/bfd/coff-z80.c +++ b/bfd/coff-z80.c @@ -1,5 +1,5 @@ /* 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 This file is part of BFD, the Binary File Descriptor library. @@ -270,6 +270,10 @@ extra_case (bfd *in_abfd, #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 diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index ad49f7a7ad3..7e9dba50761 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -1,6 +1,6 @@ /* 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, . @@ -372,6 +372,10 @@ extra_case (bfd *in_abfd, #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 diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 0c5a3dd3963..7a0ec1f2ca5 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* 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. @@ -272,6 +272,10 @@ extern int rs6000coff_core_file_failing_signal #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 @@ -2584,7 +2588,8 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = 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 */ @@ -2837,7 +2842,8 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = 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 */ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 3d92ee570a4..78269829f76 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,6 +1,6 @@ /* 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. @@ -1292,6 +1292,9 @@ Special entry points for gdb to swap in coff symbol table parts: . 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) \ @@ -1424,6 +1427,11 @@ Special entry points for gdb to swap in coff symbol table parts: .#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. */ @@ -5263,7 +5271,8 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table ATTRIBUTE_UNUSED = 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 @@ -5306,7 +5315,8 @@ static const bfd_coff_backend_data ticoff0_swap_table = 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 @@ -5350,7 +5360,8 @@ static const bfd_coff_backend_data ticoff1_swap_table = 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 diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index d8c8ed18640..8f11df4dfa1 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -1,6 +1,6 @@ /* 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. diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 1e6f1c2899c..f21e0e6539e 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -802,6 +802,9 @@ typedef struct 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) \ @@ -934,3 +937,8 @@ typedef struct #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)) + diff --git a/bfd/pe-arm-wince.c b/bfd/pe-arm-wince.c index 90a53a35fad..e0013f378d5 100644 --- a/bfd/pe-arm-wince.c +++ b/bfd/pe-arm-wince.c @@ -1,5 +1,5 @@ /* 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. @@ -35,4 +35,191 @@ #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 +} diff --git a/bfd/pe-mcore.c b/bfd/pe-mcore.c index d0744668067..7b466c2f1f9 100644 --- a/bfd/pe-mcore.c +++ b/bfd/pe-mcore.c @@ -1,5 +1,5 @@ /* 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. @@ -34,4 +34,8 @@ #define MCORE_PE +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "coff-mcore.c" diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index 81aeb68caab..f28a2c2180f 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,6 +1,7 @@ /* 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. @@ -851,6 +852,10 @@ coff_mips_is_local_label_name (bfd *abfd, const char *name) #define COFF_NO_HACK_SCNHDR_SIZE +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "coffcode.h" const bfd_target diff --git a/bfd/pe-ppc.c b/bfd/pe-ppc.c index e253d3858cd..8758d4490c5 100644 --- a/bfd/pe-ppc.c +++ b/bfd/pe-ppc.c @@ -1,5 +1,6 @@ /* 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. @@ -40,4 +41,8 @@ /* 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" diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index ddba2354df5..be06ee6f2b5 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -1,6 +1,6 @@ /* 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. @@ -1581,7 +1581,15 @@ pe_print_edata (bfd * abfd, void * vfile) /* 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) @@ -1705,6 +1713,7 @@ pe_print_pdata (bfd * abfd, void * vfile) free (data); return TRUE; +#undef PDATA_ROW_SIZE } #define IMAGE_REL_BASED_HIGHADJ 4 @@ -1975,7 +1984,10 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile) 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; diff --git a/bfd/pei-mcore.c b/bfd/pei-mcore.c index b1f30cc473b..209c9fa3ab5 100644 --- a/bfd/pei-mcore.c +++ b/bfd/pei-mcore.c @@ -1,5 +1,5 @@ /* 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. @@ -35,4 +35,8 @@ #define MCORE_PE +#ifndef bfd_pe_print_pdata +#define bfd_pe_print_pdata NULL +#endif + #include "coff-mcore.c" diff --git a/bfd/pei-ppc.c b/bfd/pei-ppc.c index e109c69e26c..420e33e3a0a 100644 --- a/bfd/pei-ppc.c +++ b/bfd/pei-ppc.c @@ -1,5 +1,5 @@ /* 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. @@ -42,4 +42,8 @@ /* 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" -- 2.30.2