This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Emitting line number debug info for non-code sections
- To: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Subject: Emitting line number debug info for non-code sections
- From: Geoff Berry <geoffb at bops dot com>
- Date: Tue, 11 Sep 2001 14:30:58 -0400
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: