This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

nm: missing .rodata.*.str1.1 symbols


Hi,
I compile a project but i don't see any .rodata.*.str1.1 symbols in nm.

I made a simple example. Nm displays 2 symbols but the map file
contains 4 symbols
and the sum of the symbols size in the map file match with the .rodata size.

I'm not quite sure how nm works, maybe some debuging symbols of the
.rodata.*str1.1 are missing.
Do you know how to add them or maybe it's an issue with nm ?

Thanks for your help,
Clement

*NM output only 2 .rodata symbols :
$>nm -fs -n app.elf
_IO_stdin_used      |00000000000007a0|   R  |
OBJECT|0000000000000004|     |.rodata
str                 |00000000000007b0|   R  |
OBJECT|0000000000000017|     |.rodata

But app.elf.map have 4 symbols and match with size :
.rodata         0x00000000000007a0       0x27
 *(.rodata .rodata.* .gnu.linkonce.r.*)
 .rodata.cst4   0x00000000000007a0        0x4
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o
                0x00000000000007a0                _IO_stdin_used
 .rodata.str1.1
                0x00000000000007a4        0xb /tmp/ccbpZVpr.o
 *fill*         0x00000000000007af        0x1
 .rodata        0x00000000000007b0       0x17 /tmp/ccbpZVpr.o
                0x00000000000007b0                str
 .rodata.str1.1
                0x00000000000007c7        0x8 /tmp/cc9j6Kh2.o

$>size -A app.elf
.rodata                39      1952

*Using :
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
GNU nm (GNU Binutils for Ubuntu) 2.27

*Compile with:
$>gcc main.c test.c -Wall -Os -g -Wl,-Map,app.elf.map -o app.elf
#include <stdio.h>

void test()
{
	printf("merge??");
}
#include <stdio.h>

extern void test();

const char str[] = "Another str in .rodata";

int main(int argc, char ** argv)
{


	printf("merge??");
	printf("%s", str);

	test();

	return 0;
}

Attachment: app.elf.map
Description: Binary data

Attachment: app.elf
Description: Binary data


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