public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
@ 2010-11-11 11:08 Rainer Orth
  2010-11-12 14:30 ` Rainer Orth
  2010-11-15  9:21 ` Alan Modra
  0 siblings, 2 replies; 9+ messages in thread
From: Rainer Orth @ 2010-11-11 11:08 UTC (permalink / raw)
  To: binutils

As reported in GCC PR debug/39104
	
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39104
        stabs debug info fails on IRIX 5.3

all -gstabs* testcases in the GCC testsuite currently fail:

$ touch debug.c
$ gcc -gstabs -c debug.c
/var/tmp//ccDaTzn4.s: Assembler messages:
/var/tmp//ccDaTzn4.s:3: Warning: illegal .stabs directive, bad character
[...]

With -v, one sees that gas is invoked like this
$ /vol/gcc/bin/gas-2.20.1 -v -EB -g -no-mdebug -mabi=32 -v -o debug.o debug.s

gcc emits .stab* directives for use with Stabs-in-ELF (thus the
-no-mdebug), but the IRIX 5 binutils are configured to support both
ECOFF (and thus Stabs-in-mdebug for compatibility with IRIX 4) and ELF
(this Stabs-in-ELF).  Unfortunately, gas/config/obj-elf.c isn't able to
deal with ECOFF_DEBUGGING not being a compile-time constant, which is
the case here: gas/config/obj-elf.h has

#define ECOFF_DEBUGGING mips_flag_mdebug

To fix the problem, we need to turn the preprocessor check into a
runtime check, which is exactly what the following patch does.

The gcc testcase now assembles correctly and I could verify with objdump
-g and objdump -s that the .stab/.stabstr sections are created as
expected.  A full GCC mainline bootstrap is currently running.  It will
take about a week to complete.

Ok for mainline and 2.21 branch if that passes?

	Rainer
        

2010-04-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/obj-elf.c (elf_generate_asm_lineno): New function.
	(elf_process_stab): New function.
	(elf_format_ops): Always use them as generate_asm_lineno,
	process_stab members.

--- gas/config/obj-elf.c~	Mon Sep 14 13:43:27 2009
+++ gas/config/obj-elf.c	Sun Apr 18 00:34:40 2010
@@ -2351,6 +2351,29 @@
 
 #endif /* SCO_ELF */
 
