public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@mips.com>
To: Eric Christopher <echristo@redhat.com>
Cc: binutils@sources.redhat.com, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH] Bad DWARF2 line information for MIPS16
Date: Tue, 22 Feb 2005 23:30:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0502221926060.20174@perivale.mips.com> (raw)
In-Reply-To: <1109023627.5031.22.camel@localhost.localdomain>

On Mon, 21 Feb 2005, Eric Christopher wrote:

> OK.

 Well, I had applied it, but then I discovered it failed for NewABI 
targets, like mips64*-linux-gnu, due to RELA relocations being involved.  
Shame on me...

 I've prepared the obvious fix of forcing the o32 ABI, but rather than 
stopping at that, I've decided to keep n32 tested, too, so I've made 
another test for the latter and covered relocation setup as well.  Here's 
the result.  Tested for mipsel-linux-gnu, mips64-elf, mips64el-elf, 
mips64-linux-gnu, mips64el-linux-gnu with no regressions and the two 
latters fixed.

2005-02-22  Maciej W. Rozycki  <macro@mips.com>

	* gas/mips/mips16-dwarf2.d: Pass -mabi=32.  Include relocation 
	information.
	* gas/mips/mips16-dwarf2-n32.d: New test to check DWARF2 line
	information for MIPS16 for the n32 ABI.
	* gas/mips/mips.exp. Run the new test.

 OK to apply?

  Maciej

binutils-2.15.94-20050222-mips16-dwarf2-newabi.patch
diff -up --recursive --new-file binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips.exp binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips.exp
--- binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips.exp	2005-02-22 14:32:13.000000000 +0000
+++ binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips.exp	2005-02-22 18:56:37.000000000 +0000
@@ -749,5 +749,8 @@ if { [istarget mips*-*-*] } then {
 
     if { $elf && !$no_mips16 } {
 	run_dump_test "mips16-dwarf2"
+	if $has_newabi {
+	    run_dump_test "mips16-dwarf2-n32"
+	}
     }
 }
diff -up --recursive --new-file binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips16-dwarf2-n32.d binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips16-dwarf2-n32.d
--- binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips16-dwarf2-n32.d	1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips16-dwarf2-n32.d	2005-02-22 20:00:02.000000000 +0000
@@ -0,0 +1,58 @@
+#readelf: -r -wl
+#name: MIPS16 DWARF2
+#as: -march=mips3 -mabi=n32 -mips16 -no-mdebug -g0
+#source: mips16-dwarf2.s
+
+Relocation section '\.rela\.debug_info' at offset .* contains 4 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name \+ Addend
+0+0006 * 0+..02 * R_MIPS_32 * 0+0000 * \.debug_abbrev \+ 0
+0+000c * 0+..02 * R_MIPS_32 * 0+0000 * \.debug_line \+ 0
+0+0010 * 0+..02 * R_MIPS_32 * 0+0000 * \.text \+ 0
+0+0014 * 0+..02 * R_MIPS_32 * 0+0000 * \.text \+ 910
+
+Relocation section '\.rela\.debug_line' at offset .* contains 1 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name \+ Addend
+0+0030 * 0+..02 * R_MIPS_32 * 0+0000 * .text \+ 1
+
+Dump of debug contents of section \.debug_line:
+
+  Length:                      64
+  DWARF Version:               2
+  Prologue Length:             35
+  Minimum Instruction Length:  1
+  Initial value of 'is_stmt':  1
+  Line Base:                   -5
+  Line Range:                  14
+  Opcode Base:                 10
+  \(Pointer size:               4\)
+
+ Opcodes:
+  Opcode 1 has 0 args
+  Opcode 2 has 1 args
+  Opcode 3 has 1 args
+  Opcode 4 has 1 args
+  Opcode 5 has 1 args
+  Opcode 6 has 0 args
+  Opcode 7 has 0 args
+  Opcode 8 has 0 args
+  Opcode 9 has 1 args
+
+ The Directory Table is empty\.
+
+ The File Name Table:
+  Entry	Dir	Time	Size	Name
+  1	0	0	0	mips16-dwarf2\.s
+
+ Line Number Statements:
+  Extended opcode 2: set Address to 0x0
+  Special opcode 5: advance Address by 0 to 0x0 and Line by 0 to 1
+  Special opcode 34: advance Address by 2 to 0x2 and Line by 1 to 2
+  Special opcode 34: advance Address by 2 to 0x4 and Line by 1 to 3
+  Special opcode 62: advance Address by 4 to 0x8 and Line by 1 to 4
+  Special opcode 34: advance Address by 2 to 0xa and Line by 1 to 5
+  Special opcode 62: advance Address by 4 to 0xe and Line by 1 to 6
+  Special opcode 62: advance Address by 4 to 0x12 and Line by 1 to 7
+  Advance PC by 2286 to 900
+  Special opcode 6: advance Address by 0 to 0x900 and Line by 1 to 8
+  Advance PC by 15 to 90f
+  Extended opcode 1: End of Sequence
diff -up --recursive --new-file binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips16-dwarf2.d binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips16-dwarf2.d
--- binutils-2.15.94-20050222.macro/gas/testsuite/gas/mips/mips16-dwarf2.d	2005-02-22 12:32:26.000000000 +0000
+++ binutils-2.15.94-20050222/gas/testsuite/gas/mips/mips16-dwarf2.d	2005-02-22 20:00:11.000000000 +0000
@@ -1,8 +1,19 @@
-#readelf: -wl
+#readelf: -r -wl
 #name: MIPS16 DWARF2
-#as: -mips16 -no-mdebug -g0
+#as: -mabi=32 -mips16 -no-mdebug -g0
 #source: mips16-dwarf2.s
 
+Relocation section '\.rel\.debug_info' at offset .* contains 4 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name
+0+0006 * 0+..02 * R_MIPS_32 * 0+0000 * \.debug_abbrev
+0+000c * 0+..02 * R_MIPS_32 * 0+0000 * \.debug_line
+0+0010 * 0+..02 * R_MIPS_32 * 0+0000 * \.text
+0+0014 * 0+..02 * R_MIPS_32 * 0+0000 * \.text
+
+Relocation section '\.rel\.debug_line' at offset .* contains 1 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name
+0+0030 * 0+..02 * R_MIPS_32 * 0+0000 * \.text
+
 Dump of debug contents of section \.debug_line:
 
   Length:                      64

  reply	other threads:[~2005-02-22 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22  0:44 Maciej W. Rozycki
2005-02-22  0:57 ` Eric Christopher
2005-02-22 23:30   ` Maciej W. Rozycki [this message]
2005-02-22 23:37     ` Eric Christopher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0502221926060.20174@perivale.mips.com \
    --to=macro@mips.com \
    --cc=binutils@sources.redhat.com \
    --cc=echristo@redhat.com \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).