[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] 8-bit relocations on AVR

From: Erik Christiansen
Subject: Re: [avr-gcc-list] 8-bit relocations on AVR
Date: Sun, 14 Feb 2010 11:12:03 +1100
User-agent: Mutt/1.5.15+20070412 (2007-04-11)

On Sat, Feb 13, 2010 at 08:35:44PM +0300, Andrew Zabolotny wrote:
>       .byte 2f-1f
> 1:    .ascii "somestring"
> 2:

This has been a source of occasional irritation for more than half a
decade now. Klaus Rudolph fixed a couple of cases in a patch, back in
2004, but this one remains.

> I understand that avr-as could be patched to support 8-bit relocations
> (I even found where - gas/config/tc-avr.c, function
> avr_cons_fix_new()). 

Yes, that file rings bells.

> So, is there any other way to do what I want?

If you have no objection to each message having global labels, it is not
only achievable (via the ldi or ldd relocations), but the need to store
the string length is avoided:

   .section .text
;  In the code somewhere, we compute the length when it's needed:
   ldi r16,(end_msg1 - msg1)
;                               or, depending on needs:
   ldd r20,Y+(end_msg1 - msg1)
msg1: .ascii "somestring"

Does that come close enough to meeting your needs?


"There is nothing new under the sun, but there are lots of old things
 we don't know yet."                                  -Ambrose Bierce

reply via email to

[Prev in Thread] Current Thread [Next in Thread]