On Thu, 19 Dec 2024, Georg-Johann Lay wrote:
> This patch adds a new target hook that allows the backend to asm output
> a variable definition in its own way.  This hook is needed because
> varasm.cc imposes a very restrictive layout for all variable definitions
> which will be basically ELF style (on ELF targets as least).  To date,
> there is no way for a backend to output a variable definition in a
> different way.
> 
> This hook is required by the avr backend when it outputs definitions
> for variables defined with the "io", "io_low" or "address" attribute
> that don't follow ELF style.  These attributes are basically symbol
> definitions of the form
> 
>    .global var_io
>    var_io = 32
> 
> with some additional assertions.
> 
> The avr part that uses TARGET_ASM_VARIABLE is patch part 2/2.

GCC terminology mixup: the example defines a *symbol*, not a 
variable.  IIUC, you use it in 2/2 for output of *declarations*.

(As is, people may not find it when looking for what it does, or 
may think it does something else.)
wheel.)

brgds, H-P

Reply via email to