diff options
author | Mark Kettenis <kettenis@gnu.org> | 2006-07-19 18:21:36 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2006-07-19 18:21:36 +0000 |
commit | 6b26d61a05265b986511b3333505f9a0e5b1ac2c (patch) | |
tree | f24e6e615eaa8955330c74d3b10935477c6d62f5 /gdb | |
parent | c1cb7e02385908b330da7c76461d83c56782a0c3 (diff) | |
download | fsf-binutils-gdb-6b26d61a05265b986511b3333505f9a0e5b1ac2c.zip fsf-binutils-gdb-6b26d61a05265b986511b3333505f9a0e5b1ac2c.tar.gz fsf-binutils-gdb-6b26d61a05265b986511b3333505f9a0e5b1ac2c.tar.bz2 |
* arm-tdep.c (arm_gdbarch_init): Get default floating-point model
from ELF flags for binaries produced by the GNU toolchain.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 39 |
2 files changed, 36 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f19a243..15aca3c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2006-07-19 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. + 2006-07-18 Nathan Sidwell <nathan@codesourcery.com> * remote-fileio.c (remote_fileio_func_rename): Reorder to process diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 44eb897..a36ade5 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2594,7 +2594,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (arm_abi == ARM_ABI_AUTO && info.abfd != NULL) { - int ei_osabi; + int ei_osabi, e_flags; switch (bfd_get_flavour (info.abfd)) { @@ -2611,19 +2611,18 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_target_elf_flavour: ei_osabi = elf_elfheader (info.abfd)->e_ident[EI_OSABI]; + e_flags = elf_elfheader (info.abfd)->e_flags; + if (ei_osabi == ELFOSABI_ARM) { /* GNU tools used to use this value, but do not for EABI - objects. There's nowhere to tag an EABI version anyway, - so assume APCS. */ + objects. There's nowhere to tag an EABI version + anyway, so assume APCS. */ arm_abi = ARM_ABI_APCS; } else if (ei_osabi == ELFOSABI_NONE) { - int e_flags, eabi_ver; - - e_flags = elf_elfheader (info.abfd)->e_flags; - eabi_ver = EF_ARM_EABI_VERSION (e_flags); + int eabi_ver = EF_ARM_EABI_VERSION (e_flags); switch (eabi_ver) { @@ -2640,8 +2639,32 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; default: + /* Leave it as "auto". */ warning (_("unknown ARM EABI version 0x%x"), eabi_ver); - arm_abi = ARM_ABI_APCS; + break; + } + } + + if (fp_model == ARM_FLOAT_AUTO) + { + int e_flags = elf_elfheader (info.abfd)->e_flags; + + switch (e_flags & (EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT)) + { + case 0: + /* Leave it as "auto". Strictly speaking this case + means FPA, but almost nobody uses that now, and + many toolchains fail to set the appropriate bits + for the floating-point model they use. */ + break; + case EF_ARM_SOFT_FLOAT: + fp_model = ARM_FLOAT_SOFT_FPA; + break; + case EF_ARM_VFP_FLOAT: + fp_model = ARM_FLOAT_VFP; + break; + case EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT: + fp_model = ARM_FLOAT_SOFT_VFP; break; } } |