This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: Introduce support for location views


On Jul 17, 2017, Nick Clifton <nickc@redhat.com> wrote:

> Hi Alex,
>> Fixed with the incremental patch below.

> Thanks - with that applied I was able to build the patched sources.  Unfortunately
> this revealed the next problem - new gas testsuite failures:

Thanks, many fixed, but with a caveat.  See below.

> Lots of targets (eg: arm-eabi, powerpc64-linux-gnu) are showing:

I was using .align, but that's p2align rather than balign on these
ports.

> MIPS targets are also showing:

>   GAS REGRESSION: DWARF2 8   
>   GAS REGRESSION: DWARF2 9   

mips_align was missing a loc insn flush.

>   GAS REGRESSION: MIPS DWARF-2 location information with

I had miscomputed view numbers in my head for some of these.

> The riscv64-elf target also has:

>   GAS REGRESSION: undefined symbols un sleb128 directive

Fixed a typo.  The problem remains, I'm still looking into what can be
done about it.
 
> And the SH target is showing:

Besides the .p2/.balign issue, this required a loc insn flush in s_cons.


I was growing uncomfortable with the growing number of loc insn flushes
I had to add, and how many others I might have missed, but a new
regression in the MIPS tests (mips16-dwarf2) after I added a flush to
mips_align caught me by surprise: that test has .loc before align,
space, labels and whatnot, and expects the .loc to bind to the
subsequent asm insn, just as specified in the manual!

I figured I'd restore the original behavior of .loc, and arrange for it
to emit a row for the current address (which is what my plans and the
GCC implementation expects), rather than for the subsequent asm insn
(which is what GAS used to do), only when a "view" option is given.  So
you'll get the new behavior only when you ask for views.  I'm still
working on that, reverting all the new calls to dwarf2_emit_insn, so
I'll post that big change as a follow up.  For now, here's the
incremental patch for the other fixes mentioned above.


for  gas/ChangeLog

	* config/tc-mips.c (mips_align): Emit pending loc insn first.
	* config/tc-sh.c (sh_elf_cons): Likewise.
[...]
        * testsuite/gas/mips/loc-swap-3.d: Likewise.

diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index cb5fb24..8baae26 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -831,6 +831,8 @@ sh_elf_cons (int nbytes)
       return;
     }
 
+  dwarf2_emit_insn (0);
+
 #ifdef md_cons_align
   md_cons_align (nbytes);
 #endif
diff --git a/gas/testsuite/gas/all/sleb128-9.d b/gas/testsuite/gas/all/sleb128-9.d
index 7c88451..16f81ca 100644
--- a/gas/testsuite/gas/all/sleb128-9.d
+++ b/gas/testsuite/gas/all/sleb128-9.d
@@ -1,4 +1,4 @@
-#name: undefined symbols un sleb128 directive
+#name: undefined symbols in sleb128 directive
 #source: sleb128-9.s
 #error-output: sleb128-9.l
 #target: *-*-*
diff --git a/gas/testsuite/gas/elf/dwarf2-10.s b/gas/testsuite/gas/elf/dwarf2-10.s
index c4052f1..d159d43 100644
--- a/gas/testsuite/gas/elf/dwarf2-10.s
+++ b/gas/testsuite/gas/elf/dwarf2-10.s
@@ -17,16 +17,16 @@
 
 	.file "dwarf2-10.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-10.c"
 	.loc 1 1 view 0
-	.align 4	/* No skip needed here...  */
+	.balign 4	/* No skip needed here...  */
 	.loc 1 2 view 0	/* so this zero-view check fails.  */
 	.int 0
 	.loc 1 3 view 0
-	.align 8	/* Skip 4 more bytes after .int...  */
+	.balign 8	/* Skip 4 more bytes after .int...  */
 	.loc 1 4 view 0	/* so this is a zero view indeed.  */
 	.int 0
 	.size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-11.s b/gas/testsuite/gas/elf/dwarf2-11.s
index 7ec49ae..187def5 100644
--- a/gas/testsuite/gas/elf/dwarf2-11.s
+++ b/gas/testsuite/gas/elf/dwarf2-11.s
@@ -17,12 +17,12 @@
 
 	.file "dwarf2-11.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-11.c"
 	.int 0
 	.loc 1 1 view 0
