diff options
author | Nick Clifton <nickc@redhat.com> | 2020-11-12 11:43:20 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-11-12 11:43:20 +0000 |
commit | bcb78b47614ed252226da1a688558a17d8a99ce8 (patch) | |
tree | 18d3480d3cb634ae6c431ef27e1b338ccecfbe84 /gas/testsuite | |
parent | ab33b15255460ac45a001c8ebf69ef73f6f1fba4 (diff) | |
download | gdb-bcb78b47614ed252226da1a688558a17d8a99ce8.zip gdb-bcb78b47614ed252226da1a688558a17d8a99ce8.tar.gz gdb-bcb78b47614ed252226da1a688558a17d8a99ce8.tar.bz2 |
Stop Gas from generating line info or address ranges for sections that do not contain code or are not loaded.
PR 26850
* dwarf2dbg.c (dwarf2_gen_line_info_1): Do not record lines in
sections that are not executable or not loadable.
(out_debug_line): Move warning message into dwarf2_gen_line_info_1.
* testsuite/gas/elf/dwarf2-20.s: New test.
* testsuite/gas/elf/dwarf2-20.d: New test driver.
* testsuite/gas/elf/elf.exp: Run the new test.
* testsuite/gas/elf/warn-2.s: Use the .nop directive.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/elf/dwarf2-20.d | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/elf/dwarf2-20.s | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/elf/elf.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/elf/warn-2.s | 15 |
4 files changed, 31 insertions, 13 deletions
diff --git a/gas/testsuite/gas/elf/dwarf2-20.d b/gas/testsuite/gas/elf/dwarf2-20.d new file mode 100644 index 0000000..363510a --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf2-20.d @@ -0,0 +1,18 @@ +#as: -gdwarf-3 +#readelf: -wr +#name: DWARF2_20: debug ranges ignore non-code sections +# The mn10200 target has a pointer size of 3, but it does not use segment selectors. This confuses DWARF and readelf will complain. +#xfail: mn102*-* + +Contents of the .debug_aranges section: + +[ ]+Length:[ ]+(16|28|44) +[ ]+Version:.* +[ ]+Offset into .debug_info:[ ]+0x0 +[ ]+Pointer Size:[ ]+(2|4|8) +[ ]+Segment Size:[ ]+0 + +[ ]+Address[ ]+Length +[ ]+0+000 0+00. +[ ]+0+000 0+000 +#pass diff --git a/gas/testsuite/gas/elf/dwarf2-20.s b/gas/testsuite/gas/elf/dwarf2-20.s new file mode 100644 index 0000000..0ad0cc3 --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf2-20.s @@ -0,0 +1,10 @@ + .section .alloc0,"a" + .nop + .section .alloc1,"a" + .nop + .section .nonalloc,"" + .nop + .section .allocexec,"ax" + .nop + .section .nonallocexec,"x" + .nop diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index 9d75154..edacf27 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -282,6 +282,7 @@ if { [is_elf_format] } then { run_dump_test "dwarf2-17" $dump_opts run_dump_test "dwarf2-18" $dump_opts run_dump_test "dwarf2-19" $dump_opts + run_dump_test "dwarf2-20" $dump_opts run_dump_test "dwarf-5-file0" $dump_opts run_dump_test "dwarf-4-cu" $dump_opts run_dump_test "dwarf-5-cu" $dump_opts diff --git a/gas/testsuite/gas/elf/warn-2.s b/gas/testsuite/gas/elf/warn-2.s index 79d6205..8a128a1 100644 --- a/gas/testsuite/gas/elf/warn-2.s +++ b/gas/testsuite/gas/elf/warn-2.s @@ -1,18 +1,7 @@ ;# { dg-do assemble } -;# { dg-options "--gdwarf2 --defsym nop_type=0" } -;# { dg-options "--gdwarf2 --defsym nop_type=1" { target ia64-*-* } } -;# { dg-options "--gdwarf2 --defsym nop_type=2" { target or1k*-*-* } } +;# { dg-options "--gdwarf2" } .offset 40 - - .ifeq nop_type - 1 - nop 0 - .else - .ifeq nop_type - 2 - l.nop 0 - .else - nop - .endif - .endif + .nop ;# { dg-warning "Warning: dwarf line number information for .* ignored" "" { xfail v850*-*-* } 0 } |