Using objdump, I found that the name is not in the ELF file
Works for me on Arch Linux with GNU binutils 2.28.0-3. Maybe you shared your binary after the link?
$ gcc -Wall -m32 -nostdlib gas-symbols.S
$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, BuildID[sha1]=d5fdff41cc52e9de3b4cdae34cf4129de2b4a69f, not stripped
$ nm a.out
080490ee B __bss_start
080490f0 b buffer ### local symbol in the bss
080490ee D _edata
080490fc B _end
080490c4 d output
080480b8 T _start
-g, . , , -static -nostdlib. , . Q & A asm 32 64- gcc as ld. NASM ld.
( , .code32 . , , , .code32, , , (, push %ebx), 32- 64- .)
as ld ( gcc , gcc -v, , ), .
$ as gas-symbols.S -o gas-symbols.o --32 &&
ld -o a.out gas-symbols.o -m elf_i386
$ nm a.out
...
080490b0 b buffer ## Still there
...
GDB, Jester, , . GDB , . ( . , , gcc -S static char foo[100]; ( .)
, GDB , :
$ gdb ./a.out
(gdb) b _start
(gdb) r
Starting program: /home/peter/src/SO/a.out
Breakpoint 1, _start () at gas-symbols.S:10
(gdb) p buffer
$1 = 0
(gdb) p &buffer
$2 = (<data variable, no debug info> *) 0x80490f0 <buffer>
(gdb) ptype buffer
type = <data variable, no debug info>
, x:
(gdb) p (char[12])buffer
$4 = '\000' <repeats 11 times>
(gdb) p /x (char[12])buffer
$5 = {0x0 <repeats 12 times>}
(gdb) x /4w &buffer
0x80490f0 <buffer>: 0x00000000 0x00000000 0x00000000 0x00000000
(gdb) help x
asm ~/.gdbinit:
set disassembly-flavor intel
layout reg
set print static-members off
AT & T, , , Intel. layout asm/layout reg . . x86 wiki. - .