This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Allow linker scripts to specify multiple output regions for an output section?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]