This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: nm: missing .rodata.*.str1.1 symbols
- From: Nick Clifton <nickc at redhat dot com>
- To: Clément Péron <peron dot clem at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 23 Feb 2017 16:20:23 +0000
- Subject: Re: nm: missing .rodata.*.str1.1 symbols
- Authentication-results: sourceware.org; auth=none
- References: <CAJiuCcdAaBGuBnhSz4jSFTjg9kFV3i4=VQ5uzOT0TM73HEwq2g@mail.gmail.com> <ea2eed6a-30af-9dbf-815c-4e8b7adf3c90@redhat.com> <CAJiuCcd2=OKCh5FTkqn1BdLAaMVxRct_9x0K1ZzW1k12ddZMXQ@mail.gmail.com>
Hi Clément,
> Is it possible to find the information that /tmp/cc9j6Kh2.o fill 8bytes in the
> .rodata.str1.1 section somewhere else than in the map file ?
Well you could always look in object files concerned. For example if you add
"--save-temps" to your gcc command line then the object files will be created
in the current directory, rather than as temporary files. Then in the app.elf.map
file you should see something like:
.rodata.str1.1
0x00000000004005d0 0xb main.o
*fill* 0x00000000004005db 0x5
.rodata 0x00000000004005e0 0x17 main.o
0x00000000004005e0 str
.rodata.str1.1
0x00000000004005f7 0x8 test.o
So the first .rodata.str1.1 section is found in main.o and the second one in test.o.
You could then use readelf to look at the contents of the section. For example:
$ readelf -x .rodata.str1.1 test.o
Hex dump of section '.rodata.str1.1':
0x00000000 6d657267 653f3f00 merge??.
Which makes it pretty obvious that the contents are the string "merge??". Alternatively
you could just look in the assembler source files that will have been created by the
--save-temps command line option:
$ grep -A 3 -e str1.1 test.s
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "merge??"
.text
Cheers
Nick