gcc-4.2.1 on armv6 and Tag_ABI_HardFP_use

Olavi Kumpulainen olavi.m.kumpulainen at gmail.com
Thu Sep 24 21:24:18 UTC 2015


Hi everyone,

I have a question regarding armv6 gcc-4.2.1 and Tag_ABI_HardFP_use in the generated ELF objects.

I have a small c-program that looks as;

#include <stdio.h>

double fn(double x, double y)
{
    return x+y;
}

int main(int argc, char *argv[])
{
    printf("%f\n", fn(3.2, 9.7));
    return 0;
}


Compiling this with clang 3.4.1 produces the following results;

$ cc -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: armv6--freebsd10.2-gnueabi
Thread model: posix
Selected GCC installation: 

$ cc -c t.c -march=armv6 -mfloat-abi=soft
$ readelf -a t.o|grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x5000000, Version5 EABI
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP

$ cc -c t.c -march=armv6 -mfloat-abi=softfp
$ readelf -a t.o|grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x5000000, Version5 EABI
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP


Then, if I build a new world using the following src.conf:

$ cat /etc/src.conf
WITH_GCC=yes
WITH_GNUCXX=yes
WITH_GCC_BOOTSTRAP=yes
WITHOUT_CLANG=yes
WITHOUT_CLANG_IS_CC=yes
WITHOUT_CLANG_BOOTSTRAP=yes

And the usual;
make TARGET=arm TARGET_ARCH=armv6 buildworld

and;
make TARGET=arm TARGET_ARCH=armv6 buildenv


# cc -v
Using built-in specs.
Target: armv6-undermydesk-freebsd
Configured with: FreeBSD/armv6 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

# cc -c t.c -march=armv6 -mfloat-abi=soft
# readelf -A t.o |grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x4000000, Version4 EABI
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_optimization_goals: Aggressive Debug

A few more arc-specific tags, but none that strikes me as odd.

But what about -mfloat-abi=softfp?

# cc -c t.c -march=armv6 -mfloat-abi=softfp
# readelf -a t.o |grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x4000000, Version4 EABI
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_ABI_optimization_goals: Aggressive Debug

Are there any reasons for the appearance of the 'Tag_ABI_HardFP_use: SP and DP’ here?


/O




More information about the freebsd-arm mailing list