public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* obj_coff_loc Internal Error
@ 2001-09-07 11:38 Tracy Kuhrt
  2001-09-10 10:37 ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: Tracy Kuhrt @ 2001-09-07 11:38 UTC (permalink / raw)
  To: binutils List

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.  */


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-09-10 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07 11:38 obj_coff_loc Internal Error Tracy Kuhrt
2001-09-10 10:37 ` Nick Clifton
2001-09-10 10:54   ` Tracy Kuhrt
2001-09-10 13:21     ` Nick Clifton
2001-09-10 13:35       ` Tracy Kuhrt
2001-09-10 15:43         ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).