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: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: 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>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Richard Earnshaw <richard dot earnshaw at arm dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Tue, 9 Sep 2014 14:32:23 +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>
- Reply-to: ramrad01 at arm dot com
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.
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.