This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Initialize default floating-point model on ARM for GNU binaries
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 18 Jul 2006 17:31:56 +0100
- Subject: Re: Initialize default floating-point model on ARM for GNU binaries
- References: <200607172250.k6HMoIN2009013@elgar.sibelius.xs4all.nl>
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 <kettenis@gnu.org>
>
> * 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.