[Pkg-pascal-devel] Bug#1038868: fpc: armhf binaries should have the hard-float ELF flag set
Emanuele Rocca
ema at debian.org
Thu Jun 22 10:54:29 BST 2023
Package: fpc
Version: 3.2.2+dfsg-21
Hi,
binaries produced by fpc on armhf currently lack the hard-float ELF
flag.
I've built the following hello world program with `fpc hello.pas`:
program Hello;
begin
writeln ('Hello, world.');
end.
The resulting ELF object looks like this, note in particular the value
of "Flags", namely "0x5000200, Version5 EABI, soft-float ABI". This
should be "0x5000400, Version5 EABI, hard-float ABI" instead.
$ readelf -h hello
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x100ec
Start of program headers: 52 (bytes into file)
Start of section headers: 231208 (bytes into file)
Flags: 0x5000200, Version5 EABI, soft-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 4
Size of section headers: 40 (bytes)
Number of section headers: 10
Section header string table index: 9
Compare with a C hello world program built with `gcc hello.c`, and again
note the value of Flags: "0x5000400, Version5 EABI, hard-float ABI".
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Position-Independent Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x409
Start of program headers: 52 (bytes into file)
Start of section headers: 6692 (bytes into file)
Flags: 0x5000400, Version5 EABI, hard-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 29
Additionally, the attribute "Tag_ABI_VFP_args" should be set to "VFP registers".
$ readelf -A hello
Attribute Section: aeabi
File Attributes
Tag_CPU_arch: v4T
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
And compare with the attributes in the ELF file produced by GCC:
$ readelf -A a.out
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_rounding: Needed
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_VFP_args: VFP registers
Tag_CPU_unaligned_access: v6
More information about the Pkg-pascal-devel
mailing list