This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc3.3 everything in the data segment?


Hi Folks

A request to anybody else out there who is using gcc 3.3. Please could
you run this test with your compiler. Does foo and bar go into the
data or the bss segment? Is it just mips64vr-elf that is broken or
some other/all targets.

If you can reproduce it please add a comment to 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11854

This is bad for embedded systems. My image which should be around
700kBytes becomes 6.5Mbytes because of all the symbols in the data
segment that should be in the bss.

        Thanks
                Andrew

> 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.
> 
>      Andrew
> 
> 
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> 

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]