This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add missing size directive for arm-*-elf
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Kito Cheng <kito dot cheng at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "nickc at redhat dot com" <nickc at redhat dot com>
- Date: Tue, 09 Sep 2014 14:33:54 +0100
- Subject: Re: [PATCH] Add missing size directive for arm-*-elf
- Authentication-results: sourceware.org; auth=none
- References: <CA+yXCZAhAJYTN1XbUxKmu8zg=SAjrLPhp2njffjPKWGhnH68jA at mail dot gmail dot com> <CAJA7tRbEVus71CZLE2YA3o9SbJTDNYz_AyaiPwejgBRFZEmtnQ at mail dot gmail dot com>
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.
>