[patch,avr] PR21849: Locate section .progmemx.* at a higher address.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Georg-Johann Lay-2
Hi, this fixes PR21849:  The current location of data for
avr-gcc named address space __memx is such that it "wastes"
lower addresses in the 16-bit range.

As the compiler is using 24-bit addresses for __memx data which
it located in .progmemx.*, this section can be moved to a higher
address in the linker script.

If ok, please commit.

Would also be great if this can go into 2.29.

Johann

ld/
        PR ld/21849
        * scripttempl/avr.sc: Split .progmemx.* from .progmem.* and locate
        former at a higher address.

bin-pr21849-progmemx.diff (618 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Nick Clifton
Hi Johann,

> Hi, this fixes PR21849:  The current location of data for
> avr-gcc named address space __memx is such that it "wastes"
> lower addresses in the 16-bit range.
>
> As the compiler is using 24-bit addresses for __memx data which
> it located in .progmemx.*, this section can be moved to a higher
> address in the linker script.

> @@ -128,7 +128,7 @@ SECTIONS
>      ${RELOCATING+ *libprintf_flt.a:*(.progmem.data)}
>      ${RELOCATING+ *libc.a:*(.progmem.data)}
>  
> -    ${RELOCATING+ *(.progmem*)}
> +    ${RELOCATING+ *(.progmem.*)}
>      
>      ${RELOCATING+. = ALIGN(2);}
>  
> @@ -196,6 +196,8 @@ SECTIONS
>      *(.hightext)
>      ${RELOCATING+ *(.hightext*)}
>  
> +    ${RELOCATING+ *(.progmemx.*)}
> +
>      ${RELOCATING+. = ALIGN(2);}
>  
>      /* For tablejump instruction arrays.  We don't relax

This does not look right.  It does add the .progmemx.* entry to the high area
but it also removes the .progmem.* entry from the low area.  Why is this needed ?
.progmem.* will not match any .progmemx.* sections, so the two are distinct.

(Note the period character in a section pattern is not a regexp character, it
exactly matches only the period character itself).


> Would also be great if this can go into 2.29.

Sorry - 2.29 is out of the door - so it is too late for this to happen.

Cheers
  Nick


Reply | Threaded
Open this post in threaded view
|

Re: [patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Georg-Johann Lay-2
On 27.07.2017 13:48, Nick Clifton wrote:

> Hi Johann,
>
>> Hi, this fixes PR21849:  The current location of data for
>> avr-gcc named address space __memx is such that it "wastes"
>> lower addresses in the 16-bit range.
>>
>> As the compiler is using 24-bit addresses for __memx data which
>> it located in .progmemx.*, this section can be moved to a higher
>> address in the linker script.
>
>> @@ -128,7 +128,7 @@ SECTIONS
>>       ${RELOCATING+ *libprintf_flt.a:*(.progmem.data)}
>>       ${RELOCATING+ *libc.a:*(.progmem.data)}
>>  
>> -    ${RELOCATING+ *(.progmem*)}
>> +    ${RELOCATING+ *(.progmem.*)}
>>      
>>       ${RELOCATING+. = ALIGN(2);}
>>  
>> @@ -196,6 +196,8 @@ SECTIONS
>>       *(.hightext)
>>       ${RELOCATING+ *(.hightext*)}
>>  
>> +    ${RELOCATING+ *(.progmemx.*)}
>> +
>>       ${RELOCATING+. = ALIGN(2);}
>>  
>>       /* For tablejump instruction arrays.  We don't relax
>
> This does not look right.  It does add the .progmemx.* entry to the high area
> but it also removes the .progmem.* entry from the low area.  Why is this needed ?
> .progmem.* will not match any .progmemx.* sections, so the two are distinct.

There is

+    ${RELOCATING+ *(.progmem.*)}

at the low end.  avr-gcc only generates .progmem.data (or .progmem.gcc*
for old versions) so that .progmem.* catches them all without matching
.progmemx.*

> (Note the period character in a section pattern is not a regexp character, it
> exactly matches only the period character itself).
>
>> Would also be great if this can go into 2.29.
>
> Sorry - 2.29 is out of the door - so it is too late for this to happen.
>
> Cheers
>    Nick

What I meant is back-porting to the 2.29 branch so it will come with 2.29.*.

Johann

Reply | Threaded
Open this post in threaded view
|

Re: [patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Tristan Gingold-2
On 27/07/2017 14:35, Georg-Johann Lay wrote:

> On 27.07.2017 13:48, Nick Clifton wrote:
>> Hi Johann,
>>
>>> Hi, this fixes PR21849:  The current location of data for
>>> avr-gcc named address space __memx is such that it "wastes"
>>> lower addresses in the 16-bit range.
>>>
>>> As the compiler is using 24-bit addresses for __memx data which
>>> it located in .progmemx.*, this section can be moved to a higher
>>> address in the linker script.
>>
>>> @@ -128,7 +128,7 @@ SECTIONS
>>>       ${RELOCATING+ *libprintf_flt.a:*(.progmem.data)}
>>>       ${RELOCATING+ *libc.a:*(.progmem.data)}
>>> -    ${RELOCATING+ *(.progmem*)}
>>> +    ${RELOCATING+ *(.progmem.*)}
>>>       ${RELOCATING+. = ALIGN(2);}
>>> @@ -196,6 +196,8 @@ SECTIONS
>>>       *(.hightext)
>>>       ${RELOCATING+ *(.hightext*)}
>>> +    ${RELOCATING+ *(.progmemx.*)}
>>> +
>>>       ${RELOCATING+. = ALIGN(2);}
>>>       /* For tablejump instruction arrays.  We don't relax
>>
>> This does not look right.  It does add the .progmemx.* entry to the
>> high area
>> but it also removes the .progmem.* entry from the low area.  Why is
>> this needed ?
>> .progmem.* will not match any .progmemx.* sections, so the two are
>> distinct.
>
> There is
>
> +    ${RELOCATING+ *(.progmem.*)}
>
> at the low end.  avr-gcc only generates .progmem.data (or .progmem.gcc*
> for old versions) so that .progmem.* catches them all without matching
> .progmemx.*
>
>> (Note the period character in a section pattern is not a regexp
>> character, it
>> exactly matches only the period character itself).
>>
>>> Would also be great if this can go into 2.29.
>>
>> Sorry - 2.29 is out of the door - so it is too late for this to happen.
>>
>> Cheers
>>    Nick
>
> What I meant is back-porting to the 2.29 branch so it will come with
> 2.29.*.

Ok with me.

Tristan.
Reply | Threaded
Open this post in threaded view
|

Re: [patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Nick Clifton
In reply to this post by Georg-Johann Lay-2
Hi Johann,

> There is
>
> +    ${RELOCATING+ *(.progmem.*)}

Yeah - sorry, my bad - I did not look at the patch closely enough.

> What I meant is back-porting to the 2.29 branch so it will come with 2.29.*.

Ok - fair enough.  I have checked the patch in to the branch and mainline.

Cheers
  Nick


Reply | Threaded
Open this post in threaded view
|

Re: [patch,avr] PR21849: Locate section .progmemx.* at a higher address.

Georg-Johann Lay-2
On 27.07.2017 15:25, Nick Clifton wrote:

> Hi Johann,
>
>> There is
>>
>> +    ${RELOCATING+ *(.progmem.*)}
>
> Yeah - sorry, my bad - I did not look at the patch closely enough.
>
>> What I meant is back-porting to the 2.29 branch so it will come with 2.29.*.
>
> Ok - fair enough.  I have checked the patch in to the branch and mainline.
>
> Cheers
>    Nick

Wow, thanks.  That was fast :-)

Johann