From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2944 invoked by alias); 18 Jul 2006 16:32:02 -0000 Received: (qmail 2933 invoked by uid 22791); 18 Jul 2006 16:32:01 -0000 X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Jul 2006 16:31:59 +0000 Received: from cam-owa1.Emea.Arm.com (cam-owa1.emea.arm.com [10.1.255.62]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id k6IGVuGf012462; Tue, 18 Jul 2006 17:31:57 +0100 (BST) Received: from pc960.cambridge.arm.com ([10.1.255.211]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 18 Jul 2006 17:31:56 +0100 Subject: Re: Initialize default floating-point model on ARM for GNU binaries From: Richard Earnshaw To: Mark Kettenis Cc: gdb-patches@sourceware.org In-Reply-To: <200607172250.k6HMoIN2009013@elgar.sibelius.xs4all.nl> References: <200607172250.k6HMoIN2009013@elgar.sibelius.xs4all.nl> Content-Type: text/plain Message-Id: <1153240315.20443.52.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 18 Jul 2006 16:32:00 -0000 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00234.txt.bz2 On Mon, 2006-07-17 at 23:50, Mark Kettenis wrote: > Hi Richard, > > Here's a patch to select the default floating-point model based on > flags set in the ELF header of binaries produced by the GNU toolchain. > It carefully avoids doing this for binaries conforming to the (new) > official EABI. I removed the setting of the ABI for unrecognized EABI > versions. These will default to ARM_ABI_ACPS anyway, later on. > > With this patch, GDB correctly recognizes that OpenBSD/arm binaries > use the "sofvfp" floating-point model, which reduces the number of > testsuite failures considerably. > > ok? > > Mark > > P.S. It seems the code to detect the correct floating-point model is > somewhat busted; arm-linux-tdep.c, armnbsd-tdep.c and now > armobsd-tdep.c contain code to set tdep->fp_model if it is still set > to ARM_FLOAT_AUTO, but that never seems to happen. > > > Index: ChangeLog > from Mark Kettenis > > * arm-tdep.c (arm_gdbarch_init): Get default floating-point model > from ELF flags for binaries produced by the GNU toolchain. I fear this isn't going to work; though not because of anything you've done (in principle, I think your changes are fine). The problem is that in the most common configuration still using the legacy ELF format (arm-unknown-elf) the flags are generated incorrectly by the compiler/assembler combination. These tools fail to correctly set the softfpa bit in the ELF header and the result is that gdb will think they contain FPA instructions when they do not. Thus I think this change will cause a large number of new failures on arm-elf. I guess we could fudge this by making the auto-detect code fold case 0 on to case EF_ARM_SOFT_FLOAT, but it would need a big comment to explain the background. R.