aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-06-27 10:54:03 +0930
committerAlan Modra <amodra@gmail.com>2014-06-28 00:20:14 +0930
commita03f9b1acf6cb11689f053892919b8ab675713f8 (patch)
tree22cecae0a0c619bb66de122cda53163c851e435a
parentb67a2c6fd4862b79c04c254fe2ba37c180b73d60 (diff)
downloadgdb-a03f9b1acf6cb11689f053892919b8ab675713f8.zip
gdb-a03f9b1acf6cb11689f053892919b8ab675713f8.tar.gz
gdb-a03f9b1acf6cb11689f053892919b8ab675713f8.tar.bz2
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.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/obj-macho.c18
2 files changed, 18 insertions, 7 deletions
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 <amodra@gmail.com>
+
+ * 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 <dj@redhat.com>
* 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)
{