This is the mail archive of the gcc-bugs@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]

[Bug target/26702] Size of static variables always zero on arm-elf



------- Comment #6 from sjackman at gmail dot com  2006-03-15 20:01 -------
Subject: Re:  Size of static variables always zero on arm-elf

On 15 Mar 2006 19:07:12 -0000, pinskia at gcc dot gnu dot org > Can
you try one more thing:
> static int static_foo = 1;
>
> And then use readelf -s on the object file?

$ cat foo.c
int foo;
static int static_foo = 1;
$ arm-elf-gcc -c foo.c
$ arm-elf-readelf -s foo.o | grep foo
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS foo.c
     5: 00000000     4 OBJECT  LOCAL  DEFAULT    2 static_foo
     8: 00000004     4 OBJECT  GLOBAL DEFAULT  COM foo
$ arm-elf-gcc -S foo.c
$ cat foo.s
        .file   "foo.c"
        .data
        .align  2
        .type   static_foo, %object
        .size   static_foo, 4
static_foo:
        .word   1
        .comm   foo,4,4
        .ident  "GCC: (GNU) 4.1.0"


-- 


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


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