The .sbss section on ELF/x86

H . J . Lu hjl@lucon.org
Tue Nov 13 17:16:00 GMT 2001


On Tue, Nov 27, 2001 at 12:42:46AM +0100, Jakub Jelinek wrote:
> On Tue, Nov 27, 2001 at 10:00:48AM +1030, Alan Modra wrote:
> > On Mon, Nov 26, 2001 at 12:13:01PM -0800, H . J . Lu wrote:
> > > I am not aware ELF/x86 ever uses .sbss. But there is always an empty
> > > .sbss section in every x86 ELF binart. Does it have to be therre?
> > 
> > No.  From memory, I think the PROVIDEs in the sbss output section
> > will create the section.
> 
> So IMHO there is the question whether ld should provide __sbss_start etc.
> symbols even if there is no .sbss section or not.
> If yes, then the linker script should be:
>   __bss_start = .;
>   PROVIDE (__sbss_start = .);
>   PROVIDE (___sbss_start = .);
>   .sbss      :
>   {
>     *(.dynsbss)
>     *(.sbss)
>     *(.sbss.*)
>     *(.gnu.linkonce.sb.*)
>     *(.scommon)
>   }
>   PROVIDE (__sbss_end = .);
>   PROVIDE (___sbss_end = .);
>   .bss       :
>   {
>    *(.dynbss)
>    *(.bss)
>    *(.bss.*)
>    *(.gnu.linkonce.b.*)
>    *(COMMON)
> 
> if not, then either PROVIDE should be changed, so that it is skipped if the
> containing output section is empty, or some other keyword should be used
> instead. Having empty .sbss in every binary/library is strange...
> 

Geoff, I think your patch:

http://sources.redhat.com/ml/binutils/2000-04/msg00125.html

caused the empty .sbss section. Could you please tell us how to remove
the empty .sbss section? If only PPC needs it, can we turn them on only
when needed?

Thanks.


H.J.



More information about the Binutils mailing list