This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GAS] fix crash on erroneous directive
On 07/27/11 15:04, Andreas Schwab wrote:
You could define a symbol and then use to the right nop depending on the
symbol's value.
like this?
--
Nathan Sidwell
2011-07-27 Nathan Sidwell <nathan@codesourcery.com>
* dwarf2dbg.c (out_debug_line): Ignore non-normal segments, with a
warning.
* doc/as.texinfo (Offset): Document .offset directive.
testsuite/
* gas/all/warn-2.s: New.
Index: dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.111
diff -c -3 -p -r1.111 dwarf2dbg.c
*** dwarf2dbg.c 31 Mar 2011 08:02:41 -0000 1.111
--- dwarf2dbg.c 28 Jul 2011 09:14:37 -0000
*************** out_debug_line (segT line_seg)
*** 1459,1465 ****
/* For each section, emit a statement program. */
for (s = all_segs; s; s = s->next)
! process_entries (s->seg, s->head->head);
symbol_set_value_now (line_end);
}
--- 1459,1469 ----
/* For each section, emit a statement program. */
for (s = all_segs; s; s = s->next)
! if (SEG_NORMAL (s->seg))
! process_entries (s->seg, s->head->head);
! else
! as_warn ("dwarf line number information for %s ignored",
! segment_name (s->seg));
symbol_set_value_now (line_end);
}
Index: doc/as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.238
diff -c -3 -p -r1.238 as.texinfo
*** doc/as.texinfo 24 Jul 2011 14:20:09 -0000 1.238
--- doc/as.texinfo 28 Jul 2011 09:14:40 -0000
*************** Some machine configurations provide addi
*** 4017,4022 ****
--- 4017,4023 ----
* Noaltmacro:: @code{.noaltmacro}
* Nolist:: @code{.nolist}
* Octa:: @code{.octa @var{bignums}}
+ * Offset:: @code{.offset @var{loc}}
* Org:: @code{.org @var{new-lc}, @var{fill}}
* P2align:: @code{.p2align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
@ifset ELF
*************** bignum, it emits a 16-byte integer.
*** 5480,5485 ****
--- 5481,5495 ----
The term ``octa'' comes from contexts in which a ``word'' is two bytes;
hence @emph{octa}-word for 16 bytes.
+ @node Offset
+ @section @code{.offset @var{loc}}
+
+ @cindex @code{offset} directive
+ Set the location counter to @var{loc} in the absolute section. @var{loc} must
+ be an absolute expression. This directive may be useful for defining
+ symbols with absolute values. Do not confuse it with the @code{.org}
+ directive.
+
@node Org
@section @code{.org @var{new-lc} , @var{fill}}
Index: testsuite/gas/all/warn-2.s
===================================================================
RCS file: testsuite/gas/all/warn-2.s
diff -N testsuite/gas/all/warn-2.s
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/gas/all/warn-2.s 28 Jul 2011 09:14:40 -0000
***************
*** 0 ****
--- 1,10 ----
+ ;# { dg-do assemble }
+ ;# { dg-options "--gdwarf2 --defsym ia64=0" }
+ ;# { dg-options "--gdwarf2 --defsym ia64=1" { target ia64-*-* } }
+ .offset 40
+ .ifeq ia64 - 1
+ nop 0
+ .else
+ nop
+ .endif
+ ;# { dg-warning "Warning: dwarf line number information for .* ignored" "" { target *-*-* } 0 }