сб, 22 авг. 2026 г. в 15:29, Georg-Johann Lay <[email protected]>:
>
> Here is an updated version 2 of the patch.
>
> I am planning to also add .gnu_attribute for other aspects of
> the ABI (Binutils patches are pending), and therefore I changed
> some variable names to better fit the future features so I don't
> have to touch parts of the patch again.
>
> Moreover, scanning variables has been moved from encode_section_info
> to avr_file_end.  The commit message and changelog are basically the
> same:
>
> --
>
> This patch emits .gnu_attribute 4 (Tag_GNU_AVR_VTABLE_AS) according
> to the named address space used for C++ virtual tables.
>
> Currently there are only two values possible:
> - Val_GNU_AVR_VTABLE_NONE: The unit doesn't use vtables.
> - Val_GNU_AVR_VTABLE_RAM:  There are vtables in the generic space.
>
> The purpose of the patch is to tag object files with the vtable AS
> for the case when future extensions support vtables in ASes other
> than generic.
>
> The patch has four parts:
>
> 1) Add a configure test to define HAVE_AS_AVR_GNU_ATTRIBUTE
>     when Binutils support .gnu_attribute for AVR.
>     The test may return true for older Binutils versions that
>     effectively ignore the .gnu_attribute.
>
> 2) Set avr_uses_vtable_p when the code invokes an indirect call
>     to a vtable entry.  This check is performed by a new mini
>     pass that traverses gimple statements.
>
> 3) avr_file_end() sets avr_uses_vtable_p when the varpool contains
>     a decl that represents a vtable.
>
> 4) avr_file_end() emits .gnu_attribute 4 according to avr_uses_vtable_p.
>
> Again, this is for trunk.
>

Approved.
Please apply.

Denis

Reply via email to