PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)

H . J . Lu hjl@lucon.org
Mon Jun 3 16:25:00 GMT 2002


On Mon, Jun 03, 2002 at 03:37:16PM -0700, H . J . Lu wrote:
> On Tue, Jun 04, 2002 at 12:32:46AM +0200, Jakub Jelinek wrote:
> > On Mon, Jun 03, 2002 at 11:57:03AM -0700, H . J . Lu wrote:
> > > On Mon, Jun 03, 2002 at 10:41:31AM -0700, H . J . Lu wrote:
> > > > 
> > > > Jakub, I believe your patch
> > > > 
> > > > http://sources.redhat.com/ml/binutils/2001-11/msg00580.html
> > > > 
> > > > breaks ELF/MIPS since it didn't modify ELF/MIPS to support relocating
> > > > STT_SECTION sym in SHF_MERGE section. As the result, the ELF/MIPS
> > > > linker generates incorrect debug information. Could you please look
> > > > into it?
> > > > 
> > > > BTW, I don't know if ELF/MIPS is the only broken target.
> > > > 
> > > > Thanks.
> > > > 
> > > > 
> > > 
> > > This patch makes gdb 5.2 happy. However, I have no ideas if it is
> > > correct. Could someone please take a look?
> > 
> > If looks fine to me, if it works, I'm all for it.
> > 
> 
> I was wrong to say gdb 5.2 was happy. It didn't complain now. But
> I still can't debug Linux/mipsel binaries compled with gcc 3.1.1.
> 
> 

It turned out gas doesn't support dwarf debug info for Linux/mipsel
at all. ".file" and ".loc" don't do much for dwarf. Since no much
has been done for dwarf on Linux/mipsel, I am submitting this
patch to use stabs instead of DWARF on Linux/mipsel.



H.J.
-------------- next part --------------
2002-01-12  H.J. Lu <hjl@gnu.org>

	* config/mips/linux.h (PREFERRED_DEBUGGING_TYPE): Set to
	DBX_DEBUG.

--- gcc/config/mips/linux.h.stabs	Fri Jan 11 09:30:08 2002
+++ gcc/config/mips/linux.h	Sat Jan 12 10:50:10 2002
@@ -289,3 +289,7 @@ void FN ()							\
    it.  */
 #undef ASM_OUTPUT_REG_PUSH
 #undef ASM_OUTPUT_REG_POP
+
+/* Use stabs instead of DWARF debug format.  */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG


More information about the Binutils mailing list