This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: gcc3.3 everything in the data segment?
On Fri, 2003-08-08 at 06:11, Andrew Lunn wrote:
> > Perhaps a change in naming conventions for the sections containing
> > uninitialized variables? Looking at an objdump from GCC 3.2.1, these
> > all get put into .bss. If 3.3 is putting them into .data.XXX sections
> > instead, then they will always get put into the data segment. An
> > objdump of tm_basic.o should show what's going on.
>
> I've found out a bit more. I have a little test case: bss.c
>
> int foo;
> static int bar;
> int fred=1;
>
> ~$ mips64vr-elf-gcc -save-temps -o bss.o -c bss.c
>
> ~$ cat bss.s
> .file 1 "bss.c"
> .section .mdebug.abiO64
> .previous
> .globl fred
> .sdata
> .align 2
> .type fred, @object
> .size fred, 4
> fred:
> .word 1
>
> .comm foo,4
>
> .lcomm bar,4
>
> which is correct. .comm and .lcomm get put into the bss, and fred goes
> into sdata.
>
> But
> ~$ mips64vr-elf-gcc -save-temps -o bss.o -c bss.c -fdata-sections
> ~$ cat bss.s
> .file 1 "bss.c"
> .section .mdebug.abiO64
> .previous
> .globl fred
> .section .sdata.fred,"aw",@progbits
> .align 2
> .type fred, @object
> .size fred, 4
> fred:
> .word 1
> .globl foo
> .section .data.foo,"aw",@progbits
> .align 2
> .type foo, @object
> .size foo, 4
> foo:
> .space 4
> .section .data.bar,"aw",@progbits
> .align 2
> .type bar, @object
> .size bar, 4
> bar:
> .space 4
>
> They go into the sdate or data section!
>
> Googling found nothing. I've got 3.3.1 compiling at the moment. If
> that does the same i'll submit a bug report using this as a test case.
>
While I agree that these should probably be in something other than
".data.XXX", I do see this as an improvement since it gives the linker
garbage collection a chance to removed unused data objects - better
than before.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss