aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-02-23 14:53:02 +0000
committerNick Clifton <nickc@redhat.com>2015-02-23 14:53:02 +0000
commit0f8f0c57ea4742ad2d9b0598a18243331c1c06e3 (patch)
treef5a577adf5af444ca801d78171ea669dc05dee9b /gas
parent8f3102ea1a9954ed00f84a9e3452a79e94953840 (diff)
downloadfsf-binutils-gdb-0f8f0c57ea4742ad2d9b0598a18243331c1c06e3.zip
fsf-binutils-gdb-0f8f0c57ea4742ad2d9b0598a18243331c1c06e3.tar.gz
fsf-binutils-gdb-0f8f0c57ea4742ad2d9b0598a18243331c1c06e3.tar.bz2
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-msp430.h5
-rw-r--r--gas/dwarf2dbg.c18
3 files changed, 28 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fe711bf..93dd2dd 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-23 Nick Clifton <nickc@redhat.com>
+
+ 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.
+
2015-02-19 Alan Modra <amodra@gmail.com>
* doc/as.texinfo (Local Symbol Names): Don't use ':' in pxref.
diff --git a/gas/config/tc-msp430.h b/gas/config/tc-msp430.h
index 657dc1a..08115ac 100644
--- a/gas/config/tc-msp430.h
+++ b/gas/config/tc-msp430.h
@@ -159,7 +159,8 @@ extern bfd_boolean msp430_allow_local_subtract (expressionS *, expressionS *, se
linker, but this fix is simpler, and it pretty much only affects
object size a little bit. */
#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
- (((SEC)->flags & SEC_CODE) != 0 \
+ ( ((SEC)->flags & SEC_CODE) != 0 \
+ || ((SEC)->flags & SEC_DEBUGGING) != 0 \
|| ! SEG_NORMAL (SEC) \
|| TC_FORCE_RELOCATION (FIX))
@@ -169,4 +170,4 @@ extern bfd_boolean msp430_allow_local_subtract (expressionS *, expressionS *, se
#define DWARF2_USE_FIXED_ADVANCE_PC 1
-#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_CODE)
+#define TC_LINKRELAX_FIXUP(seg) ((seg->flags & SEC_CODE) || (seg->flags & SEC_DEBUGGING))
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;