From: Alan Modra Date: Fri, 27 Jun 2014 01:24:03 +0000 (+0930) Subject: Avoid cascading errors due to write_object_file change X-Git-Tag: binutils-2_25~926 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a03f9b1acf6cb11689f053892919b8ab675713f8;p=external%2Fbinutils.git Avoid cascading errors due to write_object_file change * config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Don't set SYM_MACHO_FIELDS_NOT_VALIDATED after reporting an error. (obj_mach_o_frob_label): Avoid cascading errors. (obj_mach_o_frob_symbol): Don't set SYM_MACHO_FIELDS_NOT_VALIDATED. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index ae4c486..67d19b5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-06-27 Alan Modra + + * config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Don't set + SYM_MACHO_FIELDS_NOT_VALIDATED after reporting an error. + (obj_mach_o_frob_label): Avoid cascading errors. + (obj_mach_o_frob_symbol): Don't set SYM_MACHO_FIELDS_NOT_VALIDATED. + 2014-06-18 DJ Delorie * config/rx-parse.y (BSET, BCLR, BTST, BNOT, BMCMD): Make .B diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index ec29847..fcf1729 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -1013,7 +1013,6 @@ obj_mach_o_set_symbol_qualifier (symbolS *sym, int type) bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *) symbol_get_bfdsym (sym); bfd_mach_o_section *sec; int sectype = -1; - int err = 0; /* If the symbol is defined, then we can do more rigorous checking on the validity of the qualifiers. Otherwise, we are stuck with waiting @@ -1041,7 +1040,8 @@ obj_mach_o_set_symbol_qualifier (symbolS *sym, int type) as_bad (_("'%s' previously declared as '%s'."), s->symbol.name, (s->n_type & BFD_MACH_O_N_PEXT) ? "private extern" : "global" ); - err = 1; + s->symbol.udata.i = SYM_MACHO_FIELDS_UNSET; + return 1; } else { @@ -1092,7 +1092,8 @@ obj_mach_o_set_symbol_qualifier (symbolS *sym, int type) as_bad (_("'%s' can't be a weak_definition (currently only" " supported in sections of type coalesced)"), s->symbol.name); - err = 1; + s->symbol.udata.i = SYM_MACHO_FIELDS_UNSET; + return 1; } else s->n_desc |= BFD_MACH_O_N_WEAK_DEF; @@ -1111,7 +1112,7 @@ obj_mach_o_set_symbol_qualifier (symbolS *sym, int type) /* We've seen some kind of qualifier - check validity if or when the entity is defined. */ s->symbol.udata.i = SYM_MACHO_FIELDS_NOT_VALIDATED; - return err; + return 0; } /* Respond to symbol qualifiers. @@ -1409,8 +1410,12 @@ void obj_mach_o_frob_label (struct symbol *sp) { if ((s->n_desc & BFD_MACH_O_N_WEAK_DEF) && sectype != BFD_MACH_O_S_COALESCED) - as_bad (_("'%s' can't be a weak_definition (currently only supported" - " in sections of type coalesced)"), s->symbol.name); + { + as_bad (_("'%s' can't be a weak_definition (currently only supported" + " in sections of type coalesced)"), s->symbol.name); + /* Don't cascade errors. */ + s->symbol.udata.i = SYM_MACHO_FIELDS_UNSET; + } /* Have we changed from an undefined to defined ref? */ s->n_desc &= ~(REFE | LAZY); @@ -1480,7 +1485,6 @@ obj_mach_o_frob_symbol (struct symbol *sp) { /* Anything here that should be added that is non-standard. */ s->n_desc &= ~BFD_MACH_O_REFERENCE_MASK; - s->symbol.udata.i = SYM_MACHO_FIELDS_NOT_VALIDATED; } else if (s->symbol.udata.i == SYM_MACHO_FIELDS_NOT_VALIDATED) {