https://sourceware.org/bugzilla/show_bug.cgi?id=34305
--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Georg-Johann Lay <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8818c47980038800239da822cfef2aa63e0fac1f commit 8818c47980038800239da822cfef2aa63e0fac1f Author: Georg-Johann Lay <[email protected]> Date: Sat Aug 15 22:49:07 2026 +0200 AVR: Add support for .gnu_attribute 4 (Tag_GNU_AVR_VTABLE_AS). The upcoming support for ISO/IEC TR 18037 "Embedded C" named address spaces in G++ would allow to put C++ virtual tables into such an address spaces, see https://gcc.gnu.org/PR69549. The current address space used for vtables is the generic one, which means that RAM is wasted on machines where .rodata is located in RAM. The TARGET_ADDR_SPACE_FOR_ARTIFICIAL_RODATA GCC target hook allows to chose a custom vtable address space. However, in contrast to current user-selectable address spaces, placing vtables in a different address space is an ABI change, so that a means to detect ABI violations is highly appreciated. The feature of choice is .gnu_attribute 4 (Tag_GNU_AVR_VTABLE_AS) which would tag an object file with one of the following values: 0 (Val_GNU_AVR_VTABLE_NONE) for files that neither define nor access vtables. 1 (Val_GNU_AVR_VTABLE_RAM) use the generic address space. 2 (Val_GNU_AVR_VTABLE_FLASH) use the 16-bit address space __flash. 3 (Val_GNU_AVR_VTABLE_FLASH1) use the 16-bit address space __flash1. 4 (Val_GNU_AVR_VTABLE_FLASH2) use the 16-bit address space __flash2. 5 (Val_GNU_AVR_VTABLE_FLASH3) use the 16-bit address space __flash3. 6 (Val_GNU_AVR_VTABLE_FLASH4) use the 16-bit address space __flash4. 7 (Val_GNU_AVR_VTABLE_FLASH5) use the 16-bit address space __flash5. 8 (Val_GNU_AVR_VTABLE_FLASHX) use the 24-bit address space __flashx. A tag value of zero is compatible with all other tag values. Two non-zero tag values are compatible iff they are the same. Unknown tag values are silently accepted an treated just like the values above so as to allow for compatibility with future extensions. PR ld/34305 include/ * elf/avr.h (libiberty.h): Include for ARRAY_SIZE. (Tag_GNU_AVR_VTABLE_AS = 4): New enum. (Val_GNU_AVR_VTABLE_NONE, Val_GNU_AVR_VTABLE_RAM) (Val_GNU_AVR_VTABLE_FLASH, Val_GNU_AVR_VTABLE_FLASH1) (Val_GNU_AVR_VTABLE_FLASH2, Val_GNU_AVR_VTABLE_FLASH3) (Val_GNU_AVR_VTABLE_FLASH4, Val_GNU_AVR_VTABLE_FLASH5) (Val_GNU_AVR_VTABLE_FLASHX, Val_GNU_AVR_VTABLE_Sentinel): New enum values for Tag_GNU_AVR_VTABLE_AS. (avr_tag_vtable_as_name): New static function. bfd/ * configure.ac (tb) [avr_elf32_vec]: Add elf-attrs.lo. * configure: Rebuild. * elf32-avr.h (bfd_avr_elf_merge_private_bfd_data): New proto. * elf32-avr.c (libiberty.h): Include for ARRAY_SIZE. (avr_elf_merge_obj_attributes): New static function. (bfd_avr_elf_merge_private_bfd_data): New function that calls it. (bfd_elf32_bfd_merge_private_bfd_data): Define to bfd_avr_elf_merge_private_bfd_data. gas/ * configure.ac (extra_objects) [avr]: Add config/obj-elf-attr.o. * configure: Rebuild. * config/tc-avr.h (TC_OBJ_ATTR_v1): Define to 1. * doc/as.texi (GNU Object Attributes) [AVR Attributes]: New subsection. * NEWS: Mention PR34305. ld/ * testsuite/ld-avr/attr-gnu-4-1.s: New source. * testsuite/ld-avr/attr-gnu-4-2.s: New source. * testsuite/ld-avr/attr-gnu-4-1.d: New test. * testsuite/ld-avr/attr-gnu-4-2.d: New test. * testsuite/ld-avr/attr-gnu-4-1_2.d: New test. * NEWS: Mention PR34305. binutils/ * readelf.c (display_avr_gnu_attribute): New static function. (process_arch_specific) <EM_AVR>: Call process_attributes with display_avr_gnu_attribute as a callback. -- You are receiving this mail because: You are on the CC list for the bug.
