This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] Add missing size directive for arm-*-elf


On 09/09/14 14:32, Ramana Radhakrishnan wrote:
> On Mon, Sep 1, 2014 at 4:30 AM, Kito Cheng <kito.cheng@gmail.com> wrote:
>> Hi all:
>>
>> In arm-*-elf target some variable will missing size directive,
>>
>> for example:
>>
>> foo.c:
>>
>> void foo (void) {
>>   static char bufbuf[8];
>> }
>>
>> $ arm-none-eabi-gcc ./foo.c  -S -o -
>>
>> ...
>> .align 2
>> bufbuf.4078:
>> .space 8
> 
> 
> Thanks for this patch Kito.
> 
> Nick / Richard : Any historical reasons as to why we use .space
> instead of the more common .comm / .lcomm directives to the assembler
> in the ARM backend ? If there are no reasons should we just move to
> using the standard COMMON_ASM_OP here rather than using .space ?
> Ofcourse needs to be tested to check if there are any missing corner
> cases.
> 

.space puts space in the current section, I believe.  .comm and .lcomm
put the space in the common section; that's very different behaviour.

R.

> Ramana
> 
> 
>> ...
>> .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
>> 00000000 l    d  .comment 00000000 .comment
>> 00000000 l    d  .ARM.attributes 00000000 .ARM.attributes
>> 00000000 g     F .text 00000018 foo
>>
>>
>> ChangeLog
>>
>> 2014-09-01  Kito Cheng  <kito@0xlab.org>
>>
>>         * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL):
>> Add size directive.
> 



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