On Tue, 20 Apr 2021 at 06:42, Peng Yu wrote: > > Hi, > > I am trying to understand where are unnamed string constants are > defined in symbol tables. > > In the following example, the unnamed string constant is "Hello World!". > > $ cat a.c > #include <stdio.h> > int main() { puts("Hello World!"); } > $ gcc -c a.c > $ gcc -o a.out a.o > > But I don't find it in the symbol table. Could anybody point to me > where it is? Thanks. The ELF format puts string literals in the .rodata section, not the .symtab. $ readelf -p .rodata a.out String dump of section '.rodata': [ 10] Hello World!