-	.align 8
+	.balign 8
 	.loc 1 2 view 0
 	.size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-12.s b/gas/testsuite/gas/elf/dwarf2-12.s
index 610eeff..1a851d6 100644
--- a/gas/testsuite/gas/elf/dwarf2-12.s
+++ b/gas/testsuite/gas/elf/dwarf2-12.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-12.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-12.c"
diff --git a/gas/testsuite/gas/elf/dwarf2-13.s b/gas/testsuite/gas/elf/dwarf2-13.s
index 5635b96..c13f9d4 100644
--- a/gas/testsuite/gas/elf/dwarf2-13.s
+++ b/gas/testsuite/gas/elf/dwarf2-13.s
@@ -17,13 +17,13 @@
 
 	.file "dwarf2-13.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-13.c"
 	.int 0
 	.loc 1 1 view 0
-	.align 8
+	.balign 8
 	.loc 1 2 view -0
 	.loc 1 3 view .L1
 	.int 0
diff --git a/gas/testsuite/gas/elf/dwarf2-14.s b/gas/testsuite/gas/elf/dwarf2-14.s
index 115d124..4dde965 100644
--- a/gas/testsuite/gas/elf/dwarf2-14.s
+++ b/gas/testsuite/gas/elf/dwarf2-14.s
@@ -17,12 +17,12 @@
 
 	.file "dwarf2-14.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-14.c"
 	.loc 1 1 view 0
-	.align 4
+	.balign 4
 	.loc 1 2 view -0
 	.loc 1 3 view .L1
 	.int 0
diff --git a/gas/testsuite/gas/elf/dwarf2-15.s b/gas/testsuite/gas/elf/dwarf2-15.s
index b1b5a58..1fbd594 100644
--- a/gas/testsuite/gas/elf/dwarf2-15.s
+++ b/gas/testsuite/gas/elf/dwarf2-15.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-15.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-15.c"
diff --git a/gas/testsuite/gas/elf/dwarf2-16.s b/gas/testsuite/gas/elf/dwarf2-16.s
index 54283e8..7976614 100644
--- a/gas/testsuite/gas/elf/dwarf2-16.s
+++ b/gas/testsuite/gas/elf/dwarf2-16.s
@@ -17,14 +17,14 @@
 
 	.file "dwarf2-16.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-16.c"
 	.loc 1 1 view 0
 	.int 0
 	.loc 1 2 view 0
-	.align 4
+	.balign 4
 	.loc 1 3 view .L1
 	.int 0
 	.size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-17.s b/gas/testsuite/gas/elf/dwarf2-17.s
index ef6c9fd..26c24cb 100644
--- a/gas/testsuite/gas/elf/dwarf2-17.s
+++ b/gas/testsuite/gas/elf/dwarf2-17.s
@@ -17,14 +17,14 @@
 
 	.file "dwarf2-17.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-17.c"
 	.loc 1 1 view 0
 	.int 0
 	.loc 1 2 view 0
-	.align 8
+	.balign 8
 	.loc 1 3 view .L1
 	.int 0
 	.size _start, .-_start
diff --git a/gas/testsuite/gas/elf/dwarf2-18.s b/gas/testsuite/gas/elf/dwarf2-18.s
index 643c006..f32b3b3 100644
--- a/gas/testsuite/gas/elf/dwarf2-18.s
+++ b/gas/testsuite/gas/elf/dwarf2-18.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-18.c"
 	.text
-	.align 8
+	.balign 8
 	.globl _start
 _start:
 	.file 1 "dwarf2-18.c"
diff --git a/gas/testsuite/gas/elf/dwarf2-5.s b/gas/testsuite/gas/elf/dwarf2-5.s
index 9483b82..91b9f95 100644
--- a/gas/testsuite/gas/elf/dwarf2-5.s
+++ b/gas/testsuite/gas/elf/dwarf2-5.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-5.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-5.c"
@@ -25,11 +25,11 @@ _start:
 	.loc 1 2 view .L2
 	.int 0
 	.loc 1 3 view 0
-	.align 4
+	.balign 4
 	.loc 1 4 view .L4
 	.loc 1 5 view .L5
 	.org .+1
