From 9aec20268e477ab268c345b58e6659b622028536 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 28 Jul 2011 16:35:48 +0000 Subject: [PATCH] * dwarf2dbg.c (out_debug_line): Ignore non-normal segments, with a warning. * doc/as.texinfo (Offset): Document .offset directive. testsuite/ * gas/elf/warn-2.s: New. --- gas/ChangeLog | 6 ++++++ gas/doc/as.texinfo | 10 ++++++++++ gas/dwarf2dbg.c | 6 +++++- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/elf/elf.exp | 6 ++++++ gas/testsuite/gas/elf/warn-2.s | 12 ++++++++++++ 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/elf/warn-2.s diff --git a/gas/ChangeLog b/gas/ChangeLog index bcafeb0455f..eff3b25e278 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2011-07-27 Nathan Sidwell + + * dwarf2dbg.c (out_debug_line): Ignore non-normal segments, with a + warning. + * doc/as.texinfo (Offset): Document .offset directive. + 2011-07-27 Tristan Gingold * frags.c (frag_grow): Revert previous patch. diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index b617b3ebca6..a2be539997c 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -4017,6 +4017,7 @@ Some machine configurations provide additional directives. * 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 @@ -5480,6 +5481,15 @@ bignum, it emits a 16-byte integer. 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}} diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 41fd01493eb..31bf31085a1 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1459,7 +1459,11 @@ out_debug_line (segT line_seg) /* For each section, emit a statement program. */ for (s = all_segs; s; s = s->next) - process_entries (s->seg, s->head->head); + 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); } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index a4ad91bdb70..568b1048a21 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-27 Nathan Sidwell + + * gas/elf/warn-2.s: New. + * gas/elf/elf.exp: Run the new test. + 2011-07-26 Kazuhiro Inaoka * gas/rx/r-bcc.d: Update expected disassembly of synthetic beq.a diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index 6eff0dd56be..0f5e97b7387 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -181,4 +181,10 @@ if { ([istarget "*-*-*elf*"] run_dump_test "dwarf2-4" run_dump_test "bad-section-flag" run_dump_test "bad-size" + +load_lib gas-dg.exp +dg-init +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" "" +dg-finish + } diff --git a/gas/testsuite/gas/elf/warn-2.s b/gas/testsuite/gas/elf/warn-2.s new file mode 100644 index 00000000000..0d69f100c33 --- /dev/null +++ b/gas/testsuite/gas/elf/warn-2.s @@ -0,0 +1,12 @@ +;# { dg-do assemble } +;# { dg-skip-if "DWARF2 output not supported" { mcore-*-* mn10*-*-* moxie-*-* v850-*-* } } +;# { dg-skip-if "no NOP opcode" { mmix-*-* openrisc-*-* or32-*-* } } +;# { dg-options "--gdwarf2 --defsym ia64=0" } +;# { dg-options "--gdwarf2 --defsym ia64=1" { target ia64-*-* i370-*-* } } + .offset 40 +.ifeq ia64 - 1 + nop 0 +.else + nop +.endif +;# { dg-warning "Warning: dwarf line number information for .* ignored" "" { target *-*-* } 0 } -- 2.30.2