[PATCH] Add support for non-contiguous memory regions

Christophe Lyon christophe.lyon@linaro.org
Wed Jun 3 12:48:54 GMT 2020


On Tue, 2 Jun 2020 at 14:49, Alexander Fedotov <alfedotov@gmail.com> wrote:
>
> Hello Christophe
>
> I found it very useful feature.

Thanks for the positive feedback, that's good to read.

> But I'm just curious if it is possible to extend linker syntax to support syntax with output regions separated by OR :
>
> text : { *(.text*) }  > REGION0 | REGION1 | REGION2
>

I think this was discussed in the original thread, eg
https://sourceware.org/legacy-ml/binutils/2017-02/msg00250.html and
https://sourceware.org/legacy-ml/binutils/2017-03/msg00020.html

I would look nice indeed, I just fear unexpected complications since
this modifies the linker script language.

Maybe some main maintainers have thoughts on the difficulty and risks
of implementing this? Nick?

Thanks,

Christophe

> It is more convenient in some cases. For example CMSIS has linker script like this:
>
>   .text :
>   {
>     KEEP(*(.vectors))
>     *(.text*)
>
>     KEEP(*(.init))
>     KEEP(*(.fini))
>
>     /* .ctors */
>     *crtbegin.o(.ctors)
>     *crtbegin?.o(.ctors)
>     *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
>     *(SORT(.ctors.*))
>     *(.ctors)
>
>     /* .dtors */
>      *crtbegin.o(.dtors)
>      *crtbegin?.o(.dtors)
>      *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
>      *(SORT(.dtors.*))
>      *(.dtors)
>
>     *(.rodata*)
>     KEEP(*(.eh_frame*))
>   } > FLASH
>
> So that we have to duplicate this rather than use | in output regions.
>
> What do you think?
>
> Alex
>
>
> On Fri, Mar 13, 2020 at 5:46 PM Christophe Lyon via Binutils <binutils@sourceware.org> wrote:
>>
>> On Fri, 13 Mar 2020 at 15:21, Nick Clifton <nickc@redhat.com> wrote:
>> >
>> > Hi Christophe,
>> >
>> > > Ping?
>> > >
>> > > https://sourceware.org/pipermail/binutils/2020-February/109942.html
>> >
>> > Oops - sorry - the patch is good.  Approved - please apply.
>> >
>>
>> Thanks!
>> Pushed as abf874aafe3d717573e4a48bf0e3c6334e666a55
>>
>> Christophe
>>
>> > Cheers
>> >   Nick
>> >


More information about the Binutils mailing list