On Tue, Sep 9, 2014 at 10:06 PM, Andreas Schwab <sch...@suse.de> wrote:
> Kito Cheng <kito.ch...@gmail.com> writes:
>
>> .align 2
>> bufbuf.4078:
>> .space 8
>> ...
>> .ident "GCC: (GNU) 5.0.0 20140828 (experimental)"
>>
>>
>> And then the size info will missing:
>>
>> $ arm-none-eabi-objdump ./foo.o  -t
>>
>> ./foo.o:     file format elf32-littlearm
>>
>> SYMBOL TABLE:
>> 00000000 l    df *ABS* 00000000 zoo.c
>> 00000000 l    d  .text 00000000 .text
>> 00000000 l    d  .data 00000000 .data
>> 00000000 l    d  .bss 00000000 .bss
>> 00000000 l       .bss 00000008 bufbuf.4078
>
> The size of bufbuf.4078 appears to be correct.

Oops, my mistake, this will get correct size after this patch,
it will get zero size without this patch :)

$ cat foo.c:
void foo (void) {
  static char bufbuf[8];
}

$ arm-none-eabi-gcc ./foo.c  -S -o -

# before this patch
...
 .bss
 .align 2
 bufbuf.4078:
 .space 8
 .ident "GCC: (GNU) 5.0.0 20140908 (experimental)"

# after this patch (add size directive )
...
.bss
.align 2
bufbuf.4078:
.space 8
.size bufbuf.4078, 8
.ident "GCC: (GNU) 5.0.0 20140909 (experimental)"

Another solution is just don't define ASM_OUTPUT_ALIGNED_DECL_LOCAL
and use default one,
it will use .local + .comm (same as arm-linux-gnueabi)

...
.size foo, .-foo
.local bufbuf.4078
.comm bufbuf.4078,8,4
.ident "GCC: (GNU) 5.0.0 20140909 (experimental)"



> Andreas.

Reply via email to