Problems with startup code symbols (Copious warnings)
Steven Johnson
sjohnson@sakuraindustries.com
Thu Jun 8 23:10:00 GMT 2006
Here is an example application which demonstrates the problem I experience.
test.elf = linked application for powerpc-eabi (rtems actually, but it
should make no difference).
test.link = link script used
test.map = map file generated by link
vectors.o = intermediary object of vectors.S
vectors.S = my test application which doesn't do much.
If I load this in GDB and try to debug i get the following errors,
repeatedly:
(Internal error: pc 0x0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x100 in read in psymtab, but not in symtab.)
These are the commands I use to build it:
/opt/X-GCC/bin/powerpc-rtems-gcc -gdwarf-2 -nostdinc
-Wa,-mregnames,-mppc,-memb -w -Wall -Werror -msoft-float -mcpu=860 -O1
-foptimize-sibling-calls -mstring -mmultiple -funit-at-a-time
-ffunction-sections -fdata-sections -fcse-follow-jumps
-frerun-cse-after-loop -fcrossjumping -fdelete-null-pointer-checks
-fregmove -ftree-vrp -c -o vectors.o vectors.S -v
/opt/X-GCC/bin/powerpc-rtems-g++ -o test.elf -nodefaultlibs -static
-Wl,'--gc-sections' -Wl,'-nostdlib' -Wl,'-Map','test.map' -Wl,'--cref'
-Wl,'-dc' -Wl,'-dp' -Wl,'-u','__vectors' -Wl,'-N' -Wl,'-u','start'
-Wl,'-T','test.link' vectors.o -v
Here is the output from the build:
Using built-in specs.
Target: powerpc-rtems
Configured with: ../gcc-4.1.0/configure --host=i686-linux
--target=powerpc-rtems --prefix=/opt/X-GCC --enable-languages=c,c++
--with-newlib --disable-shared --enable-target-optspace --disable-libssp
--disable-nls --enable-version-specific-runtime-libs
--enable-threads=rtems --enable-newlib-multithread
--disable-newlib-supplied-syscalls --with-gnu-as --with-gnu-ld
Thread model: rtems
gcc version 4.1.0
/opt/X-GCC/libexec/gcc/powerpc-rtems/4.1.0/cc1 -E -lang-asm -quiet
-nostdinc -v -Dmpc860 vectors.S -msoft-float -mcpu=860 -mstring
-mmultiple -Wall -Werror -w -foptimize-sibling-calls -funit-at-a-time
-ffunction-sections -fdata-sections -fcse-follow-jumps
-frerun-cse-after-loop -fcrossjumping -fdelete-null-pointer-checks
-fregmove -ftree-vrp -fworking-directory -O1 -o /home/linux/tmp/cceJbS47.s
#include "..." search starts here:
#include <...> search starts here:
End of search list.
/opt/X-GCC/lib/gcc/powerpc-rtems/4.1.0/../../../../powerpc-rtems/bin/as
--gdwarf2 -mppc -many -V -Qy -mregnames -mppc -memb -o vectors.o
/home/linux/tmp/cceJbS47.s
GNU assembler version 2.16.1 (powerpc-rtems) using BFD version 2.16.1
Using built-in specs.
Target: powerpc-rtems
Configured with: ../gcc-4.1.0/configure --host=i686-linux
--target=powerpc-rtems --prefix=/opt/X-GCC --enable-languages=c,c++
--with-newlib --disable-shared --enable-target-optspace --disable-libssp
--disable-nls --enable-version-specific-runtime-libs
--enable-threads=rtems --enable-newlib-multithread
--disable-newlib-supplied-syscalls --with-gnu-as --with-gnu-ld
Thread model: rtems
gcc version 4.1.0
/opt/X-GCC/libexec/gcc/powerpc-rtems/4.1.0/collect2 -V -Qy -dn -Bstatic
-o test.elf
/opt/X-GCC/lib/gcc/powerpc-rtems/4.1.0/../../../../powerpc-rtems/lib/crt0.o
-L/opt/X-GCC/lib/gcc/powerpc-rtems/4.1.0
-L/opt/X-GCC/lib/gcc/powerpc-rtems/4.1.0/../../../../powerpc-rtems/lib
--gc-sections -nostdlib -Map test.map --cref -dc -dp -u __vectors -N -u
start -T test.link vectors.o
GNU ld version 2.16.1
Supported emulations:
elf32ppc
And finally GDB tells me the following if I start it with -v:
GNU gdb 6.4.0.20051202-cvs
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=powerpc-rtems".
Any help to resolve this warning would be greatly appreciated.
Steven J
Steven Johnson wrote:
>Jim Blandy wrote:
>
>
>
>>Steven Johnson <sjohnson@sakuraindustries.com> writes:
>>
>>
>>
>>
>>>For ever and a day with GDB i've gotten the following warnings:
>>>
>>>warning: (Internal error: pc 0x00 in read in psymtab, but not in symtab.)
>>>
>>>I get it a lot. I even patch GDB so it doesn't generate this warning,
>>>its so annoying.
>>>
>>>0x00 happens to be my programs entry point (its an embedded system).
>>>And is in Assembler code.
>>>
>>>I've never liked patching GDB to get rid of this warning, so I invested
>>>some time on it and I've just discovered 2 ways to make it go away:
>>>
>>>1. If I compile my code with stabs+ debug info, I don't get the
>>>warning. I would prefer to use Dwarf-2 however, as it seems to be the
>>>way of the future.
>>>
>>>2. If I add:
>>>
>>>.section .debug_info,"",@progbits as the first directive in my asm file,
>>>the warning also goes away. But so does the code when I view it under GDB.
>>>
>>>Does anyone know any special incantation I need to make in my ASM file,
>>>to get rid of the warning, but still retain the symbolic information so
>>>I can see the code and symbols under GDB?
>>>
>>>The file is a ".S" file, it is assembler but i build it with GCC. The
>>>CPU is a PowerPC, Motorola MPC862.
>>>
>>>
>>>
>>>
>>Can you post an executable for which GDB produces this message, and
>>let us know which target you've configured GDB for?
>>
>>
>>
>>
>>
>I can't post my app, because of a number of reasons. I will try to
>coble together one I can post, that limits itself to this problem.
>
>GDB is configured for powerpc-eabi or powerpc-rtems (doesn't matter
>which, I've used both with the same results).
>
>Will post an app tomorrow that does this, once I've made one.
>
>Steven J
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.elf
Type: application/octet-stream
Size: 19761 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20060608/c597dc50/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.link
URL: <http://sourceware.org/pipermail/gdb/attachments/20060608/c597dc50/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.map
URL: <http://sourceware.org/pipermail/gdb/attachments/20060608/c597dc50/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vectors.o
Type: application/octet-stream
Size: 1728 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20060608/c597dc50/attachment.o>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vectors.S
URL: <http://sourceware.org/pipermail/gdb/attachments/20060608/c597dc50/attachment-0002.ksh>
More information about the Gdb
mailing list