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]

Re: .line/.ln Directive


Nick,

Yes that worked.  Thanks!

Tracy


Nick Clifton wrote:

> Hi Tracy,
>
> > Given the following assembly source file:
> >         .text
> >         nop
> >         .appline 5
> >         nop
> >         .line 10
> >         nop
> >         .ln 15
> >         .end
> >
> > I get the error
> > line_test.s: Assembler messages:
> > line_test.s:5: Internal error, aborting at /src/gas/config/obj-coff.c line
> > 446 in add_lineno
> >
> > I am using binutils 2.11 with the following configuration.
> > configure --host=sparc-sun-solaris2.6 --target=sparc-sun-coff
> > --norecursion
>
> > I have tracked this down, and I believe that the problem can be
> > resolved with the following patch,which sets the appline argument to
> > 1 so that these directives are treated  as an .appline.
>
> Well that will remove the bug, but it is not the right thing to do.
> The .appline pseudo op has slightly different semantics to the .ln
> directive, so changing the argument to 1 is incorrect.
>
> Instead, please could you try this patch.  It fixes the problem by
> detecting the situation where the .ln directive is being used outside
> of a function.  Normally these directives only make sense when
> functions are being created, since they get attached to symbols inside
> the function.  The test case however, does not define a function and
> so triggers the abort.
>
> Cheers
>         Nick
>
> 2001-06-28  Nick Clifton  <nickc@cambridge.redhat.com>
>
>         * config/obj-coff.c (obj_coff_ln): Treat a .ln directive
>         outside of a function as a .appline directive.
>
> Index: gas/config/obj-coff.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/obj-coff.c,v
> retrieving revision 1.48
> diff -p -r1.48 obj-coff.c
> *** obj-coff.c  2001/06/10 14:07:11     1.48
> --- obj-coff.c  2001/06/28 17:32:14
> *************** obj_coff_ln (appline)
> *** 493,505 ****
>       }
>
>     l = get_absolute_expression ();
> -   if (!appline)
> -     {
> -       add_lineno (frag_now, frag_now_fix (), l);
> -     }
>
> !   if (appline)
>       new_logical_line ((char *) NULL, l - 1);
>
>   #ifndef NO_LISTING
>     {
> --- 493,505 ----
>       }
>
>     l = get_absolute_expression ();
>
> !   /* If there is no lineno symbol, treat a .ln
> !      directive as if it were a .appline directive.  */
> !   if (appline || current_lineno_sym == NULL)
>       new_logical_line ((char *) NULL, l - 1);
> +   else
> +     add_lineno (frag_now, frag_now_fix (), l);
>
>   #ifndef NO_LISTING
>     {


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