AVR object files tagged with double/long double bit sizes.
AVR object files now include .gnu_attribute tags for double and long double precision.
This patch introduces .gnu_attribute tags to AVR object files, specifically indicating the bit sizes used for double (8 bits) and long double (12 bits). This tagging is performed by new mini-passes that scan the code and varpool for the presence of these types. This information helps manage shared multilibs and ensures correct linking when different floating-point precisions are involved.
In Details
New .gnu_attribute tags (Tag_GNU_AVR_BITS_LONG_DOUBLE, Tag_GNU_AVR_BITS_DOUBLE) are emitted for AVR object files. avr_pass_has scans GIMPLE for long double and double usage, while avr_file_end checks the varpool. This allows for more flexible multilib sharing by avoiding overly strict linking based solely on -m[long-]double=X flags, referencing PR34557 for Binutils 2.48 attribute handling.
- .gnu_attribute
- A section in an object file that contains GNU-specific attributes or metadata about the object. These attributes can convey information about the target architecture, compilation flags, or other characteristics.
- AVR
- A family of microcontrollers manufactured by Atmel (now Microchip Technology). GCC supports targeting these microcontrollers.
- long double
- A floating-point data type that provides higher precision than the standard
doubletype. The exact precision can vary between architectures and compilers. - multilib
- A technique used in toolchains to provide multiple versions of libraries and object files, tailored for different target configurations (e.g., different CPU variants, instruction sets, or floating-point ABIs). This allows a single compiler installation to support a wider range of targets.
- varpool
- The variable pool, a data structure within GCC that stores information about all variables and constants used in a compilation unit.
- GIMPLE
- Generic Intermediate Representation for Many Expressions. A three-address intermediate representation used within GCC for performing optimizations.