This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Error referencing symbols in gdb when compiled with gcc 3.4.6
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: "Kalpana Ramamurthy" <kal_pana at hotmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 25 Jul 2007 10:38:45 +0100
- Subject: Re: Error referencing symbols in gdb when compiled with gcc 3.4.6
- References: <BAY144-F23AC3600BCDE5846B9DDC4E8FB0@phx.gbl>
Kalpana Ramamurthy writes:
> So sorry about the multiple post. I'll do future posts on gcc-help..
>
> Here I am using the same debugger when I try to view a symbol in
> gdb. The only thing that's changed is the version of gcc. I used
> gcc 3.2.2 earlier where things worked fine. But with gcc 3.4.6, I
> am unable to find symbols. I've had previous mysterious issues too
> when I compiled the very same code in with gcc 3.4.6 where I had to
> explicitly typecast a symbol to a class or struct. I didn't have to
> do all this earlier with gcc 3.2.2. I am concerned that I am
> probably building the executable with the wrong options. Here's how
> the code is being compiled with the following options :
>
> gcc -ansi -g -O -march=pentiumpro -fmessage-length=0 -isystem -DNEWGCC
> -DGCC34
>
> readelf -aw does not show me the problematic symbol when compiled with gcc
> 3.2.2. But it is seen when referenced in gdb.
> But when compiled with gcc 3.4.6, it is neither seen in readelf nor in gdb.
> That's what bothers me - why is this difference when compiled with gcc
> 3.4.6.
>
> Also, another of my investigations shows that if the .o file
> containing this symbol is placed at the top of list of files to be
> linked (first file to be linked) - the problem goes away. I am able
> to see that symbol in gdb now.
>
> So is this a problem with the linker ?
>
> Why is this problem occuring when compiled with gcc 3.4.6 and not
> with the earlier compilers ?
Give us a test case and we'll tell you. We can't help you without one.
Andrew.