AVR: Tag object files with double/long double ABI attributes.
AVR libgcc now tags object files with ABI attributes for double and long double sizes.
The AVR backend now tags object files with .gnu_attribute 8 for double and .gnu_attribute 12 for long double. This follows the compiler’s practice of only tagging units where these types are actively used, addressing a PR for incorrect ABI handling.
In Details
This commit updates libgcc's AVR backend to emit .gnu_attribute 8 (Tag_GNU_AVR_BITS_DOUBLE) and .gnu_attribute 12 (Tag_GNU_AVR_BITS_LONG_DOUBLE) in object files. These attributes convey the size of double and long double types, aligning with the compiler's ABI decisions. The tagging is conditional, only applied when the respective type size differs from the default or when HAVE_AS_AVR_GNU_ATTRIBUTE is defined, ensuring correct ABI linkage for AVR targets.
- AVR
- A family of microcontrollers developed by Atmel (now Microchip Technology). GCC has a backend for generating code for these processors.
- libgcc
- The GCC runtime library, containing essential functions for compiled programs, such as exception handling, integer division, and floating-point emulation.
- .gnu_attribute
- An ELF section used to store implementation-defined attributes for specific targets or ABIs. The AVR target uses specific attributes to denote floating-point type sizes.
- ABI
- Application Binary Interface. Defines how compiled code for a program should be run, including how functions are called, how data is passed, and how the operating system interacts with programs.