This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Allow linker scripts to specify multiple output regions for an output section?
- From: Nick Clifton <nickc at redhat dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>, Tejas Belagod <Tejas dot Belagod at arm dot com>, binutils <binutils at sourceware dot org>, Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, Peter Smith <peter dot smith at linaro dot org>, Alan Modra <amodra at gmail dot com>
- Date: Wed, 24 Jul 2019 08:28:05 +0100
- Subject: Re: [RFC] Allow linker scripts to specify multiple output regions for an output section?
- References: <20170309120639.GF3472@ratatosk> <593A92AB.6020609@foss.arm.com> <20170609133536.GA3343@ratatosk> <CAKdteObm+JZvH6ZZ=A08-P9WqQG-PjpaF=gqM+5=LQXxwSOPOw@mail.gmail.com> <20190702064857.GA3414@ratatosk> <CAKdteOZ4k1XrQ97GX4hhiK0xS=fA75Wv1bUUVhW0dcPjP26Z8A@mail.gmail.com>
Hi Christophe,
>> The simplified implementation does not require modification of linker
>> script syntax. It also allows explicit placement of chosen input
>> sections in a preferred memory section. In addition to simple flowing of
>> *(.data) *(.data.*):
>> SECTIONS
>> {
>> .raml : AT ( ADDR (.text) + SIZEOF (.text) )
>> { _rmal_start = . ;
>> *(.boot) ;
>> *(.data) *(.data.*) ;
>> _raml_end = . ;
>> } > RAML
>>
>> .ramu : AT ( ADDR (.raml) + SIZEOF (.raml) )
>> { _rmau_start = . ;
>> *(.data) *(.data.*) ;
>> _ramu_end = . ;
>> } > RAMU
> What do maintainers think about this? Would it be acceptable?
Yes, but you need to be very careful about what happens when switching
from one output section to another. Can the linker backtrack to an
earlier output section if it subsequently finds an input section which
will fit in the remaining space ?
If you do allow backtracking then the ordering of sections can change
from the current linker's specified behaviour (sections are linked in
input order unless a SORT keyword is used). And so users will complain.
If you don't allow backtracking then there could be gaps in memory
regions which could have been used, and users will complain... :-)
Cheers
Nick