-	.align 4
+	.balign 4
 	.loc 1 6 view 0
 	.int 0
 	.text
diff --git a/gas/testsuite/gas/elf/dwarf2-6.s b/gas/testsuite/gas/elf/dwarf2-6.s
index 678d8a1..28b1829 100644
--- a/gas/testsuite/gas/elf/dwarf2-6.s
+++ b/gas/testsuite/gas/elf/dwarf2-6.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-6.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 .L_start:
diff --git a/gas/testsuite/gas/elf/dwarf2-7.s b/gas/testsuite/gas/elf/dwarf2-7.s
index 9673cf0..d8fd007 100644
--- a/gas/testsuite/gas/elf/dwarf2-7.s
+++ b/gas/testsuite/gas/elf/dwarf2-7.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-7.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-7.c"
diff --git a/gas/testsuite/gas/elf/dwarf2-8.s b/gas/testsuite/gas/elf/dwarf2-8.s
index dec0d33..228063c 100644
--- a/gas/testsuite/gas/elf/dwarf2-8.s
+++ b/gas/testsuite/gas/elf/dwarf2-8.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-8.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-8.c"
diff --git a/gas/testsuite/gas/elf/dwarf2-9.s b/gas/testsuite/gas/elf/dwarf2-9.s
index c48b942..afc2019 100644
--- a/gas/testsuite/gas/elf/dwarf2-9.s
+++ b/gas/testsuite/gas/elf/dwarf2-9.s
@@ -17,7 +17,7 @@
 
 	.file "dwarf2-9.c"
 	.text
-	.align 4
+	.balign 4
 	.globl _start
 _start:
 	.file 1 "dwarf2-9.c"
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 4eeb5ee..176d635 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -15865,6 +15865,7 @@ mips_align (int to, int *fill, struct insn_label_list *labels)
 {
   mips_emit_delays ();
   mips_record_compressed_mode ();
+  dwarf2_emit_insn (0);
   if (fill == NULL && subseg_text_p (now_seg))
     frag_align_code (to, 0);
   else
diff --git a/gas/testsuite/gas/mips/loc-swap-2.d b/gas/testsuite/gas/mips/loc-swap-2.d
index df64ccd..6176614 100644
--- a/gas/testsuite/gas/mips/loc-swap-2.d
+++ b/gas/testsuite/gas/mips/loc-swap-2.d
@@ -38,9 +38,9 @@ Raw dump of debug contents of section .debug_line:
 
  Line Number Statements:
   \[0x.*\]  Extended opcode 2: set Address to 0x0
-  \[0x.*\]  Special opcode 11: advance Address by 0 to 0x0 and Line by 6 to 7 \(view 1\)
-  \[0x.*\]  Special opcode 7: advance Address by 0 to 0x0 and Line by 2 to 9 \(view 2\)
-  \[0x.*\]  Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 10 \(view 3\)
+  \[0x.*\]  Special opcode 11: advance Address by 0 to 0x0 and Line by 6 to 7
+  \[0x.*\]  Special opcode 7: advance Address by 0 to 0x0 and Line by 2 to 9 \(view 1\)
+  \[0x.*\]  Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 10 \(view 2\)
   \[0x.*\]  Special opcode 120: advance Address by 8 to 0x8 and Line by 3 to 13
   \[0x.*\]  Special opcode 62: advance Address by 4 to 0xc and Line by 1 to 14
   \[0x.*\]  Special opcode 6: advance Address by 0 to 0xc and Line by 1 to 15 \(view 1\)
diff --git a/gas/testsuite/gas/mips/loc-swap-3.d b/gas/testsuite/gas/mips/loc-swap-3.d
index 2e46e04..0610a44 100644
--- a/gas/testsuite/gas/mips/loc-swap-3.d
+++ b/gas/testsuite/gas/mips/loc-swap-3.d
@@ -12,6 +12,6 @@
 #   Set prologue_end to true
 # here
 #------------------------------------------------------------------------
-.*  Special opcode 6: advance Address by 0 to 0x[01] and Line by 1 to 2
+.*  Special opcode 6: advance Address by 0 to 0x[01] and Line by 1 to 2 \(view 1\)
 .*  Advance PC by .*
 .*  Extended opcode 1: End of Sequence


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer


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