This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: The .sbss section on ELF/x86
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