Re: [PATCH 1/2] sh: align .bss section padding to 8-byte boundary
From: David Laight
Date: Thu Mar 13 2025 - 05:39:01 EST
On Wed, 12 Mar 2025 10:47:00 +0100
Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> Hi Uros,
>
> On Wed, 12 Mar 2025 at 09:32, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> > On Wed, Mar 12, 2025 at 9:22 AM John Paul Adrian Glaubitz
> > <glaubitz@xxxxxxxxxxxxxxxxxxx> wrote:
....
> > > OK. FWIW, do you understand what SBSS is for? I couldn't find any explanation
> > > for it.
> >
> > Small BSS section. The compiler can put data objects under a certain
> > size threshold to the .sbss section. Looking at GCC sh config, sh does
> > not use this section.
The .sbss (and .sdata) sections are used by some architectures (eg Nios2)
for data that can be accessed using a 16bit offset from a fixed register.
(Although using the register as global register variable generates better code.)
Historically they may have been used for data at the top/bottom of the
addresses space (for the same reason).
There is no reason to just use it for 'small' (eg 8 bytes or less)
data, that is just some empirical default.
I guess they could also be used on cpu like the strongarm for memory
that used the 'small data cache' (useful for screen buffer memory!).
David