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

Strange gcc 3.1 behavior


While looking at

http://sources.redhat.com/ml/gdb/2002-05/msg00230.html

I found:

# /usr/gcc-3.1/bin/gcc -g  -c all-types.c -v
Reading specs from /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/hjl/work/gnu/src/gcc/gcc/configure --enable-clocale=gnu --with-system-zlib --enable-shared --enable-threads=posix --enable-haifa --disable-checking --prefix=/usr/gcc-3.1 --with-local-prefix=/usr/local
Thread model: posix
gcc version 3.1
 /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ all-types.c -quiet -dumpbase all-types.c -g -version -o /tmp/ccUisuZF.s
GNU CPP version 3.1 (cpplib) (i386 Linux/ELF)
GNU C version 3.1 (i686-pc-linux-gnu)
	compiled by GNU C version 3.1.
ignoring nonexistent directory "/usr/gcc-3.1/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/gcc-3.1/include
 /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/include
End of search list.
 as -V -Qy -o all-types.o /tmp/ccUisuZF.s
GNU assembler version 2.12.90.0.7 (i386-redhat-linux) using BFD version 2.12.90.0.7 20020423
# /usr/gcc-3.1/bin/gcc -g  -S all-types.c -v
Reading specs from /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/hjl/work/gnu/src/gcc/gcc/configure --enable-clocale=gnu --with-system-zlib --enable-shared --enable-threads=posix --enable-haifa --disable-checking --prefix=/usr/gcc-3.1 --with-local-prefix=/usr/local
Thread model: posix
gcc version 3.1
 /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ all-types.c -quiet -dumpbase all-types.c -g -version -o all-types.s
GNU CPP version 3.1 (cpplib) (i386 Linux/ELF)
GNU C version 3.1 (i686-pc-linux-gnu)
	compiled by GNU C version 3.1.
ignoring nonexistent directory "/usr/gcc-3.1/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/gcc-3.1/include
 /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/include
End of search list.
# /usr/gcc-3.1/bin/gcc -g  -c all-types.s -v
Reading specs from /usr/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/hjl/work/gnu/src/gcc/gcc/configure --enable-clocale=gnu --with-system-zlib --enable-shared --enable-threads=posix --enable-haifa --disable-checking --prefix=/usr/gcc-3.1 --with-local-prefix=/usr/local
Thread model: posix
gcc version 3.1
 as --gdwarf2 -V -Qy -o all-types.o all-types.s
GNU assembler version 2.12.90.0.7 (i386-redhat-linux) using BFD version 2.12.90.0.7 20020423

As you can see, gcc 3.1 passes --gdwarf2 to as for all-types.s, but
not for all-types.c. With binutils 20020522, I got

# /usr/gcc-3.1/bin/gcc -g -B./ -c all-types.s
# readelf -dw all-types.o > /dev/null  
readelf: Warning: Unable to locate entry 115 in the abbreviation table
# /usr/gcc-3.1/bin/gcc -g -B./  all-types.c -Wa,--gdwarf2
# gdb a.out
GNU gdb 5.2-0.4 (5.2.0_2002-05-20-cvs)
Copyright 2002 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 "i386-redhat-linux"...DW_FORM_strp pointing outside
of .debug_str section

(gdb)

With binutils 2.12.90.0.7, I got

# /usr/gcc-3.1/bin/gcc -g -c all-types.s
# readelf -dw all-types.o > /dev/null  

I think something is wrong between gcc 3.1, binutils in CVS and gdb
5.2.


H.J.


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