public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: [patch, avr] PR31124: Support rodata in flash for more AVR devices
Date: Tue, 12 Dec 2023 09:15:34 +0100	[thread overview]
Message-ID: <216209a1-fd04-47ad-b9ee-fcc15e291a2b@gjlay.de> (raw)
In-Reply-To: <a1d174e0-d096-4bc1-ae65-74fa3da6f31e@gjlay.de>

Am 11.12.23 um 19:33 schrieb Georg-Johann Lay:
> Am 11.12.23 um 16:41 schrieb Nick Clifton:
>> Hi Johann,
>>
>>> This patch adds two new emulations in order to support rodata in
>>> flash for more devices.
>>
>> Patch approved - please apply.  (Or let me know and I will apply it 
>> for you).
> 
> Hi Nick,
> 
> I do not have write access to Binutils, at least I never asked for it.
> 
>>> What I am unsure about 
>>
>> Err - didn't you write this patch ?
> 
> I did.  But even after studying the documentation many things are
> not 100 clear.
> 
>>> is the ABSOLUTE in avrxmega2_flmap.x:
>>>
>>>    .rodata  __rodata_start   :  AT (__rodata_load_start)
>>>    {
>>>      ...
>>>       __rodata_end = ABSOLUTE(.) ;
>>>    }  > rodata
>>>
>>> No other places in the ld scripts use ABSOLUTE, e.g. for __data_end in:
>>>
>>>    .data :
>>>    {
>>>       ...
>>>       PROVIDE (__data_end = .) ;
>>>    }  > data AT> text
>>
>> The difference is, presumably, that the symbols are going to be used
>> in different ways.  The __data_end symbol, for example is more like a
>> size-of-the-data-section symbol whereas the __rodata_end symbol is more
>> of a no-more-read-only-data-after-this-address kind of symbol.
>>
>> Cheers
>>    Nick
> 
> The startup code copies __data_load_start...__data_load_end-1 to
> __data_start...__data_end-1, so the date size is the difference.
> 
> There is currently no use for the rodata symbols; I added them in
> case a user wants to compute CRC etc.
> 
> The hardware has the assertion that __rodata_load_start - __rodata_start
> must be 0 mod 0x8000.  And it should always be the case that
> __rodata_load_end - __rodata_load_start = __rodata_end - __rodata_start.
> I am just unsure if that's always the case, e.g. when the user starts
> moving stuff around with objcopy or whatnot.

When the user uses objcopy or something to patch the result from the
final link, then the ld script cannot diagnose that with ASSERT.
So presumably I am overthinking all this...

Johann

> I tested with -Ttext; and when .text reaches into .rodata, then both
> LMA and VMA are shifted in sync like it's supposed to be.
> 
> 
> Johann

  reply	other threads:[~2023-12-12  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-09 17:37 Georg-Johann Lay
2023-12-11 15:41 ` Nick Clifton
2023-12-11 18:33   ` Georg-Johann Lay
2023-12-12  8:15     ` Georg-Johann Lay [this message]
2023-12-12 11:31     ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=216209a1-fd04-47ad-b9ee-fcc15e291a2b@gjlay.de \
    --to=avr@gjlay.de \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).