[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] It is more than: .byte SYMA - SYMB
From: |
Denis Chertykov |
Subject: |
Re: [avr-gcc-list] It is more than: .byte SYMA - SYMB |
Date: |
15 Sep 2003 18:39:45 +0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Joerg Wunsch <address@hidden> writes:
> As Denis Chertykov <address@hidden> wrote:
>
> >> c: .string "Hello World"
> >> .align 2
> >> d: ldi XH,pm_hi8(d - c) <- OK
> >> ldd r16,Y+(d - c) <- Error: constant value required
>
> >This happened because relocations for Y+N or Z+N not supported.
> >Please read GAS info about relocations.
>
> Still, i don't see (after reading the gas manual) when the assembler
> decides that it'll be a relocation vs. an absolute expression.
>
> Am i right that changing the code like this would make it an
> absolute expression again?
No, because I have supported special relocation for `ldi' this reloc
called `R_AVR_HI8_LDI_PM'. You can look at bfd/elf32-avr.c
>
> .align 2
> c: .string "Hello World"
> .align 2
> d: ldi XH,pm_hi8(d - c) <- OK
> ldd r16,Y+(d - c) <- Error: constant value required
>
> If not, i'm confused, since as far as i can tell, in the above,
> d - c is an assembly-time constant expression.
I don't know why GAS treat (d - c) as not a constant value, but I see
that (d - c) work as relocatable expression.
Denis.
PS: GAS isn't so good as GCC.