section `.sbss' type changed to PROGBITS (Was: ld 2.18 --gc-sections bug? (with testcase))

Rask Ingemann Lambertsen rask@sygehus.dk
Mon Dec 10 18:23:00 GMT 2007


On Mon, Dec 10, 2007 at 05:11:23PM +0100, Rask Ingemann Lambertsen wrote:
> 
>    This triggers all the time on m32r-unknown-elf (as least with GCC
> compiled programs):
> ld-new: section `.sbss' type changed to PROGBITS
> 
> 1) Is it something which should be fixed? If so, pointers appreciated. For
> example, I can't even tell which file is causing it in spite of trying
> "--verbose --print-map".

   I found that GCC generates this when compiling newlib:

        .global __malloc_top_pad
        .section        .sbss,"aw",@nobits
        .balign 4
        .type   __malloc_top_pad, @object
        .size   __malloc_top_pad, 4
__malloc_top_pad:
        .zero   4
...
        .global __malloc_max_sbrked_mem
        .section        .sbss
        .balign 4
        .type   __malloc_max_sbrked_mem, @object
        .size   __malloc_max_sbrked_mem, 4
__malloc_max_sbrked_mem:
        .zero   4
        .global __malloc_max_total_mem
        .balign 4
        .type   __malloc_max_total_mem, @object
        .size   __malloc_max_total_mem, 4
__malloc_max_total_mem:
        .zero   4

   The resulting object file has this:

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
...
  3 .sbss         0000000c  00000000  00000000  00000a94  2**2
                  CONTENTS, ALLOC, LOAD, DATA

   It is enough to assemble just the __malloc_top_pad part above to
reproduce the problem:

$ as-new ~/nobits.s -o ~/nobits.o
as-new: section `.sbss' type changed to PROGBITS

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year



More information about the Binutils mailing list