|| S_IS_COMMON (symbolP)
|| S_IS_VOLATILE (symbolP))
{
- if (S_IS_VOLATILE (symbolP)
- /* This could be avoided when the symbol wasn't used so far, but
- the comment in struc-symbol.h says this flag isn't reliable. */
- && (1 || !symbol_used_p (symbolP)))
+ if (S_IS_VOLATILE (symbolP))
{
symbolP = symbol_clone (symbolP, 1);
S_SET_VALUE (symbolP, 0);
&& S_IS_EXTERNAL (symbolP))
|| S_GET_SEGMENT (symbolP) == bss_section)
&& (now_seg == data_section
+ || now_seg == bss_section
|| now_seg == S_GET_SEGMENT (symbolP)))
{
/* Select which of the 2 cases this is. */
sub-expressions used. */
int
-snapshot_symbol (symbolS *symbolP, valueT *valueP, segT *segP, fragS **fragPP)
+snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP)
{
+ symbolS *symbolP = *symbolPP;
+
if (LOCAL_SYMBOL_CHECK (symbolP))
{
struct local_symbol *locsym = (struct local_symbol *) symbolP;
{
case O_constant:
case O_register:
- /* This check wouldn't be needed if pseudo_set() didn't set
- symbols equated to bare symbols to undefined_section. */
- if (symbolP->bsym->section != undefined_section
- || symbolP->sy_value.X_op != O_symbol)
+ if (!symbol_equated_p (symbolP))
break;
/* Fall thru. */
case O_symbol:
}
}
+ /* Never change a defined symbol. */
+ if (symbolP->bsym->section == undefined_section
+ || symbolP->bsym->section == expr_section)
+ *symbolPP = symbolP;
*valueP = expr.X_add_number;
*segP = symbolP->bsym->section;
*fragPP = symbolP->sy_frag;