a label attached to the instruction. By "attached" we mean
on the same source line as the instruction and without any
intervening semicolons. */
- dot_value = frag_now_fix ();
- dot_frag = frag_now;
+ symbol_set_value_now (&dot_symbol);
for (l = insn_labels; l != NULL; l = l->next)
{
- symbol_set_frag (l->label, dot_frag);
- S_SET_VALUE (l->label, dot_value);
+ addressT value;
+
+ symbol_set_frag (l->label,
+ symbol_get_frag_and_value (&dot_symbol, &value));
+ S_SET_VALUE (l->label, value);
}
}
/* Save the value of dot for the fixup code. */
if (rank == 0)
- {
- dot_value = frag_now_fix ();
- dot_frag = frag_now;
- }
+ symbol_set_value_now (&dot_symbol);
retval = operand (resultP, mode);
return;
frag_grow (nbytes);
- dot_value = frag_now_fix ();
- dot_frag = frag_now;
+ symbol_set_value_now (&dot_symbol);
#ifndef NO_LISTING
#ifdef OBJ_ELF
return s->frag;
}
+/* Return the frag of a symbol and the symbol's offset into that frag. */
+
+fragS *symbol_get_frag_and_value (const symbolS *s, addressT *value)
+{
+ if (s->flags.local_symbol)
+ {
+ const struct local_symbol *locsym = (const struct local_symbol *) s;
+
+ *value = locsym->value;
+ return locsym->frag;
+ }
+
+ gas_assert (s->x->value.X_op == O_constant);
+ *value = s->x->value.X_add_number;
+ return s->frag;
+}
+
/* Mark a symbol as having been used. */
void
extern void symbol_set_value_now (symbolS *);
extern void symbol_set_frag (symbolS *, fragS *);
extern fragS *symbol_get_frag (const symbolS *);
+extern fragS *symbol_get_frag_and_value (const symbolS *, addressT *);
extern void symbol_mark_used (symbolS *);
extern void symbol_clear_used (symbolS *);
extern int symbol_used_p (const symbolS *);
symbolS *abs_section_sym;
-/* Remember the value of dot when parsing expressions. */
-addressT dot_value;
-
-/* The frag that dot_value is based from. */
-fragS *dot_frag;
-
/* Relocs generated by ".reloc" pseudo. */
struct reloc_list* reloc_list;
fixP->fx_addsy = add_symbol;
fixP->fx_subsy = sub_symbol;
fixP->fx_offset = offset;
- fixP->fx_dot_value = dot_value;
- fixP->fx_dot_frag = dot_frag;
+ fixP->fx_dot_frag = symbol_get_frag_and_value (&dot_symbol,
+ &fixP->fx_dot_value);
fixP->fx_pcrel = pcrel;
fixP->fx_r_type = r_type;
fixP->fx_pcrel_adjust = 0;
extern int finalize_syms;
extern symbolS *abs_section_sym;
-extern addressT dot_value;
-extern fragS *dot_frag;
extern struct reloc_list* reloc_list;
extern void append (char **, char *, unsigned long);