This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Emitting line number debug info for non-code sections


Does the following patch make sense to apply?  I ran into a problem where
generate_lineno_debug was being called for a line in a data section that
contained a macro call.  On the target I'm working with, the text and data
segments get mapped to overlapping memory regions, so this could potentially
cause multiple line numbers to be emitted for the same address.

--- gas/read.c	Tue Sep 11 13:13:26 2001
+++ gas/read.c	Tue Sep 11 12:30:26 2001
@@ -5154,6 +4970,11 @@
 void
 generate_lineno_debug ()
 {
+  /* Don't generate line number debugging information if we aren't in
+     a code section. */
+  if (! subseg_text_p (now_seg))
+    return;
+
   switch (debug_type)
     {
     case DEBUG_UNSPECIFIED:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]