MIPS_STABS_ELF is now broken

H . J . Lu hjl@lucon.org
Mon Jun 10 23:52:00 GMT 2002


On Mon, Jun 10, 2002 at 11:38:53PM -0700, H . J . Lu wrote:
> Hi Daniel,
> 
> I believe your patch
> 
> http://sources.redhat.com/ml/binutils/2002-06/msg00194.html
> 
> breaks MIPS_STABS_ELF.
> 
> # gcc -c x.c
> # objdump --full -j .stabstr  x.o|m 
> 
> x.o:     file format elf32-tradlittlemips
> 
> Contents of section .stabstr:
>  0000 002f746d 702f6363 4b305a32 6f452e73  ./tmp/ccK0Z2oE.s
> 					   ^^^^^^^^^^^^^^^^
> 
> It was not there before your change. As the result, gcc bootstrap fails
> in "make compare" when MIPS_STABS_ELF is used. Could you please fix it?
> I don't think you should pass the first .file to dwarf. See
> 
> http://sources.redhat.com/ml/binutils/2002-06/msg00066.html
> 
> and how alpha handles it.
> 

This patch seems to fix it. Please take a look. Thanks.

BTW, when you use dwarf on mips, you get

        .file   1 "x.c"
        .section .mdebug.abi32
        .previous
        .abicalls
        .file 1 "x.c"

There are 2 ".file" directives.


H.J.
-------------- next part --------------
2002-06-10  H.J. Lu <hjl@gnu.org>

	* config/tc-mips.c (s_mips_file): Never pass the first .file
	directive to dwarf.

--- gas/config/tc-mips.c.stabs	Sat Jun  8 20:36:18 2002
+++ gas/config/tc-mips.c	Mon Jun 10 23:41:31 2002
@@ -13372,8 +13372,14 @@ static void
 s_mips_file (x)
      int x ATTRIBUTE_UNUSED;
 {
-  if (ECOFF_DEBUGGING)
+  static int first_file_directive;
+
+  /* Save the first .file directive we see, so that we can change our
+     minds about whether dwarf debugging should or shouldn't be
+     enabled.  */
+  if (! first_file_directive)
     {
+      first_file_directive = 1;
       get_number ();
       s_app_file (0);
     }


More information about the Binutils mailing list