From 0aabe54e62224040844b7a5516fd832e078056b4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 6 Jun 2011 01:26:05 +0000 Subject: [PATCH] * targets.c (bfd_target): Make ar_max_namelen an unsigned char. Add match_priority. * configure.in: Bump bfd version. * elfcode.h (elf_object_p): Delete hacks preventing match of EM_NONE and ELFOSABI_NONE targets when a better match exists. * elfxx-target.h (elf_match_priority): Define and use. * format.c (bfd_check_format_matches): Use target match_priority to choose best of multiple matching targets. In cases with multiple matches rerun _bfd_check_format if we don't choose the last match. * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c, * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c, * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c, * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c, * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * xsym.c: Init match_priority field. * configure: Regenerate. * bfd-in2.h: Regenerate. --- bfd/ChangeLog | 24 ++++++++++++++++++ bfd/aout-adobe.c | 3 ++- bfd/aout-arm.c | 8 +++--- bfd/aout-target.h | 3 ++- bfd/aout-tic30.c | 3 ++- bfd/bfd-in2.h | 6 ++++- bfd/binary.c | 3 ++- bfd/bout.c | 5 ++-- bfd/coff-alpha.c | 3 ++- bfd/coff-i386.c | 3 ++- bfd/coff-i860.c | 1 + bfd/coff-i960.c | 4 ++- bfd/coff-ia64.c | 3 ++- bfd/coff-mips.c | 5 +++- bfd/coff-or32.c | 3 ++- bfd/coff-ppc.c | 2 ++ bfd/coff-rs6000.c | 4 ++- bfd/coff-sh.c | 2 ++ bfd/coff-tic30.c | 3 ++- bfd/coff-tic54x.c | 8 +++++- bfd/coff-x86_64.c | 4 ++- bfd/coff64-rs6000.c | 4 ++- bfd/coffcode.h | 5 +++- bfd/configure | 2 +- bfd/configure.in | 2 +- bfd/elfcode.h | 72 +++++------------------------------------------------ bfd/elfxx-target.h | 12 ++++++++- bfd/format.c | 40 ++++++++++++++++++++++------- bfd/i386msdos.c | 3 ++- bfd/i386os9k.c | 3 ++- bfd/ieee.c | 3 ++- bfd/ihex.c | 3 ++- bfd/mach-o-target.c | 3 ++- bfd/mipsbsd.c | 4 ++- bfd/mmo.c | 3 ++- bfd/nlm-target.h | 4 ++- bfd/oasys.c | 3 ++- bfd/pdp11.c | 3 ++- bfd/pe-mips.c | 3 ++- bfd/pef.c | 2 ++ bfd/plugin.c | 3 ++- bfd/ppcboot.c | 3 ++- bfd/som.c | 1 + bfd/srec.c | 4 ++- bfd/targets.c | 6 ++++- bfd/tekhex.c | 3 ++- bfd/trad-core.c | 9 ++++--- bfd/verilog.c | 3 ++- bfd/versados.c | 3 ++- bfd/vms-alpha.c | 1 + bfd/vms-lib.c | 3 ++- bfd/xsym.c | 3 ++- 52 files changed, 192 insertions(+), 124 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e417b82..bd3895a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,27 @@ +2011-06-06 Alan Modra + + * targets.c (bfd_target): Make ar_max_namelen an unsigned char. + Add match_priority. + * configure.in: Bump bfd version. + * elfcode.h (elf_object_p): Delete hacks preventing match of + EM_NONE and ELFOSABI_NONE targets when a better match exists. + * elfxx-target.h (elf_match_priority): Define and use. + * format.c (bfd_check_format_matches): Use target match_priority + to choose best of multiple matching targets. In cases with multiple + matches rerun _bfd_check_format if we don't choose the last match. + * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c, + * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c, + * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c, + * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c, + * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h, + * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c, + * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c, + * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c, + * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c, + * vms-lib.c, * xsym.c: Init match_priority field. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + 2011-06-04 H.J. Lu PR ld/12842 diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index ca0e003..bd38ea8 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -1,6 +1,6 @@ /* BFD back-end for a.out.adobe binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Cygnus Support. Based on bout.c. @@ -487,6 +487,7 @@ const bfd_target a_out_adobe_vec = '_', /* Symbol leading char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, diff --git a/bfd/aout-arm.c b/bfd/aout-arm.c index 9a5d155..fd93603 100644 --- a/bfd/aout-arm.c +++ b/bfd/aout-arm.c @@ -1,6 +1,6 @@ /* BFD back-end for raw ARM a.out binaries. Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, - 2007, 2009, 2010 Free Software Foundation, Inc. + 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -477,6 +477,7 @@ const bfd_target aout_arm_little_vec = MY_symbol_leading_char, AR_PAD_CHAR, /* AR_pad_char. */ 15, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */ @@ -516,8 +517,9 @@ const bfd_target aout_arm_big_vec = HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), MY_symbol_leading_char, - AR_PAD_CHAR, /* AR_pad_char. */ - 15, /* AR_max_namelen. */ + AR_PAD_CHAR, /* AR_pad_char. */ + 15, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 5162494..5c0d2ae 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -1,6 +1,6 @@ /* Define a target vector and some small routines for a variant of a.out. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -627,6 +627,7 @@ const bfd_target MY (vec) = MY_symbol_leading_char, AR_PAD_CHAR, /* AR_pad_char. */ 15, /* AR_max_namelen. */ + 0, /* match priority. */ #ifdef TARGET_IS_BIG_ENDIAN_P bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index 5d5c7e2..30900ba 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -1,6 +1,6 @@ /* BFD back-end for TMS320C30 a.out binaries. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, - 2010 + 2010, 2011 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) @@ -1080,6 +1080,7 @@ const bfd_target tic30_aout_vec = MY_symbol_leading_char, AR_PAD_CHAR, /* AR_pad_char. */ 15, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 4fd71e6..368f820 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -5581,7 +5581,11 @@ typedef struct bfd_target char ar_pad_char; /* The maximum number of characters in an archive header. */ - unsigned short ar_max_namelen; + unsigned char ar_max_namelen; + + /* How well this target matches, used to select between various + possible targets when more than one target matches. */ + unsigned char match_priority; /* Entries for byte swapping for data. These are different from the other entry points, since they don't take a BFD as the first argument. diff --git a/bfd/binary.c b/bfd/binary.c index 2af0293..ad93354 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -1,6 +1,6 @@ /* BFD back-end for binary objects. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -326,6 +326,7 @@ const bfd_target binary_vec = 0, /* symbol_leading_char */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ + 255, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ diff --git a/bfd/bout.c b/bfd/bout.c index 34c1a6b..b76191b 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1409,7 +1409,7 @@ const bfd_target b_out_vec_big_host = '_', /* Symbol leading char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ - + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */ @@ -1451,6 +1451,7 @@ const bfd_target b_out_vec_little_host = '_', /* Symbol leading char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */ diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 12b49ac..c4dfd8f 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,6 +1,6 @@ /* BFD back-end for ALPHA Extended-Coff files. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007, 2008, 2009, 2010 + 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -2418,6 +2418,7 @@ const bfd_target ecoffalpha_little_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 57c47d0..425a0c1 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, 2005, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -661,6 +661,7 @@ const bfd_target #endif '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index d50b070..9eb39a5 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -677,6 +677,7 @@ const bfd_target '_', /* leading underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index d0374d2..928315f 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,6 +1,7 @@ /* BFD back-end for Intel 960 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -656,6 +657,7 @@ const bfd_target icoff_big_vec = '_', /* leading underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index 38d9ac6..86e7617 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 COFF files. - Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009 + Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Contributed by David Mosberger @@ -176,6 +176,7 @@ const bfd_target #endif '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 34fda3a..cbc172f 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -1436,6 +1436,7 @@ const bfd_target ecoff_little_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -1480,6 +1481,7 @@ const bfd_target ecoff_big_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, @@ -1523,6 +1525,7 @@ const bfd_target ecoff_biglittle_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ diff --git a/bfd/coff-or32.c b/bfd/coff-or32.c index 30801fb..a9683df 100644 --- a/bfd/coff-or32.c +++ b/bfd/coff-or32.c @@ -1,5 +1,5 @@ /* BFD back-end for OpenRISC 1000 COFF binaries. - Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. Contributed by Ivan Guzvinec @@ -594,6 +594,7 @@ const bfd_target or32coff_big_vec = '_', /* Leading underscore. */ '/', /* ar_pad_char. */ 15, /* ar_max_namelen. */ + 0, /* match priority. */ /* Data. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index 69e10d8..b866d48 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -2582,6 +2582,7 @@ const bfd_target TARGET_LITTLE_SYM = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen??? FIXMEmgo */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, @@ -2641,6 +2642,7 @@ const bfd_target TARGET_BIG_SYM = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen??? FIXMEmgo */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index fa38321f..c1b5c89 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, - 2008, 2009, 2010 + 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. @@ -3986,6 +3986,7 @@ const bfd_target rs6000coff_vec = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ /* data */ bfd_getb64, @@ -4239,6 +4240,7 @@ const bfd_target pmac_xcoff_vec = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ /* data */ bfd_getb64, diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index b77af7c..e707add 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -3185,6 +3185,7 @@ const bfd_target shcoff_small_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ @@ -3229,6 +3230,7 @@ const bfd_target shlcoff_small_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c index 7670afe..497d340 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, 2005, 2007, 2008 + Copyright 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2011 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) @@ -203,6 +203,7 @@ const bfd_target tic30_coff_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index 672897d..3c353da 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, 2008 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2011 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) @@ -446,6 +446,7 @@ const bfd_target tic54x_coff0_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -490,6 +491,7 @@ const bfd_target tic54x_coff0_beh_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -535,6 +537,7 @@ const bfd_target tic54x_coff1_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -580,6 +583,7 @@ const bfd_target tic54x_coff1_beh_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -625,6 +629,7 @@ const bfd_target tic54x_coff2_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -670,6 +675,7 @@ const bfd_target tic54x_coff2_beh_vec = '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index c739d69..d8a8a2e 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -1,5 +1,6 @@ /* BFD back-end for AMD 64 COFF files. - Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -762,6 +763,7 @@ const bfd_target #endif '/', /* Ar_pad_char. */ 15, /* Ar_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 1887bb9..ef4dfba 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,6 +1,6 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 + 2010, 2011 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -2622,6 +2622,7 @@ const bfd_target rs6000coff64_vec = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ /* data */ bfd_getb64, @@ -2877,6 +2878,7 @@ const bfd_target aix5coff64_vec = 0, /* leading char */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ /* data */ bfd_getb64, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index b6deddd..e71aadd 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, 2008, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -5688,6 +5688,7 @@ const bfd_target VAR = \ UNDER, /* Leading symbol underscore. */ \ '/', /* AR_pad_char. */ \ 15, /* AR_max_namelen. */ \ + 0, /* match priority. */ \ \ /* Data conversion functions. */ \ bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ @@ -5738,6 +5739,7 @@ const bfd_target VAR = \ UNDER, /* Leading symbol underscore. */ \ '/', /* AR_pad_char. */ \ 15, /* AR_max_namelen. */ \ + 0, /* match priority. */ \ \ /* Data conversion functions. */ \ bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ @@ -5788,6 +5790,7 @@ const bfd_target VAR = \ UNDER, /* Leading symbol underscore. */ \ '/', /* AR_pad_char. */ \ 15, /* AR_max_namelen. */ \ + 0, /* match priority. */ \ \ /* Data conversion functions. */ \ bfd_getl64, bfd_getl_signed_64, bfd_putl64, \ diff --git a/bfd/configure b/bfd/configure index 2e8ece2..634e717 100755 --- a/bfd/configure +++ b/bfd/configure @@ -3988,7 +3988,7 @@ fi # Define the identity of the package. PACKAGE=bfd - VERSION=2.21.51 + VERSION=2.21.52 cat >>confdefs.h <<_ACEOF diff --git a/bfd/configure.in b/bfd/configure.in index 7457646..2fa24d8 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c]) AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.21.51) +AM_INIT_AUTOMAKE(bfd, 2.21.52) dnl These must be called before LT_INIT, because it may want dnl to call AC_CHECK_PROG. diff --git a/bfd/elfcode.h b/bfd/elfcode.h index d8833df..b7e0226 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -499,7 +499,6 @@ elf_object_p (bfd *abfd) asection *s; bfd_size_type amt; const bfd_target *target; - const bfd_target * const *target_ptr; preserve.marker = NULL; @@ -588,34 +587,9 @@ elf_object_p (bfd *abfd) && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1) && (ebd->elf_machine_alt2 == 0 - || i_ehdrp->e_machine != ebd->elf_machine_alt2)) - { - if (ebd->elf_machine_code != EM_NONE) - goto got_wrong_format_error; - - /* This is the generic ELF target. Let it match any ELF target - for which we do not have a specific backend. */ - for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++) - { - const struct elf_backend_data *back; - - if ((*target_ptr)->flavour != bfd_target_elf_flavour) - continue; - back = xvec_get_elf_backend_data (*target_ptr); - if (back->s->arch_size != ARCH_SIZE) - continue; - if (back->elf_machine_code == i_ehdrp->e_machine - || (back->elf_machine_alt1 != 0 - && back->elf_machine_alt1 == i_ehdrp->e_machine) - || (back->elf_machine_alt2 != 0 - && back->elf_machine_alt2 == i_ehdrp->e_machine)) - { - /* target_ptr is an ELF backend which matches this - object file, so reject the generic ELF target. */ - goto got_wrong_format_error; - } - } - } + || i_ehdrp->e_machine != ebd->elf_machine_alt2) + && ebd->elf_machine_code != EM_NONE) + goto got_wrong_format_error; if (i_ehdrp->e_type == ET_EXEC) abfd->flags |= EXEC_P; @@ -633,43 +607,9 @@ elf_object_p (bfd *abfd) } if (ebd->elf_machine_code != EM_NONE - && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi) - { - if (ebd->elf_osabi != ELFOSABI_NONE) - goto got_wrong_format_error; - - /* This is an ELFOSABI_NONE ELF target. Let it match any ELF - target of the compatible machine for which we do not have a - backend with matching ELFOSABI. */ - for (target_ptr = bfd_target_vector; - *target_ptr != NULL; - target_ptr++) - { - const struct elf_backend_data *back; - - /* Skip this target and targets with incompatible byte - order. */ - if (*target_ptr == target - || (*target_ptr)->flavour != bfd_target_elf_flavour - || (*target_ptr)->byteorder != target->byteorder - || ((*target_ptr)->header_byteorder - != target->header_byteorder)) - continue; - - back = xvec_get_elf_backend_data (*target_ptr); - if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI] - && (back->elf_machine_code == i_ehdrp->e_machine - || (back->elf_machine_alt1 != 0 - && back->elf_machine_alt1 == i_ehdrp->e_machine) - || (back->elf_machine_alt2 != 0 - && back->elf_machine_alt2 == i_ehdrp->e_machine))) - { - /* target_ptr is an ELF backend which matches this - object file, so reject the ELFOSABI_NONE ELF target. */ - goto got_wrong_format_error; - } - } - } + && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi + && ebd->elf_osabi != ELFOSABI_NONE) + goto got_wrong_format_error; if (i_ehdrp->e_shoff != 0) { diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index fab1b04..b92e2a6 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -1,6 +1,7 @@ /* Target definitions for NN-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -643,6 +644,11 @@ #define elf_backend_is_function_type _bfd_elf_is_function_type #endif +#ifndef elf_match_priority +#define elf_match_priority \ + (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0) +#endif + extern const struct elf_size_info _bfd_elfNN_size_info; static struct elf_backend_data elfNN_bed = @@ -811,6 +817,8 @@ const bfd_target TARGET_BIG_SYM = Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ 15, + elf_match_priority, + /* Routines to byte-swap various sized integers from the data sections */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, @@ -907,6 +915,8 @@ const bfd_target TARGET_LITTLE_SYM = Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ 15, + elf_match_priority, + /* Routines to byte-swap various sized integers from the data sections */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/format.c b/bfd/format.c index 4d89a85..66b9051 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -121,8 +121,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) extern const bfd_target binary_vec; const bfd_target * const *target; const bfd_target **matching_vector = NULL; - const bfd_target *save_targ, *right_targ, *ar_right_targ; - int match_count; + const bfd_target *save_targ, *right_targ, *ar_right_targ, *match_targ; + int match_count, best_count, best_match; int ar_match_index; if (matching != NULL) @@ -156,6 +156,9 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) right_targ = 0; ar_right_targ = 0; + match_targ = 0; + best_match = 256; + best_count = 0; /* Presume the answer is yes. */ abfd->format = format; @@ -194,7 +197,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) /* Don't check the default target twice. */ if (*target == &binary_vec - || (!abfd->target_defaulted && *target == save_targ)) + || (!abfd->target_defaulted && *target == save_targ) + || (*target)->match_priority > best_match) continue; abfd->xvec = *target; /* Change BFD's target temporarily. */ @@ -209,6 +213,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) bfd_set_error (bfd_error_wrong_format); temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); + if (temp) + match_targ = temp; if (temp && (abfd->format != bfd_archive || bfd_has_map (abfd))) { @@ -219,14 +225,18 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) targets might match. People who want those other targets have to set the GNUTARGET variable. */ if (temp == bfd_default_vector[0]) - { - match_count = 1; - break; - } + goto ok_ret; if (matching_vector) matching_vector[match_count] = temp; match_count++; + + if (temp->match_priority < best_match) + { + best_match = temp->match_priority; + best_count = 0; + } + best_count++; } else if (temp || (err = bfd_get_error ()) == bfd_error_wrong_object_format @@ -245,6 +255,9 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) goto err_ret; } + if (best_count == 1) + match_count = 1; + if (match_count == 0) { /* Try partial matches. */ @@ -287,9 +300,18 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) if (match_count == 1) { - ok_ret: - abfd->xvec = right_targ; /* Change BFD's target permanently. */ + abfd->xvec = right_targ; + /* If we come out of the loop knowing that the last target that + matched is the one we want, then ABFD should still be in a usable + state (except possibly for XVEC). */ + if (match_targ != right_targ) + { + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) + goto err_ret; + match_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); + } + ok_ret: /* If the file was opened for update, then `output_has_begun' some time ago when the file was created. Do not recompute sections sizes or alignments in _bfd_set_section_contents. diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index 95d9775..9ff5fd3 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -1,6 +1,6 @@ /* BFD back-end for MS-DOS executables. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Bryan Ford of the University of Utah. Contributed by the Center for Software Science at the @@ -188,6 +188,7 @@ const bfd_target i386msdos_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index a5e8920..5cbf927 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -1,6 +1,6 @@ /* BFD back-end for os9000 i386 binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002, - 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -193,6 +193,7 @@ const bfd_target i386os9k_vec = 0, /* symbol leading char */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/ieee.c b/bfd/ieee.c index bb986c4..9494b35 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -1,6 +1,6 @@ /* BFD back-end for ieee-695 objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -3801,6 +3801,7 @@ const bfd_target ieee_vec = '_', /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/ihex.c b/bfd/ihex.c index 6a9816c..a92baaf 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel Hex objects. Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2009 Free Software Foundation, Inc. + 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -957,6 +957,7 @@ const bfd_target ihex_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index 64c7ddf..32dc335 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -1,5 +1,5 @@ /* Mach-O support for BFD. - Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2010 + Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -118,6 +118,7 @@ const bfd_target TARGET_NAME = '_', /* symbol_leading_char. */ ' ', /* ar_pad_char. */ 16, /* ar_max_namelen. */ + 0, /* match priority. */ #if TARGET_BIG_ENDIAN bfd_getb64, bfd_getb_signed_64, bfd_putb64, diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c index 004ef6e..915e7bf 100644 --- a/bfd/mipsbsd.c +++ b/bfd/mipsbsd.c @@ -1,6 +1,6 @@ /* BFD backend for MIPS BSD (a.out) binaries. Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2005, 2007, 2009 Free Software Foundation, Inc. + 2005, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Ralph Campbell. This file is part of BFD, the Binary File Descriptor library. @@ -426,6 +426,7 @@ const bfd_target aout_mips_little_vec = MY_symbol_leading_char, ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ @@ -467,6 +468,7 @@ const bfd_target aout_mips_big_vec = MY_symbol_leading_char, ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ diff --git a/bfd/mmo.c b/bfd/mmo.c index 8c72788..c22790d 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -1,5 +1,5 @@ /* BFD back-end for mmo objects (MMIX-specific object-format). - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Hans-Peter Nilsson (hp@bitrange.com). Infrastructure and other bits originally copied from srec.c and @@ -3238,6 +3238,7 @@ const bfd_target bfd_mmo_vec = 0, /* leading underscore */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index add6937..f38b16e 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -1,6 +1,6 @@ /* Target definitions for 32/64-bit NLM (NetWare Loadable Module) Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2007, 2009 Free Software Foundation, Inc. + 2005, 2007, 2009, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -109,6 +109,7 @@ const bfd_target TARGET_BIG_SYM = of the archiver and should be independently tunable. This value is a WAG (wild a** guess). */ 15, + 0, /* match priority. */ /* Routines to byte-swap various sized integers from the data sections. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -202,6 +203,7 @@ const bfd_target TARGET_LITTLE_SYM = of the archiver and should be independently tunable. This value is a WAG (wild a** guess). */ 15, + 0, /* match priority. */ /* Routines to byte-swap various sized integers from the data sections. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, diff --git a/bfd/oasys.c b/bfd/oasys.c index 1f51449..e58f0d0 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1,6 +1,6 @@ /* BFD back-end for oasys objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 + 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support, . @@ -1224,6 +1224,7 @@ const bfd_target oasys_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 3821037..8cb87e4 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 a.out binaries. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -4511,6 +4511,7 @@ const bfd_target MY (vec) = MY_symbol_leading_char, AR_PAD_CHAR, /* AR_pad_char. */ 15, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getp32, bfd_getp_signed_32, bfd_putp32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */ diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index 42e4e83..2025e7d 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,6 +1,6 @@ /* 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, 2008, 2009, 2010 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com @@ -890,6 +890,7 @@ const bfd_target #endif '/', /* AR_pad_char. */ 15, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/pef.c b/bfd/pef.c index dcfda05..6db7301 100644 --- a/bfd/pef.c +++ b/bfd/pef.c @@ -1015,6 +1015,7 @@ const bfd_target pef_vec = 0, /* Symbol_leading_char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ @@ -1167,6 +1168,7 @@ const bfd_target pef_xlib_vec = 0, /* Symbol_leading_char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/plugin.c b/bfd/plugin.c index dde61c8..5d34f85 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -1,5 +1,5 @@ /* Plugin support for BFD. - Copyright 2009 + Copyright 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -478,6 +478,7 @@ const bfd_target plugin_vec = 0, /* symbol_leading_char. */ '/', /* ar_pad_char. */ 15, /* ar_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 853ee88..a970436 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -1,6 +1,6 @@ /* BFD back-end for PPCbug boot records. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -507,6 +507,7 @@ const bfd_target ppcboot_vec = 0, /* symbol_leading_char */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ diff --git a/bfd/som.c b/bfd/som.c index a18c869..a642231 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -6768,6 +6768,7 @@ const bfd_target som_vec = 0, '/', /* AR_pad_char. */ 14, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/srec.c b/bfd/srec.c index 1251a7e..6d4de1a 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1,6 +1,6 @@ /* BFD back-end for s-record objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -1280,6 +1280,7 @@ const bfd_target srec_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ @@ -1335,6 +1336,7 @@ const bfd_target symbolsrec_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/targets.c b/bfd/targets.c index 47341af..0400429 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -208,7 +208,11 @@ DESCRIPTION . char ar_pad_char; . . {* The maximum number of characters in an archive header. *} -. unsigned short ar_max_namelen; +. unsigned char ar_max_namelen; +. +. {* How well this target matches, used to select between various +. possible targets when more than one target matches. *} +. unsigned char match_priority; . . {* Entries for byte swapping for data. These are different from the . other entry points, since they don't take a BFD as the first argument. diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 2204ebb..376569a 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -1,6 +1,6 @@ /* BFD backend for Extended Tektronix Hex Format objects. Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -972,6 +972,7 @@ const bfd_target tekhex_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/trad-core.c b/bfd/trad-core.c index e06b561..4b9d14d 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -1,6 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -284,9 +284,10 @@ const bfd_target trad_core_vec = HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* symbol prefix */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ + 0, /* symbol prefix */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + 0, /* match priority. */ NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */ diff --git a/bfd/verilog.c b/bfd/verilog.c index 551e5c4..a2d3ca7 100644 --- a/bfd/verilog.c +++ b/bfd/verilog.c @@ -1,5 +1,5 @@ /* BFD back-end for verilog hex memory dump files. - Copyright 2009, 2010 + Copyright 2009, 2010, 2011 Free Software Foundation, Inc. Written by Anthony Green @@ -332,6 +332,7 @@ const bfd_target verilog_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/versados.c b/bfd/versados.c index 226f8a0..84a816b 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -1,6 +1,6 @@ /* BFD back-end for VERSAdos-E objects. Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2009, 2010 Free Software Foundation, Inc. + 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . Versados is a Motorola trademark. @@ -834,6 +834,7 @@ const bfd_target versados_vec = 0, /* Leading underscore. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 0f57247..45828c7 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -9362,6 +9362,7 @@ const bfd_target vms_alpha_vec = 0, /* symbol_leading_char. */ ' ', /* ar_pad_char. */ 15, /* ar_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index 813ea39..888982d 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -1,6 +1,6 @@ /* BFD back-end for VMS archive files. - Copyright 2010 Free Software Foundation, Inc. + Copyright 2010, 2011 Free Software Foundation, Inc. Written by Tristan Gingold , AdaCore. This file is part of BFD, the Binary File Descriptor library. @@ -2268,6 +2268,7 @@ const bfd_target vms_lib_txt_vec = 0, /* symbol_leading_char. */ ' ', /* ar_pad_char. */ 15, /* ar_max_namelen. */ + 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, diff --git a/bfd/xsym.c b/bfd/xsym.c index 95446e3..a0900f1 100644 --- a/bfd/xsym.c +++ b/bfd/xsym.c @@ -1,6 +1,6 @@ /* xSYM symbol-file support for BFD. Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2316,6 +2316,7 @@ const bfd_target sym_vec = 0, /* Symbol_leading_char. */ ' ', /* AR_pad_char. */ 16, /* AR_max_namelen. */ + 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */ -- 2.7.4