+static void
+elf_generate_asm_lineno (void)
+{
+#ifdef NEED_ECOFF_DEBUG
+  if (ECOFF_DEBUGGING)
+    ecoff_generate_asm_lineno ();
+#endif
+}
+
+static void
+elf_process_stab (segT sec,
+		  int what,
+		  const char *string,
+		  int type,
+		  int other,
+		  int desc)
+{
+#ifdef NEED_ECOFF_DEBUG
+  if (ECOFF_DEBUGGING)
+    ecoff_stab (sec, what, string, type, other, desc);
+#endif
+}
+
 static int
 elf_separate_stab_sections (void)
 {
@@ -2391,13 +2414,8 @@
   0,	/* s_get_type */
   0,	/* s_set_type */
   elf_copy_symbol_attributes,
-#ifdef NEED_ECOFF_DEBUG
-  ecoff_generate_asm_lineno,
-  ecoff_stab,
-#else
-  0,	/* generate_asm_lineno */
-  0,	/* process_stab */
-#endif
+  elf_generate_asm_lineno,
+  elf_process_stab,
   elf_separate_stab_sections,
   elf_init_stab_section,
   elf_sec_sym_ok_for_reloc,

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-11 11:08 Produce Stabs-in-ELF on IRIX 5 with -no-mdebug Rainer Orth
@ 2010-11-12 14:30 ` Rainer Orth
  2010-11-15  9:21 ` Alan Modra
  1 sibling, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2010-11-12 14:30 UTC (permalink / raw)
  To: binutils

Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> The gcc testcase now assembles correctly and I could verify with objdump
> -g and objdump -s that the .stab/.stabstr sections are created as
> expected.  A full GCC mainline bootstrap is currently running.  It will
> take about a week to complete.
>
> Ok for mainline and 2.21 branch if that passes?

While my bootstrap is still running, I've just received confirmation by
the submitter of the GCC PR that it fixes the bug for him, so it seems
sound.

Ok now?
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-11 11:08 Produce Stabs-in-ELF on IRIX 5 with -no-mdebug Rainer Orth
  2010-11-12 14:30 ` Rainer Orth
@ 2010-11-15  9:21 ` Alan Modra
  2010-11-15 12:48   ` Tristan Gingold
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Modra @ 2010-11-15  9:21 UTC (permalink / raw)
  To: Rainer Orth; +Cc: binutils

On Thu, Nov 11, 2010 at 12:06:47PM +0100, Rainer Orth wrote:
> 	* config/obj-elf.c (elf_generate_asm_lineno): New function.
> 	(elf_process_stab): New function.
> 	(elf_format_ops): Always use them as generate_asm_lineno,
> 	process_stab members.

OK mainline.  I think it could safely go on the branch too, but please
wait for Tristan's approval there.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15  9:21 ` Alan Modra
@ 2010-11-15 12:48   ` Tristan Gingold
  2010-11-15 16:04     ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Tristan Gingold @ 2010-11-15 12:48 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Binutils, Alan Modra


On Nov 15, 2010, at 10:21 AM, Alan Modra wrote:

> On Thu, Nov 11, 2010 at 12:06:47PM +0100, Rainer Orth wrote:
>> 	* config/obj-elf.c (elf_generate_asm_lineno): New function.
>> 	(elf_process_stab): New function.
>> 	(elf_format_ops): Always use them as generate_asm_lineno,
>> 	process_stab members.
> 
> OK mainline.  I think it could safely go on the branch too, but please
> wait for Tristan's approval there.

Ok too.
(And thanks)

Tristan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15 12:48   ` Tristan Gingold
@ 2010-11-15 16:04     ` Rainer Orth
  2010-11-15 18:16       ` H.J. Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2010-11-15 16:04 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: Binutils, Alan Modra

Tristan Gingold <gingold@adacore.com> writes:

> On Nov 15, 2010, at 10:21 AM, Alan Modra wrote:
>
>> On Thu, Nov 11, 2010 at 12:06:47PM +0100, Rainer Orth wrote:
>>> 	* config/obj-elf.c (elf_generate_asm_lineno): New function.
>>> 	(elf_process_stab): New function.
>>> 	(elf_format_ops): Always use them as generate_asm_lineno,
>>> 	process_stab members.
>> 
>> OK mainline.  I think it could safely go on the branch too, but please
>> wait for Tristan's approval there.
>
> Ok too.
> (And thanks)

Installed on both.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15 16:04     ` Rainer Orth
@ 2010-11-15 18:16       ` H.J. Lu
  2010-11-15 18:18         ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: H.J. Lu @ 2010-11-15 18:16 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, Binutils, Alan Modra

On Mon, Nov 15, 2010 at 8:03 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Tristan Gingold <gingold@adacore.com> writes:
>
>> On Nov 15, 2010, at 10:21 AM, Alan Modra wrote:
>>
>>> On Thu, Nov 11, 2010 at 12:06:47PM +0100, Rainer Orth wrote:
>>>>     * config/obj-elf.c (elf_generate_asm_lineno): New function.
>>>>     (elf_process_stab): New function.
>>>>     (elf_format_ops): Always use them as generate_asm_lineno,
>>>>     process_stab members.
>>>
>>> OK mainline.  I think it could safely go on the branch too, but please
>>> wait for Tristan's approval there.
>>
>> Ok too.
>> (And thanks)
>
> Installed on both.
>

This break Linux/x86:

cc1: warnings being treated as errors
/export/gnu/import/git/binutils/gas/config/obj-elf.c: In function
‘elf_process_stab’:
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2401:24: error:
unused parameter ‘sec’
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2402:9: error:
unused parameter ‘what’
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2403:17: error:
unused parameter ‘string’
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2404:9: error:
unused parameter ‘type’
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2405:9: error:
unused parameter ‘other’
/export/gnu/import/git/binutils/gas/config/obj-elf.c:2406:9: error:
unused parameter ‘desc’

I checked this into mainline.


-- 
H.J.
---
Index: gas/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.4327
diff -u -p -r1.4327 ChangeLog
--- gas/ChangeLog	15 Nov 2010 12:31:05 -0000	1.4327
+++ gas/ChangeLog	15 Nov 2010 18:12:14 -0000
@@ -1,3 +1,8 @@
+2010-11-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* config/obj-elf.c (elf_process_stab): Mark parameters as
+	ATTRIBUTE_UNUSED.
+
 2010-11-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

 	* config/obj-elf.c (elf_generate_asm_lineno): New function.
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.134
diff -u -p -r1.134 obj-elf.c
--- gas/config/obj-elf.c	15 Nov 2010 12:31:05 -0000	1.134
+++ gas/config/obj-elf.c	15 Nov 2010 18:12:15 -0000
@@ -2398,12 +2398,12 @@ elf_generate_asm_lineno (void)
 }

 static void
