X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fbout.c;h=cfd4abb01911819cb7b93ce131d04b3f8185164f;hb=493443a47f514251f12e08223b2c56f0fed69015;hp=15baadfe50cf197e3c0ec275f183a075a6bb859e;hpb=a6b96bebd2570d41149c9b90bc90c17599a44662;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/bout.c b/bfd/bout.c index 15baadfe50..cfd4abb019 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 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Cygnus Support. @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,10 +18,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" #include "bfdlink.h" #include "genlink.h" @@ -635,7 +636,8 @@ callj_callback (bfd *abfd, } static reloc_howto_type * -b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) +b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { switch (code) { @@ -651,6 +653,20 @@ b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_typ } } +static reloc_howto_type * +b_out_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + if (strcasecmp (howto_reloc_callj.name, r_name) == 0) + return &howto_reloc_callj; + if (strcasecmp (howto_reloc_abs32.name, r_name) == 0) + return &howto_reloc_abs32; + if (strcasecmp (howto_reloc_pcrel24.name, r_name) == 0) + return &howto_reloc_pcrel24; + + return NULL; +} + /* Allocate enough room for all the reloc entries, plus pointers to them all. */ static bfd_boolean @@ -1078,7 +1094,6 @@ aligncode (bfd *abfd, unsigned int shrink) { bfd_vma dot = output_addr (input_section) + r->address; - bfd_vma gap; bfd_vma old_end; bfd_vma new_end; unsigned int shrink_delta; @@ -1094,9 +1109,6 @@ aligncode (bfd *abfd, than we used to be. */ new_end = ((dot - shrink + size) & ~size); - /* This is the new end. */ - gap = old_end - ((dot + size) & ~size); - shrink_delta = (old_end - new_end) - shrink; if (shrink_delta) @@ -1129,6 +1141,10 @@ b_out_bfd_relax_section (bfd *abfd, arelent **reloc_vector = NULL; long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); + if (link_info->relocatable) + (*link_info->callbacks->einfo) + (_("%P%F: --relax and -r may not be used together\n")); + if (reloc_size < 0) return FALSE; @@ -1366,13 +1382,17 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd, #define b_out_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols #define b_out_bfd_link_just_syms _bfd_generic_link_just_syms +#define b_out_bfd_copy_link_hash_symbol_type \ + _bfd_generic_copy_link_hash_symbol_type #define b_out_bfd_final_link _bfd_generic_final_link #define b_out_bfd_link_split_section _bfd_generic_link_split_section #define b_out_bfd_gc_sections bfd_generic_gc_sections +#define b_out_bfd_lookup_section_flags bfd_generic_lookup_section_flags #define b_out_bfd_merge_sections bfd_generic_merge_sections #define b_out_bfd_is_group_section bfd_generic_is_group_section #define b_out_bfd_discard_group bfd_generic_discard_group #define b_out_section_already_linked _bfd_generic_section_already_linked +#define b_out_bfd_define_common_symbol bfd_generic_define_common_symbol #define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window extern const bfd_target b_out_vec_little_host; @@ -1390,7 +1410,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. */ @@ -1432,6 +1452,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. */