/* dwarf2dbg.c - DWARF2 debug support
- Copyright (C) 1999-2017 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of GAS, the GNU Assembler.
{
expressionS exp;
+ memset (&exp, 0, sizeof exp);
exp.X_op = O_symbol;
exp.X_add_symbol = symbol;
exp.X_add_number = 0;
if (view_assert_failed)
{
expressionS chk;
+
memset (&chk, 0, sizeof (chk));
chk.X_unsigned = 1;
chk.X_op = O_add;
if (!S_IS_DEFINED (e->loc.view))
{
symbol_set_value_expression (e->loc.view, &viewx);
- S_SET_SEGMENT (e->loc.view, absolute_section);
+ S_SET_SEGMENT (e->loc.view, expr_section);
symbol_set_frag (e->loc.view, &zero_address_frag);
}
| DWARF2_FLAG_PROLOGUE_END
| DWARF2_FLAG_EPILOGUE_BEGIN);
current.discriminator = 0;
+ current.view = NULL;
}
/* Called for each (preferably code) label. If dwarf2_loc_mark_labels
- Pass .file "source.c" to s_app_file
- Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table
- If an entry is added to the file table, return a pointer to the filename. */
+ If an entry is added to the file table, return a pointer to the filename. */
char *
-dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
+dwarf2_directive_filename (void)
{
offsetT num;
char *filename;
return filename;
}
+/* Calls dwarf2_directive_filename, but discards its result.
+ Used in pseudo-op tables where the function result is ignored. */
+
+void
+dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
+{
+ (void) dwarf2_directive_filename ();
+}
+
void
dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
{
if (!name)
return;
sym = symbol_find_or_make (name);
- if (S_IS_DEFINED (sym))
+ if (S_IS_DEFINED (sym) || symbol_equated_p (sym))
{
- if (!S_CAN_BE_REDEFINED (sym))
- as_bad (_("symbol `%s' is already defined"), name);
- else
+ if (S_IS_VOLATILE (sym))
sym = symbol_clone (sym, 1);
- S_SET_SEGMENT (sym, undefined_section);
- S_SET_VALUE (sym, 0);
- symbol_set_frag (sym, &zero_address_frag);
+ else if (!S_CAN_BE_REDEFINED (sym))
+ {
+ as_bad (_("symbol `%s' is already defined"), name);
+ return;
+ }
}
+ S_SET_SEGMENT (sym, undefined_section);
+ S_SET_VALUE (sym, 0);
+ symbol_set_frag (sym, &zero_address_frag);
}
current.view = sym;
}
{
expressionS exp;
+ memset (&exp, 0, sizeof exp);
out_opcode (DW_LNS_extended_op);
out_uleb128 (sizeof_address + 1);
symbolS *to_sym;
expressionS exp;
+ memset (&exp, 0, sizeof exp);
gas_assert (pexp->X_op == O_subtract);
to_sym = pexp->X_add_symbol;
expressionS exp;
int max_chars;
+ memset (&exp, 0, sizeof exp);
exp.X_op = O_subtract;
exp.X_add_symbol = to_sym;
exp.X_op_symbol = from_sym;
struct line_seg *s;
int sizeof_offset;
+ memset (&exp, 0, sizeof exp);
sizeof_offset = out_header (line_seg, &exp);
line_end = exp.X_add_symbol;
expressionS exp;
unsigned int i;
+ memset (&exp, 0, sizeof exp);
subseg_set (ranges_seg, 0);
/* Base Address Entry. */
char *p;
int sizeof_offset;
+ memset (&exp, 0, sizeof exp);
sizeof_offset = out_header (aranges_seg, &exp);
aranges_end = exp.X_add_symbol;
size = -exp.X_add_number;
symbolS *info_end;
int sizeof_offset;
+ memset (&exp, 0, sizeof exp);
sizeof_offset = out_header (info_seg, &exp);
info_end = exp.X_add_symbol;
holding the check value in X_op_symbol. */
while (view_assert_failed)
{
- expressionS *expr;
+ expressionS *exp;
symbolS *sym;
offsetT failed;
gas_assert (!symbol_resolved_p (view_assert_failed));
- expr = symbol_get_value_expression (view_assert_failed);
+ exp = symbol_get_value_expression (view_assert_failed);
sym = view_assert_failed;
/* If view_assert_failed looks like a compound check in the
chain, break it up. */
- if (expr->X_op == O_add && expr->X_add_number == 0 && expr->X_unsigned)
+ if (exp->X_op == O_add && exp->X_add_number == 0 && exp->X_unsigned)
{
- view_assert_failed = expr->X_add_symbol;
- sym = expr->X_op_symbol;
+ view_assert_failed = exp->X_add_symbol;
+ sym = exp->X_op_symbol;
}
else
view_assert_failed = NULL;