{
const char *name;
size_t len;
+ expressionS size = { .X_op = O_constant };
/* Skip warning constructs (see above). */
if (symbol_get_bfdsym (symp)->flags & BSF_WARNING)
if (!S_IS_DEFINED (symp) || !S_IS_FUNCTION (symp))
continue;
+#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
+ size.X_add_number = S_GET_SIZE (symp);
+ if (size.X_add_number == 0 && IS_ELF
+ && symbol_get_obj (symp)->size != NULL)
+ {
+ size.X_op = O_add;
+ size.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
+ }
+#endif
+ if (size.X_op == O_constant && size.X_add_number == 0)
+ continue;
+
subseg_set (str_seg, 0);
name_sym = symbol_temp_new_now_octets ();
name = S_GET_NAME (symp);
emit_expr (&exp, sizeof_address);
/* DW_AT_high_pc */
- exp.X_op = O_constant;
-#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
- exp.X_add_number = S_GET_SIZE (symp);
- if (exp.X_add_number == 0 && IS_ELF
- && symbol_get_obj (symp)->size != NULL)
- {
- exp.X_op = O_add;
- exp.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
- }
-#else
- exp.X_add_number = 0;
-#endif
if (DWARF2_VERSION < 4)
{
- if (exp.X_op == O_constant)
- exp.X_op = O_symbol;
- exp.X_add_symbol = symp;
- emit_expr (&exp, sizeof_address);
+ if (size.X_op == O_constant)
+ size.X_op = O_symbol;
+ size.X_add_symbol = symp;
+ emit_expr (&size, sizeof_address);
}
- else if (exp.X_op == O_constant)
- out_uleb128 (exp.X_add_number);
+ else if (size.X_op == O_constant)
+ out_uleb128 (size.X_add_number);
else
- emit_leb128_expr (symbol_get_value_expression (exp.X_op_symbol), 0);
+ emit_leb128_expr (symbol_get_value_expression (size.X_op_symbol), 0);
}
/* End of children. */