This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
obj_coff_loc Internal Error
- To: binutils List <binutils at sourceware dot cygnus dot com>
- Subject: obj_coff_loc Internal Error
- From: Tracy Kuhrt <Tracy dot Kuhrt at microchip dot com>
- Date: Fri, 07 Sep 2001 11:38:37 -0700
The following creates an internal error in obj_coff_loc:
.loc 1, 200
/home/users/kuhrtt/tmp/loc.s: Assembler messages:
/home/users/kuhrtt/tmp/loc.s:1: Error: Rest of line ignored. First
ignored character is `,'.
/home/users/kuhrtt/tmp/loc.s:1: Internal error, aborting at
/opt/gnudev/roadrunner/src/gnu/acme/gas/config/obj-coff.c line 446 in
add_lineno
The following configure line was used to configure binutils:
../src/configure --target=sparc-sun-coff
There are actually two problems here
1. Even though loc accepts two arguments, it does not allow for the
arguments to be separated by a comma.
2. The internal error.
Following is a patch that I think solves the problems. NOTE: I have
moved the add_lineno before the listing code. I am not sure if this is
correct.
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/gas/config/obj-coff.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 obj-coff.c
--- gas/config/obj-coff.c 27 Jul 2001 21:46:28 -0000 1.1.1.4
+++ gas/config/obj-coff.c 7 Sep 2001 18:14:11 -0000
@@ -545,10 +545,24 @@ obj_coff_loc (ignore)
/* Skip the file number. */
SKIP_WHITESPACE ();
get_absolute_expression ();
+
+ /* Skip the comma if it exists; otherwise, give warning. */
+ if (*input_line_pointer == ',')
+ input_line_pointer++;
+ else
+ as_warn (_("missing comma assumed."));
+
SKIP_WHITESPACE ();
lineno = get_absolute_expression ();
+ /* If there is no lineno symbol, treat a .loc directive as if it were
a
+ .appline directive. */
+ if (current_lineno_sym == NULL)
+ new_logical_line ((char *) NULL, lineno - 1);
+ else
+ add_lineno (frag_now, frag_now_fix (), lineno);
+
#ifndef NO_LISTING
{
extern int listing;
@@ -562,8 +576,6 @@ obj_coff_loc (ignore)
#endif
demand_empty_rest_of_line ();
-
- add_lineno (frag_now, frag_now_fix (), lineno);
}
/* Handle the .ident pseudo-op. */