On 14.06.2023 18:36, Shawn Anastasio wrote:
> On Wed Jun 14, 2023 at 10:51 AM CDT, Jan Beulich wrote:
>> On 13.06.2023 16:50, Shawn Anastasio wrote:
>>> + DECL_SECTION(.bss) { /* BSS */
>>> + __bss_start = .;
>>> + *(.bss.stack_aligned)
>>> + . = ALIGN(PAGE_SIZE);
>>> + *(.bss.page_aligned)
>>
>> ... the one between the two .bss parts looks unmotivated. Within
>> a section definition ALIGN() typically only makes sense when followed
>> by a label definition, like ...
>
> Correct me if I'm wrong, but wouldn't the ALIGN here serve to ensure
> that the subsequent '.bss.page_aligned' section has the correct alignment
> that its name implies?
Yes and no. Thing is that every contribution to .bss.page_aligned already
needs to specify page alignment itself, or else it may break if any earlier
contribution was page-aligned, but not a full page in size (which I think
the compiler wouldn't allow to happen, but assembly code can result in
such). Note how this very ALIGN() was recently dropped from RISC-V code,
and my respective Arm side patch is also about to go in.
Jan