Re: Error referencing symbols in gdb when compiled with gcc 3.4.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux