From 0f8f0c57ea4742ad2d9b0598a18243331c1c06e3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 23 Feb 2015 14:53:02 +0000 Subject: Fixes the generation of dwarf line debug information for the msp430, even in the presence of function sections and linker garbage collection. PR 17940 * dwarf2dbg.c (out_header): When generating dwarf sections use real symbols not temps for the start and end symbols. * config/tc-msp430.h (TC_FORCE_RELOCATION_SUB_SAME): Also prevent adjustments to relocations in debug sections. (TC_LINKRELAX_FIXUP): Likewise. * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug symbols at end of sections. Adjust function sizes. --- gas/dwarf2dbg.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'gas/dwarf2dbg.c') diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 5dfd980..9177bdf 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1467,8 +1467,22 @@ out_header (asection *sec, expressionS *exp) symbolS *end_sym; subseg_set (sec, 0); - start_sym = symbol_temp_new_now (); - end_sym = symbol_temp_make (); +#if 1 + if (flag_dwarf_sections) + { + /* If we are going to put the start and end symbols in different + sections, then we need real symbols, not just fake, local ones. */ + frag_now_fix (); + start_sym = symbol_make (".Ldebug_line_start"); + end_sym = symbol_make (".Ldebug_line_end"); + symbol_set_value_now (start_sym); + } + else +#endif + { + start_sym = symbol_temp_new_now (); + end_sym = symbol_temp_make (); + } /* Total length of the information. */ exp->X_op = O_subtract; -- cgit v1.1