X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fcoff-aux.c;h=1f8a81f094b8c25096e9879873210b2342ac3339;hb=ec892a0718dc47c2d009532865c353daa749eaa1;hp=eb7b2256a1112e2db6efbc6bf9fb1c991b016f77;hpb=cd123cb70c845b890eed231a84e6e84c92c2ef92;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/coff-aux.c b/bfd/coff-aux.c index eb7b2256a1..1f8a81f094 100644 --- a/bfd/coff-aux.c +++ b/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright 1996, 1997, 2000, 2002, 2007 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#define TARGET_SYM m68kaux_coff_vec +#define TARGET_SYM m68k_coff_aux_vec #define TARGET_NAME "coff-m68k-aux" #ifndef TARG_AUX @@ -41,12 +41,16 @@ #include "sysdep.h" #include "bfd.h" -static bfd_boolean coff_m68k_aux_link_add_one_symbol - PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, - struct bfd_link_hash_entry **)); - #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol +static bfd_boolean +coff_m68k_aux_link_add_one_symbol + (struct bfd_link_info *, bfd *, const char *, flagword, asection *, + bfd_vma, const char *, bfd_boolean, bfd_boolean, + struct bfd_link_hash_entry **); + +#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" @@ -58,33 +62,28 @@ static bfd_boolean coff_m68k_aux_link_add_one_symbol what you include in the shared object. */ static bfd_boolean -coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, - string, copy, collect, hashp) - struct bfd_link_info *info; - bfd *abfd; - const char *name; - flagword flags; - asection *section; - bfd_vma value; - const char *string; - bfd_boolean copy; - bfd_boolean collect; - struct bfd_link_hash_entry **hashp; +coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info, + bfd *abfd, + const char *name, + flagword flags, + asection *section, + bfd_vma value, + const char *string, + bfd_boolean copy, + bfd_boolean collect, + struct bfd_link_hash_entry **hashp) { - struct bfd_link_hash_entry *h; + struct bfd_link_hash_entry *h, *inh, *t; - if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0 && - !bfd_is_und_section (section) && - !bfd_is_com_section (section)) + if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0 + && !bfd_is_und_section (section) + && !bfd_is_com_section (section)) { /* The new symbol is a definition or an indirect definition */ /* This bit copied from linker.c */ if (hashp != NULL && *hashp != NULL) - { - h = *hashp; - BFD_ASSERT (strcmp (h->root.string, name) == 0); - } + h = *hashp; else { h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE); @@ -96,36 +95,46 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, } } - if (info->notice_hash != (struct bfd_hash_table *) NULL - && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) - != (struct bfd_hash_entry *) NULL)) - { - if (! (*info->callbacks->notice) (info, name, abfd, section, value)) - return FALSE; - } - if (hashp != (struct bfd_link_hash_entry **) NULL) *hashp = h; /* end duplication from linker.c */ - if (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_indirect) + t = h; + inh = NULL; + if (h->type == bfd_link_hash_indirect) { - asection *msec; + inh = h->u.i.link; + t = inh; + } - if (h->type == bfd_link_hash_defined) - msec = h->u.def.section; - else - msec = bfd_ind_section_ptr; + if (t->type == bfd_link_hash_defined) + { + asection *msec = t->u.def.section; + bfd_boolean special = FALSE; if (bfd_is_abs_section (msec) && !bfd_is_abs_section (section)) { - h->u.def.section = section; - h->u.def.value = value; - return TRUE; + t->u.def.section = section; + t->u.def.value = value; + special = TRUE; } else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec)) - return TRUE; + special = TRUE; + + if (special) + { + if (info->notice_all + || (info->notice_hash != NULL + && bfd_hash_lookup (info->notice_hash, name, + FALSE, FALSE) != NULL)) + { + if (!(*info->callbacks->notice) (info, h, inh, + abfd, section, value, flags)) + return FALSE; + } + + return TRUE; + } } }