Hello everybody,<div><br></div><div>When calling:</div><div><br></div><div>i386-rtems-4.10-nm  --print-size --numeric-sort --line-numbers rtems-img.exe > rtems-img.num</div><div><br></div><div>the list of symbols in the file rtems-img.num produces valid line numbers (location of the symbol in the source code) only for those at .text section.</div>
<div>When the symbol is in .data (or .bss) it seems to be printed as it was in the location of the last symbol in the .text section, instead of the correct file/line number.</div><div><br></div><div>Example of listing:</div>
<div><br></div><div>(... suppressed lines ...)</div><div>001283f4 00000109 T lseek<span class="Apple-tab-span" style="white-space:pre">   </span>/home/developer/rtems-testing/rtems/build-i386-pc386-rtems/i386-rtems4.10/c/pc386/cpukit/libcsupport/../../../../../../rtems/c/src/../../cpukit/libcsupport/src/lseek.c:28</div>
<div>00128500 00000027 T _lseek_r<span class="Apple-tab-span" style="white-space:pre">  </span>/home/developer/rtems-testing/rtems/build-i386-pc386-rtems/i386-rtems4.10/c/pc386/cpukit/libcsupport/../../../../../../rtems/c/src/../../cpukit/libcsupport/src/lseek.c:98</div>
<div>00128528 00000012 T _malloc_r<span class="Apple-tab-span" style="white-space:pre"> </span>/home/developer/rtems-testing/rtems/build-i386-pc386-rtems/i386-rtems4.10/c/pc386/cpukit/libcsupport/../../../../../../rtems/c/src/../../cpukit/libcsupport/src/_malloc_r.c:26</div>
<div>0012853c 00000018 T _realloc_r<span class="Apple-tab-span" style="white-space:pre">        </span>/home/developer/rtems-testing/rtems/build-i386-pc386-rtems/i386-rtems4.10/c/pc386/cpukit/libcsupport/../../../../../../rtems/c/src/../../cpukit/libcsupport/src/_realloc_r.c:27</div>
<div>00128554 0000001e T _write_r<span class="Apple-tab-span" style="white-space:pre">  </span>/home/developer/rtems-testing/rtems/build-i386-pc386-rtems/i386-rtems4.10/c/pc386/cpukit/libcsupport/../../../../../../rtems/c/src/../../cpukit/libcsupport/src/write_r.c:37</div>
<div>00128574 0000000c T isatty<span class="Apple-tab-span" style="white-space:pre">    </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/isatty.c:8</div>
<div>00128580 0000004f T _isatty<span class="Apple-tab-span" style="white-space:pre">   </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:10</div>
<div>001285d0 t __do_global_ctors_aux<span class="Apple-tab-span" style="white-space:pre">      </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>00128600 T __start_set_sysctl_set<span class="Apple-tab-span" style="white-space:pre">     </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>00128600 A __stop_set_sysctl_set</div><div>00128600 T _init<span class="Apple-tab-span" style="white-space:pre">       </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>0012860d T _fini<span class="Apple-tab-span" style="white-space:pre">      </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>(... suppressed lines ...)</div><div>00128a04 00000018 R rtems_filesystem_table<span class="Apple-tab-span" style="white-space:pre">   </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>00128a1c 00000010 R configuration_mount_table<span class="Apple-tab-span" style="white-space:pre"> </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div>00128a2c 00000004 R rtems_filesystem_mount_table_size<span class="Apple-tab-span" style="white-space:pre"> </span>/builddir/build/BUILD/rtems-4.10-i386-rtems4.10-gcc-4.4.5/build/i386-rtems4.10/newlib/libc/posix/../../../../../gcc-4.4.5/newlib/libc/posix/_isatty.c:21</div>
<div> </div><div><div><br></div><div>The last three lines are incorrect. </div><div>Look at "rtems_filesystem_table", for instance. It is expected to be allocated in the source that defines CONFIGURE_INIT, since it is in confdefs.h, however 'nm' thinks it is in _isatty.c, line 21 (!!!!).</div>
<div><br></div><div>Can anyone confirm this strange behavior?</div><div><br></div><div>Versions of nm and gcc I'm using:</div><div>i386-rtems4.10-nm --version</div><div><div>GNU nm (GNU Binutils) 2.20.1</div><div>Copyright 2009 Free Software Foundation, Inc.</div>
<div>This program is free software; you may redistribute it under the terms of</div><div>the GNU General Public License version 3 or (at your option) any later version.</div><div>This program has absolutely no warranty.</div>
<div><br></div><div>i386-rtems4.10-gcc --version</div><div>i386-rtems4.10-gcc (GCC) 4.4.5 20101001 (RTEMS gcc-4.4.5-4.fc14/newlib-1.18.0-19.fc14)</div><div>Copyright (C) 2010 Free Software Foundation, Inc.</div><div>This is free software; see the source for copying conditions.  There is NO</div>
<div>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</div></div><div><br></div><div><br></div><div>Thanks in advance,</div><div><br></div>-- <br>Att.<br>Wendell Silva<br><br>
</div>