The .sbss section on ELF/x86
Jakub Jelinek
jakub@redhat.com
Tue Nov 13 15:28:00 GMT 2001
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...
Jakub
More information about the Binutils
mailing list