From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31557 invoked by alias); 8 Nov 2004 22:05:23 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 31338 invoked from network); 8 Nov 2004 22:05:07 -0000 Received: from unknown (HELO walton.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 8 Nov 2004 22:05:07 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by walton.sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id iA8M4sh3003553; Mon, 8 Nov 2004 23:04:54 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id iA8M4set088182; Mon, 8 Nov 2004 23:04:54 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id iA8M4jws088177; Mon, 8 Nov 2004 23:04:45 +0100 (CET) Date: Mon, 08 Nov 2004 22:05:00 -0000 Message-Id: <200411082204.iA8M4jws088177@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: wilson@specifixinc.com CC: echristo@redhat.com, seufer@csv.ica.uni-stuttgart.de, gdb@sources.redhat.com, gcc@gcc.gnu.org, binutils@sources.redhat.com In-reply-to: <418FDD06.9030404@specifixinc.com> (message from James E Wilson on Mon, 08 Nov 2004 12:54:30 -0800) Subject: Re: Mixing 32-bit and 64-bit DWARF2/3 sections References: <200411071428.iA7ES7Fx003013@elgar.sibelius.xs4all.nl> <418FDD06.9030404@specifixinc.com> X-SW-Source: 2004-11/txt/msg00143.txt.bz2 Date: Mon, 08 Nov 2004 12:54:30 -0800 From: James E Wilson Mark Kettenis wrote: > This argues that what's currently done in gas and GCC for most 64-bit > MIPS targets is wrong, since these use the 64-bit DWARF format > unconditionally for the n64 ABI. SGI Irix6 created the N64 ABI, and they decreed that one must use a (non-standard) 64-bit DWARF format with it. We are just following the ABI here. If we change it, then we lose compatibility with Irix6, and the published ABI. Yes I left out the non-standard SGI 64-bit DWARF format. Indeed it makes sense to maintain compatibility with the vendor tools if possible. So for the IRIX n64 ABI the GNU toolchain should generate the non-standard 64-bit DWARF. The situation is different though for other 64-bit MIPS systems. The n64 ABI for Linux and OpenBSD is already incompatible with IRIX (bfd_elf64_bigmips_vec vs. bfd_elf64_tradbigmips_vec). On these systems, gas currently generates the new DWARF3 64-bit format. I merely want to argue that it probably would have been better if the default had been 32-bit for Linux. > P.S. It seems that MIPS is the only 64-bit target for which this is a > problem, since all other 64-bit targets (AMD64, UltraSPARC) still > use the 32-bit DWARF format. This is because SGI decided that DWARF2 was broken, and tried to fix it by adding 64-bit extensions. These extensions are only needed if you have more than 4GB of DWARF debug info, and hence is unlikely, but SGI claims that they did hit this limit. No one else has apparently ever hit the limit. Unfortunately, the way that SGI extended DWARF2 caused problems, as it resulted in ambiguous DWARF info, so the DWARF3 committee defined a different way that is self descriptive. But since this happened after Irix6 had already been released, and SGI could not break backwards compatibility with Irix6, N64 still uses the non-standard 64-bit DWARF format that SGI invented. And gcc uses this non-standard 64-bit DWARF format for all mips64 targets, for consistency, and to conform with the ABI. If this is true, there's a real problem in 64-bit MIPS Linux now, since gas clearly uses the non-standard 64-bit format only on IRIX according to this fragment from gas/config/tc-mips.c: enum dwarf2_format mips_dwarf2_format (void) { if (mips_abi == N64_ABI) { #ifdef TE_IRIX return dwarf2_format_64bit_irix; #else return dwarf2_format_64bit; #endif } else return dwarf2_format_32bit; } On the bright side, if all non-IRIX 64-bit MIPS targets are currently broken, this gives us the opportunity to fix things the "right" way by using standard 32-bit DWARF2 by default. Mark