-elf_process_stab (segT sec,
-		  int what,
-		  const char *string,
-		  int type,
-		  int other,
-		  int desc)
+elf_process_stab (segT sec ATTRIBUTE_UNUSED,
+		  int what ATTRIBUTE_UNUSED,
+		  const char *string ATTRIBUTE_UNUSED,
+		  int type ATTRIBUTE_UNUSED,
+		  int other ATTRIBUTE_UNUSED,
+		  int desc ATTRIBUTE_UNUSED)
 {
 #ifdef NEED_ECOFF_DEBUG
   if (ECOFF_DEBUGGING)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15 18:16       ` H.J. Lu
@ 2010-11-15 18:18         ` Rainer Orth
  2010-11-15 18:23           ` H.J. Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2010-11-15 18:18 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Tristan Gingold, Binutils, Alan Modra

"H.J. Lu" <hjl.tools@gmail.com> writes:

> This break Linux/x86:
>
> cc1: warnings being treated as errors
> /export/gnu/import/git/binutils/gas/config/obj-elf.c: In function
> ‘elf_process_stab’:
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2401:24: error:
> unused parameter ‘sec’
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2402:9: error:
> unused parameter ‘what’
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2403:17: error:
> unused parameter ‘string’
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2404:9: error:
> unused parameter ‘type’
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2405:9: error:
> unused parameter ‘other’
> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2406:9: error:
> unused parameter ‘desc’
>
> I checked this into mainline.

sorry for the breakage and thanks for the quick fix.  Can you check this
into the 2.21 branch, too, or should I do it?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15 18:18         ` Rainer Orth
@ 2010-11-15 18:23           ` H.J. Lu
  2010-11-15 18:50             ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: H.J. Lu @ 2010-11-15 18:23 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tristan Gingold, Binutils, Alan Modra

2010/11/15 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> This break Linux/x86:
>>
>> cc1: warnings being treated as errors
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c: In function
>> ‘elf_process_stab’:
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2401:24: error:
>> unused parameter ‘sec’
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2402:9: error:
>> unused parameter ‘what’
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2403:17: error:
>> unused parameter ‘string’
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2404:9: error:
>> unused parameter ‘type’
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2405:9: error:
>> unused parameter ‘other’
>> /export/gnu/import/git/binutils/gas/config/obj-elf.c:2406:9: error:
>> unused parameter ‘desc’
>>
>> I checked this into mainline.
>
> sorry for the breakage and thanks for the quick fix.  Can you check this
> into the 2.21 branch, too, or should I do it?
>

Please put the fix into 2.21 branch for me.

Thanks.


-- 
H.J.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug
  2010-11-15 18:23           ` H.J. Lu
@ 2010-11-15 18:50             ` Rainer Orth
  0 siblings, 0 replies; 9+ messages in thread
From: Rainer Orth @ 2010-11-15 18:50 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Tristan Gingold, Binutils, Alan Modra

"H.J. Lu" <hjl.tools@gmail.com> writes:

> Please put the fix into 2.21 branch for me.

Done after verifying that the branch builds again on i386-pc-solaris2.10
which doesn't define NEED_ECOFF_DEBUG.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-11-15 18:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-11 11:08 Produce Stabs-in-ELF on IRIX 5 with -no-mdebug Rainer Orth
2010-11-12 14:30 ` Rainer Orth
2010-11-15  9:21 ` Alan Modra
2010-11-15 12:48   ` Tristan Gingold
2010-11-15 16:04     ` Rainer Orth
2010-11-15 18:16       ` H.J. Lu
2010-11-15 18:18         ` Rainer Orth
2010-11-15 18:23           ` H.J. Lu
2010-11-15 18:50             ` Rainer Orth

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).