From 72b6ce4b695acf13be90f47d24d5f49c0d2c58fc Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 21 Jul 2017 10:09:06 +0100 Subject: [PATCH] LVU: as installed after Nick's adjustments --- binutils/dwarf.c | 8 +-- gas/NEWS | 2 + gas/dwarf2dbg.c | 53 ++++++++++++----- gas/dwarf2dbg.h | 18 +++--- gas/testsuite/gas/all/sleb128-9.d | 3 +- .../gas/avr/large-debug-line-table.d | 2 +- gas/testsuite/gas/elf/dwarf2-10.d | 3 + gas/testsuite/gas/elf/dwarf2-11.d | 4 ++ gas/testsuite/gas/elf/dwarf2-11.s | 2 +- gas/testsuite/gas/elf/dwarf2-12.d | 5 ++ gas/testsuite/gas/elf/dwarf2-12.s | 2 +- gas/testsuite/gas/elf/dwarf2-13.d | 4 ++ gas/testsuite/gas/elf/dwarf2-13.s | 4 +- gas/testsuite/gas/elf/dwarf2-14.d | 4 ++ gas/testsuite/gas/elf/dwarf2-14.s | 2 +- gas/testsuite/gas/elf/dwarf2-15.d | 4 ++ gas/testsuite/gas/elf/dwarf2-15.s | 4 +- gas/testsuite/gas/elf/dwarf2-16.d | 5 ++ gas/testsuite/gas/elf/dwarf2-16.s | 4 +- gas/testsuite/gas/elf/dwarf2-17.d | 5 ++ gas/testsuite/gas/elf/dwarf2-17.s | 4 +- gas/testsuite/gas/elf/dwarf2-18.d | 4 ++ gas/testsuite/gas/elf/dwarf2-18.s | 4 +- gas/testsuite/gas/elf/dwarf2-5.d | 7 ++- gas/testsuite/gas/elf/dwarf2-5.s | 8 +-- gas/testsuite/gas/elf/dwarf2-6.d | 2 + gas/testsuite/gas/elf/dwarf2-7.d | 6 +- gas/testsuite/gas/elf/dwarf2-7.s | 2 +- gas/testsuite/gas/elf/dwarf2-8.d | 2 + gas/testsuite/gas/elf/dwarf2-9.d | 2 + gas/testsuite/gas/elf/dwarf2-9.l | 2 +- gas/testsuite/gas/lns/lns-common-1-alt.d | 16 ++--- gas/testsuite/gas/lns/lns-duplicate.d | 2 +- ld/testsuite/ld-avr/gc-section-debugline.d | 59 +++++++++---------- 34 files changed, 168 insertions(+), 90 deletions(-) diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 4e96b325d09..297f426ed56 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -431,8 +431,8 @@ typedef struct State_Machine_Registers int basic_block; unsigned char op_index; unsigned char end_sequence; -/* This variable hold the number of the last entry seen - in the File Table. */ + /* This variable hold the number of the last entry seen + in the File Table. */ unsigned int last_file_entry; } SMR; @@ -3397,8 +3397,8 @@ display_debug_lines_raw (struct dwarf_section *section, = ((state_machine_regs.op_index + uladv) / linfo.li_max_ops_per_insn) * linfo.li_min_insn_length; - state_machine_regs.address - += addrdelta; + + state_machine_regs.address += addrdelta; state_machine_regs.op_index = (state_machine_regs.op_index + uladv) % linfo.li_max_ops_per_insn; diff --git a/gas/NEWS b/gas/NEWS index ef44007c989..843f6c1120e 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -1,5 +1,7 @@ -*- text -*- +* Add support for loaction views in DWARF debug line information. + Changes in 2.29: * Add support for ELF SHF_GNU_MBIND. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index c3d6043ff0f..4f703304d52 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -162,7 +162,8 @@ #define TC_PARSE_CONS_RETURN_NONE BFD_RELOC_NONE #endif -struct line_entry { +struct line_entry +{ struct line_entry *next; symbolS *label; struct dwarf2_line_info loc; @@ -173,7 +174,8 @@ struct line_entry { static char unused[offsetof(struct line_entry, next) ? -1 : 1] ATTRIBUTE_UNUSED; -struct line_subseg { +struct line_subseg +{ struct line_subseg *next; subsegT subseg; struct line_entry *head; @@ -181,7 +183,8 @@ struct line_subseg { struct line_entry **pmove_tail; }; -struct line_seg { +struct line_seg +{ struct line_seg *next; segT seg; struct line_subseg *head; @@ -193,7 +196,8 @@ struct line_seg { static struct line_seg *all_segs; static struct line_seg **last_seg_ptr; -struct file_entry { +struct file_entry +{ const char *filename; unsigned int dir; }; @@ -217,7 +221,8 @@ bfd_boolean dwarf2_loc_directive_seen; bfd_boolean dwarf2_loc_mark_labels; /* Current location as indicated by the most recent .loc directive. */ -static struct dwarf2_line_info current = { +static struct dwarf2_line_info current = +{ 1, 1, 0, 0, DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0, 0, NULL @@ -302,6 +307,7 @@ static struct line_entry * reverse_line_entry_list (struct line_entry *h) { struct line_entry *p = NULL, *e, *n; + for (e = h; e; e = n) { n = e->next; @@ -314,14 +320,14 @@ reverse_line_entry_list (struct line_entry *h) /* Compute the view for E based on the previous entry P. If we introduce an (undefined) view symbol for P, and H is given (P must be the tail in this case), introduce view symbols for earlier list - entries as well, until one of them is constant. - */ + entries as well, until one of them is constant. */ static void set_or_check_view (struct line_entry *e, struct line_entry *p, struct line_entry *h) { expressionS viewx; + memset (&viewx, 0, sizeof (viewx)); viewx.X_unsigned = 1; @@ -387,13 +393,14 @@ set_or_check_view (struct line_entry *e, struct line_entry *p, if (viewx.X_op != O_constant || viewx.X_add_number) { + expressionS incv; + if (!p->loc.view) { p->loc.view = symbol_temp_make (); gas_assert (!S_IS_DEFINED (p->loc.view)); } - expressionS incv; memset (&incv, 0, sizeof (incv)); incv.X_unsigned = 1; incv.X_op = O_symbol; @@ -425,18 +432,22 @@ set_or_check_view (struct line_entry *e, struct line_entry *p, compute E's. */ if (h && p && p->loc.view && !S_IS_DEFINED (p->loc.view)) { + struct line_entry *h2; /* Reverse the list to avoid quadratic behavior going backwards in a single-linked list. */ struct line_entry *r = reverse_line_entry_list (h); + gas_assert (r == p); /* Set or check views until we find a defined or absent view. */ do set_or_check_view (r, r->next, NULL); while (r->next && r->next->loc.view && !S_IS_DEFINED (r->next->loc.view) && (r = r->next)); + /* Unreverse the list, so that we can go forward again. */ - struct line_entry *h2 = reverse_line_entry_list (p); + h2 = reverse_line_entry_list (p); gas_assert (h2 == h); + /* Starting from the last view we just defined, attempt to simplify the view expressions, until we do so to P. */ do @@ -525,8 +536,10 @@ dwarf2_where (struct dwarf2_line_info *line) { if (debug_type == DEBUG_DWARF2) { + const char *filename; + memset (line, 0, sizeof (*line)); - const char *filename = as_where (&line->line); + filename = as_where (&line->line); line->filenum = get_filenum (filename, 0); line->column = 0; line->flags = DWARF2_FLAG_IS_STMT; @@ -902,13 +915,16 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) } else if (strcmp (p, "view") == 0) { - (void) restore_line_pointer (c); symbolS *sym; + + (void) restore_line_pointer (c); SKIP_WHITESPACE (); + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') { bfd_boolean force_reset = *input_line_pointer == '-'; + value = get_absolute_expression (); if (value != 0) { @@ -928,6 +944,7 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) else { char *name = read_symbol_name (); + if (!name) return; sym = symbol_find_or_make (name); @@ -1591,8 +1608,8 @@ process_entries (segT seg, struct line_entry *e) if (last_frag == NULL || (e->loc.view == force_reset_view && force_reset_view - /* If we're to reset the view, but we know we're - advancing PC, we don't have to force with + /* If we're going to reset the view, but we know we're + advancing the PC, we don't have to force with set_address. We know we do when we're at the same address of the same frag, and we know we might when we're in the beginning of a frag, and we were at the @@ -2226,10 +2243,14 @@ dwarf2dbg_final_check (void) holding the check value in X_op_symbol. */ while (view_assert_failed) { + expressionS *expr; + symbolS *sym; + offsetT failed; + gas_assert (!symbol_resolved_p (view_assert_failed)); - expressionS *expr = symbol_get_value_expression (view_assert_failed); - symbolS *sym = view_assert_failed; + expr = symbol_get_value_expression (view_assert_failed); + sym = view_assert_failed; /* If view_assert_failed looks like a compound check in the chain, break it up. */ @@ -2241,7 +2262,7 @@ dwarf2dbg_final_check (void) else view_assert_failed = NULL; - offsetT failed = resolve_symbol_value (sym); + failed = resolve_symbol_value (sym); if (!symbol_resolved_p (sym) || failed) { as_bad (_("view number mismatch")); diff --git a/gas/dwarf2dbg.h b/gas/dwarf2dbg.h index 49826fd054a..60a05685ab9 100644 --- a/gas/dwarf2dbg.h +++ b/gas/dwarf2dbg.h @@ -28,7 +28,8 @@ #define DWARF2_FLAG_PROLOGUE_END (1 << 2) #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3) -struct dwarf2_line_info { +struct dwarf2_line_info +{ unsigned int filenum; unsigned int line; unsigned int column; @@ -41,7 +42,7 @@ struct dwarf2_line_info { /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 to indicate that no file number has been assigned. All real file number must be >0. */ -extern char *dwarf2_directive_file (int dummy); +extern char *dwarf2_directive_file (int); /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is the file number, LINENO the line number and the (optional) COLUMN @@ -49,27 +50,27 @@ extern char *dwarf2_directive_file (int dummy); corresponds to. FILENO can be 0 to indicate that the filename specified by the textually most recent .file directive should be used. */ -extern void dwarf2_directive_loc (int dummy); +extern void dwarf2_directive_loc (int); /* Implements the .loc_mark_labels {0,1} directive. */ -extern void dwarf2_directive_loc_mark_labels (int dummy); +extern void dwarf2_directive_loc_mark_labels (int); /* Returns the current source information. If .file directives have been encountered, the info for the corresponding source file is returned. Otherwise, the info for the assembly source file is returned. */ -extern void dwarf2_where (struct dwarf2_line_info *l); +extern void dwarf2_where (struct dwarf2_line_info *); /* A hook to allow the target backend to inform the line number state machine of isa changes when assembler debug info is enabled. */ -extern void dwarf2_set_isa (unsigned int isa); +extern void dwarf2_set_isa (unsigned int); /* This function generates .debug_line info based on the address and source information passed in the arguments. ADDR should be the frag-relative offset of the instruction the information is for and L is the source information that should be associated with that address. */ -extern void dwarf2_gen_line_info (addressT addr, struct dwarf2_line_info *l); +extern void dwarf2_gen_line_info (addressT, struct dwarf2_line_info *); /* Must be called for each generated instruction. */ extern void dwarf2_emit_insn (int); @@ -104,7 +105,8 @@ extern void dwarf2dbg_final_check (void); /* An enumeration which describes the sizes of offsets (to DWARF sections) and the mechanism by which the size is indicated. */ -enum dwarf2_format { +enum dwarf2_format +{ /* 32-bit format: the initial length field is 4 bytes long. */ dwarf2_format_32bit, /* DWARF3 64-bit format: the representation of the initial length diff --git a/gas/testsuite/gas/all/sleb128-9.d b/gas/testsuite/gas/all/sleb128-9.d index 16f81ca935d..5c5997f3786 100644 --- a/gas/testsuite/gas/all/sleb128-9.d +++ b/gas/testsuite/gas/all/sleb128-9.d @@ -1,4 +1,5 @@ #name: undefined symbols in sleb128 directive #source: sleb128-9.s #error-output: sleb128-9.l -#target: *-*-* +#not-target: riscv*-* + diff --git a/gas/testsuite/gas/avr/large-debug-line-table.d b/gas/testsuite/gas/avr/large-debug-line-table.d index 31ca7edd143..ecba3dfdd00 100644 --- a/gas/testsuite/gas/avr/large-debug-line-table.d +++ b/gas/testsuite/gas/avr/large-debug-line-table.d @@ -9,7 +9,7 @@ Decoded dump of debug contents of section \.debug_line: CU: large-debug-line-table\.c: -File name Line number Starting address +File name Line number Starting address.* large-debug-line-table\.c 1 0 #... diff --git a/gas/testsuite/gas/elf/dwarf2-10.d b/gas/testsuite/gas/elf/dwarf2-10.d index 4a4ef2c8419..13c3171e5a6 100644 --- a/gas/testsuite/gas/elf/dwarf2-10.d +++ b/gas/testsuite/gas/elf/dwarf2-10.d @@ -1,3 +1,6 @@ #as: #name: DWARF2 10 #error-output: dwarf2-10.l +# The mep target tries to relay code sections which breaks symbolic view computations. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: mep-* tile*-* diff --git a/gas/testsuite/gas/elf/dwarf2-11.d b/gas/testsuite/gas/elf/dwarf2-11.d index 04d447338c0..797d50d3682 100644 --- a/gas/testsuite/gas/elf/dwarf2-11.d +++ b/gas/testsuite/gas/elf/dwarf2-11.d @@ -1,6 +1,10 @@ #as: #readelf: -wL #name: DWARF2 11 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* m32c-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Decoded dump of debug contents of section \.debug_line: diff --git a/gas/testsuite/gas/elf/dwarf2-11.s b/gas/testsuite/gas/elf/dwarf2-11.s index 187def587be..a1b0d0a8b94 100644 --- a/gas/testsuite/gas/elf/dwarf2-11.s +++ b/gas/testsuite/gas/elf/dwarf2-11.s @@ -21,7 +21,7 @@ .globl _start _start: .file 1 "dwarf2-11.c" - .int 0 + .dc.l 0 .loc 1 1 view 0 .balign 8 .loc 1 2 view 0 diff --git a/gas/testsuite/gas/elf/dwarf2-12.d b/gas/testsuite/gas/elf/dwarf2-12.d index a58e374b033..0e1bc9b0cd1 100644 --- a/gas/testsuite/gas/elf/dwarf2-12.d +++ b/gas/testsuite/gas/elf/dwarf2-12.d @@ -1,6 +1,11 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 12 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* + Hex dump of section '\.rodata': 0x00000000 01 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-12.s b/gas/testsuite/gas/elf/dwarf2-12.s index 1a851d62f71..3e3392a6185 100644 --- a/gas/testsuite/gas/elf/dwarf2-12.s +++ b/gas/testsuite/gas/elf/dwarf2-12.s @@ -24,7 +24,7 @@ _start: .loc 1 1 view 0 .loc 1 2 view -0 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-13.d b/gas/testsuite/gas/elf/dwarf2-13.d index d8b6aba4211..6961a6b6421 100644 --- a/gas/testsuite/gas/elf/dwarf2-13.d +++ b/gas/testsuite/gas/elf/dwarf2-13.d @@ -1,6 +1,10 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 13 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-13.s b/gas/testsuite/gas/elf/dwarf2-13.s index c13f9d4ba74..118d692ce2b 100644 --- a/gas/testsuite/gas/elf/dwarf2-13.s +++ b/gas/testsuite/gas/elf/dwarf2-13.s @@ -21,12 +21,12 @@ .globl _start _start: .file 1 "dwarf2-13.c" - .int 0 + .dc.l 0 .loc 1 1 view 0 .balign 8 .loc 1 2 view -0 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-14.d b/gas/testsuite/gas/elf/dwarf2-14.d index dfb3c3b250c..88af1452ceb 100644 --- a/gas/testsuite/gas/elf/dwarf2-14.d +++ b/gas/testsuite/gas/elf/dwarf2-14.d @@ -1,6 +1,10 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 14 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-14.s b/gas/testsuite/gas/elf/dwarf2-14.s index 4dde965631d..80f91ffc634 100644 --- a/gas/testsuite/gas/elf/dwarf2-14.s +++ b/gas/testsuite/gas/elf/dwarf2-14.s @@ -25,7 +25,7 @@ _start: .balign 4 .loc 1 2 view -0 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-15.d b/gas/testsuite/gas/elf/dwarf2-15.d index eaf50c4425f..c7280e514ef 100644 --- a/gas/testsuite/gas/elf/dwarf2-15.d +++ b/gas/testsuite/gas/elf/dwarf2-15.d @@ -1,6 +1,10 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 15 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-15.s b/gas/testsuite/gas/elf/dwarf2-15.s index 1fbd594c567..e41f84aba41 100644 --- a/gas/testsuite/gas/elf/dwarf2-15.s +++ b/gas/testsuite/gas/elf/dwarf2-15.s @@ -22,10 +22,10 @@ _start: .file 1 "dwarf2-15.c" .loc 1 1 view 0 - .int 0 + .dc.l 0 .loc 1 2 view -0 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-16.d b/gas/testsuite/gas/elf/dwarf2-16.d index 44301a70b7c..b01292ecdb2 100644 --- a/gas/testsuite/gas/elf/dwarf2-16.d +++ b/gas/testsuite/gas/elf/dwarf2-16.d @@ -1,6 +1,11 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 16 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The mep target tries to relay code sections which breaks symbolic view computations. +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-16.s b/gas/testsuite/gas/elf/dwarf2-16.s index 7976614db79..deacf5638d0 100644 --- a/gas/testsuite/gas/elf/dwarf2-16.s +++ b/gas/testsuite/gas/elf/dwarf2-16.s @@ -22,11 +22,11 @@ _start: .file 1 "dwarf2-16.c" .loc 1 1 view 0 - .int 0 + .dc.l 0 .loc 1 2 view 0 .balign 4 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-17.d b/gas/testsuite/gas/elf/dwarf2-17.d index 5e7ccdc2877..8c5c287a7d9 100644 --- a/gas/testsuite/gas/elf/dwarf2-17.d +++ b/gas/testsuite/gas/elf/dwarf2-17.d @@ -1,6 +1,11 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 17 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The mep target tries to relay code sections which breaks symbolic view computations. +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 00 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-17.s b/gas/testsuite/gas/elf/dwarf2-17.s index 26c24cbf3ab..4e5d91bc10c 100644 --- a/gas/testsuite/gas/elf/dwarf2-17.s +++ b/gas/testsuite/gas/elf/dwarf2-17.s @@ -22,11 +22,11 @@ _start: .file 1 "dwarf2-17.c" .loc 1 1 view 0 - .int 0 + .dc.l 0 .loc 1 2 view 0 .balign 8 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-18.d b/gas/testsuite/gas/elf/dwarf2-18.d index d695072bb62..08f1af80267 100644 --- a/gas/testsuite/gas/elf/dwarf2-18.d +++ b/gas/testsuite/gas/elf/dwarf2-18.d @@ -1,6 +1,10 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 18 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 0100 *.* diff --git a/gas/testsuite/gas/elf/dwarf2-18.s b/gas/testsuite/gas/elf/dwarf2-18.s index f32b3b308e9..9e5e210b800 100644 --- a/gas/testsuite/gas/elf/dwarf2-18.s +++ b/gas/testsuite/gas/elf/dwarf2-18.s @@ -23,9 +23,9 @@ _start: .file 1 "dwarf2-18.c" .loc 1 1 .loc 1 2 view .L1 - .int 0 + .dc.l 0 .loc 1 3 view .L2 - .int 0 + .dc.l 0 .size _start, .-_start .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-5.d b/gas/testsuite/gas/elf/dwarf2-5.d index a4598ba3b5d..6525c2ee14e 100644 --- a/gas/testsuite/gas/elf/dwarf2-5.d +++ b/gas/testsuite/gas/elf/dwarf2-5.d @@ -1,11 +1,16 @@ #as: #readelf: -x.rodata -wlL #name: DWARF2 5 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 rx and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The mep target tries to relay code sections which breaks symbolic view computations. +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mep-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* rx-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01010201 010203 *.* -Raw dump of debug contents of section .debug_line: +Raw dump of debug contents of section \.debug_line: Offset: 0x0 Length: [0-9]* diff --git a/gas/testsuite/gas/elf/dwarf2-5.s b/gas/testsuite/gas/elf/dwarf2-5.s index 91b9f955565..3e58239f0ab 100644 --- a/gas/testsuite/gas/elf/dwarf2-5.s +++ b/gas/testsuite/gas/elf/dwarf2-5.s @@ -23,7 +23,7 @@ _start: .file 1 "dwarf2-5.c" .loc 1 1 view 0 .loc 1 2 view .L2 - .int 0 + .dc.l 0 .loc 1 3 view 0 .balign 4 .loc 1 4 view .L4 @@ -31,21 +31,21 @@ _start: .org .+1 .balign 4 .loc 1 6 view 0 - .int 0 + .dc.l 0 .text .globl func .type func, %function func: .loc 1 7 view 0 .loc 1 8 view .L8 - .int 0 + .dc.l 0 .loc 1 9 view 0 .loc 1 10 view .L10 .pushsection .text .loc 1 11 view .L11 .popsection .loc 1 12 view .L12 - .int 0 + .dc.l 0 .size func, .-func .section .rodata diff --git a/gas/testsuite/gas/elf/dwarf2-6.d b/gas/testsuite/gas/elf/dwarf2-6.d index 39557e162a5..93489d6ba9d 100644 --- a/gas/testsuite/gas/elf/dwarf2-6.d +++ b/gas/testsuite/gas/elf/dwarf2-6.d @@ -1,6 +1,8 @@ #as: #readelf: -wlL #name: DWARF2 6 +# These targets either do not support or do not evaluate the subtraction of symbols at assembly time +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* xtensa-* Raw dump of debug contents of section .debug_line: diff --git a/gas/testsuite/gas/elf/dwarf2-7.d b/gas/testsuite/gas/elf/dwarf2-7.d index d78d91ed69a..8782d6bc442 100644 --- a/gas/testsuite/gas/elf/dwarf2-7.d +++ b/gas/testsuite/gas/elf/dwarf2-7.d @@ -1,6 +1,10 @@ #as: #readelf: -x.rodata -wL #name: DWARF2 7 +# The am3 avr cr16 crx mn10 msp430 nds32 pru rl78 and xtensa targets do not evaluate the subtraction of symbols at assembly time +# The riscv targets do not support the subtraction of symbols. +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: am3-* avr-* cr16-* crx-* mn10*-* msp430-* nds32*-* pru-* riscv*-* rl78-* tile*-* xtensa-* Hex dump of section '\.rodata': 0x00000000 01 *.* @@ -12,4 +16,4 @@ File name *Line number *Starting address *View dwarf2-7\.c *1 *0 dwarf2-7\.c *2 *0 dwarf2-7\.c *3 *0 *1 -dwarf2-7\.c *3 *0x4 +dwarf2-7\.c *3 *0x. diff --git a/gas/testsuite/gas/elf/dwarf2-7.s b/gas/testsuite/gas/elf/dwarf2-7.s index d8fd0075333..e96e64e7fb9 100644 --- a/gas/testsuite/gas/elf/dwarf2-7.s +++ b/gas/testsuite/gas/elf/dwarf2-7.s @@ -32,5 +32,5 @@ _start: func: .loc 1 2 view -0 .loc 1 3 view .L1 - .int 0 + .dc.l 0 .size func, .-func diff --git a/gas/testsuite/gas/elf/dwarf2-8.d b/gas/testsuite/gas/elf/dwarf2-8.d index a28d613a954..455079d9512 100644 --- a/gas/testsuite/gas/elf/dwarf2-8.d +++ b/gas/testsuite/gas/elf/dwarf2-8.d @@ -1,3 +1,5 @@ #as: #name: DWARF2 8 #error-output: dwarf2-8.l +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: tile*-* diff --git a/gas/testsuite/gas/elf/dwarf2-9.d b/gas/testsuite/gas/elf/dwarf2-9.d index 7e4085857f0..ebf11cbb329 100644 --- a/gas/testsuite/gas/elf/dwarf2-9.d +++ b/gas/testsuite/gas/elf/dwarf2-9.d @@ -1,3 +1,5 @@ #as: #name: DWARF2 9 #error-output: dwarf2-9.l +# The tile targets require 8-byte instructions, but the test only simulates 4-byte instructions. +#not-target: tile*-* diff --git a/gas/testsuite/gas/elf/dwarf2-9.l b/gas/testsuite/gas/elf/dwarf2-9.l index 7f107fa5148..fb447740f28 100644 --- a/gas/testsuite/gas/elf/dwarf2-9.l +++ b/gas/testsuite/gas/elf/dwarf2-9.l @@ -1,2 +1,2 @@ [^:]*: Assembler messages: -[^:]*:30: Error: view number mismatch +[^:]*.* Error: view number mismatch diff --git a/gas/testsuite/gas/lns/lns-common-1-alt.d b/gas/testsuite/gas/lns/lns-common-1-alt.d index e762b831664..8aa8c7356c3 100644 --- a/gas/testsuite/gas/lns/lns-common-1-alt.d +++ b/gas/testsuite/gas/lns/lns-common-1-alt.d @@ -7,37 +7,37 @@ Raw dump of debug contents of section \.debug_line: #... Line Number Statements: \[0x.*\] Extended opcode 2: set Address to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 1\)|) \[0x.*\] Set column to 3 \[0x.*\] Advance Line by 1 to 2 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 1\)|) \[0x.*\] Set prologue_end to true \[0x.*\] Advance Line by 1 to 3 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 2\)|) \[0x.*\] Set column to 0 \[0x.*\] Set epilogue_begin to true \[0x.*\] Advance Line by 1 to 4 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 3\)|) \[0x.*\] Set ISA to 1 \[0x.*\] Set basic block \[0x.*\] Advance Line by 1 to 5 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 4\)|) \[0x.*\] Set is_stmt to 0 \[0x.*\] Advance Line by 1 to 6 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 5\)|) \[0x.*\] Set is_stmt to 1 \[0x.*\] Advance Line by 1 to 7 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 6\)|) \[0x.*\] Extended opcode 4: set Discriminator to 1 \[0x.*\] Advance Line by 0 to 7 \[0x.*\] Advance PC by fixed size amount .* to .* - \[0x.*\] Copy + \[0x.*\] Copy( \(view 7\)|) \[0x.*\] Advance PC by fixed size amount .* to .* \[0x.*\] Extended opcode 1: End of Sequence #... diff --git a/gas/testsuite/gas/lns/lns-duplicate.d b/gas/testsuite/gas/lns/lns-duplicate.d index 4bf44e07e34..6aed5e75b9d 100644 --- a/gas/testsuite/gas/lns/lns-duplicate.d +++ b/gas/testsuite/gas/lns/lns-duplicate.d @@ -6,5 +6,5 @@ Raw dump of debug contents of section \.z?debug_line: \[0x.*\] Extended opcode 2: set Address to .* \[0x.*\] Copy \[0x.*\] Set basic block - \[0x.*\] .* by 1 to 2 \(view 1\) + \[0x.*\] .* by 1 to 2( \(view 1\)|) #pass diff --git a/ld/testsuite/ld-avr/gc-section-debugline.d b/ld/testsuite/ld-avr/gc-section-debugline.d index f8c07de6a4a..4c155a90d18 100644 --- a/ld/testsuite/ld-avr/gc-section-debugline.d +++ b/ld/testsuite/ld-avr/gc-section-debugline.d @@ -10,61 +10,60 @@ Decoded dump of debug contents of section .debug_line: .*: -File name Line number Starting address +File name Line number Starting address View per-function-debugline.s 39 0 -per-function-debugline.s 40 0x2 +per-function-debugline.s 40 0x2 1 -per-function-debugline.s 41 0x4 +per-function-debugline.s 41 0x4 2 -per-function-debugline.s 42 0x6 +per-function-debugline.s 42 0x6 3 -per-function-debugline.s 47 0x8 +per-function-debugline.s 47 0x8 4 -per-function-debugline.s 48 0xc +per-function-debugline.s 48 0xc 5 -per-function-debugline.s 49 0x10 +per-function-debugline.s 49 0x10 6 -per-function-debugline.s 50 0x12 +per-function-debugline.s 50 0x12 7 -per-function-debugline.s 51 0x16 +per-function-debugline.s 51 0x16 8 -per-function-debugline.s 52 0x1a +per-function-debugline.s 52 0x1a 9 -per-function-debugline.s 54 0x1c +per-function-debugline.s 54 0x1c 10 -per-function-debugline.s 55 0x1e +per-function-debugline.s 55 0x1e 11 -per-function-debugline.s 56 0x20 +per-function-debugline.s 56 0x20 12 -per-function-debugline.s 62 0x22 - -per-function-debugline.s 63 0x24 +per-function-debugline.s 56 0x22 13 -per-function-debugline.s 64 0x26 - -per-function-debugline.s 65 0x28 +per-function-debugline.s 62 0x22 -per-function-debugline.s 70 0x2a +per-function-debugline.s 63 0x24 1 -per-function-debugline.s 71 0x2e +per-function-debugline.s 64 0x26 2 -per-function-debugline.s 72 0x32 +per-function-debugline.s 65 0x28 3 -per-function-debugline.s 73 0x36 +per-function-debugline.s 70 0x2a 4 -per-function-debugline.s 74 0x38 +per-function-debugline.s 71 0x2e 5 -per-function-debugline.s 75 0x3c +per-function-debugline.s 72 0x32 6 -per-function-debugline.s 76 0x40 +per-function-debugline.s 73 0x36 7 -per-function-debugline.s 77 0x44 +per-function-debugline.s 74 0x38 8 -per-function-debugline.s 79 0x48 +per-function-debugline.s 75 0x3c 9 -per-function-debugline.s 80 0x4a +per-function-debugline.s 76 0x40 10 -per-function-debugline.s 81 0x4c +per-function-debugline.s 77 0x44 11 +per-function-debugline.s 79 0x48 12 +per-function-debugline.s 80 0x4a 13 +#pass -- 2.47.2