[Bug fortran/35154] New: Unable to reference symbols in Fortran COMMON due to .stabs format
george at gly dot bris dot ac dot uk
gcc-bugzilla@gcc.gnu.org
Sun Feb 10 11:35:00 GMT 2008
Problem is fixed with approved (but uncommitted) patch at
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00286.html
Arises on different systems lacking either: 1) loader ability to process
external (i.e. non-.TEXT) SYMBOL+offset in .stabs; or 2) gdb ability to process
same. Darwin is one; FX Coudert's gfortran
testing system is another (unknown type).
To replicate, see below.
----------------
#cat simtest.f
common i,j
common /label/l,m
i = 1
j = 2
k = 3
l = 4
m = 5
call sub
end
subroutine sub
common /label/l,m
logical first
save n
data first /.true./
if (first) then
n = 0
first = .false.
endif
n = n + 1
l = l + 1
end
#
#gfortran -v -g -o simtest simtest.f
Driving: gfortran -mmacosx-version-min=10.4 -v -g -o simtest simtest.f
-lgfortranbegin -lgfortran -shared-libgcc
Using built-in specs.
Target: powerpc-apple-darwin8.8.0
Configured with: ../gcc-trunk/gcc/configure --enable-languages=c,fortran
Thread model: posix
gcc version 4.3.0 20080204 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-g' '-o' 'simtest'
'-shared-libgcc'
/usr/local/libexec/gcc/powerpc-apple-darwin8.8.0/4.3.0/f951 simtest.f
-ffixed-form -feliminate-unused-debug-symbols -fPIC -quiet -dumpbase simtest.f
-mmacosx-version-min=10.4 -auxbase simtest -g -version -fintrinsic-modules-path
/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/finclude -o
/var/tmp//cc6Ld1Df.s
GNU F95 (GCC) version 4.3.0 20080204 (experimental) (powerpc-apple-darwin8.8.0)
compiled by GNU C version 4.3.0 20080204 (experimental), GMP version
4.2.2, MPFR version 2.3.0-p3.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-g' '-o' 'simtest'
'-shared-libgcc'
as -arch ppc -o /var/tmp//ccILL0ce.o /var/tmp//cc6Ld1Df.s
COMPILER_PATH=/usr/local/libexec/gcc/powerpc-apple-darwin8.8.0/4.3.0/:/usr/local/libexec/gcc/powerpc-apple-darwin8.8.0/4.3.0/:/usr/local/libexec/gcc/powerpc-apple-darwin8.8.0/:/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/:/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/
LIBRARY_PATH=/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/:/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-g' '-o' 'simtest'
'-shared-libgcc'
/usr/local/libexec/gcc/powerpc-apple-darwin8.8.0/4.3.0/collect2 -dynamic -arch
ppc -macosx_version_min 10.4 -multiply_defined suppress
-weak_reference_mismatches non-weak -o simtest -lcrt1.o
/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/crt3.o
-L/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0
-L/usr/local/lib/gcc/powerpc-apple-darwin8.8.0/4.3.0/../../..
/var/tmp//ccILL0ce.o -lgfortranbegin -lgfortran -lgcc_s.10.4 -lgcc
-lSystemStubs -lSystem
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-g' '-o' 'simtest'
'-shared-libgcc'
#gdb simtest
GNU gdb 6.3.50-20050815 (Apple version gdb-573) (Fri Oct 20 15:54:33 GMT 2006)
Copyright 2004 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 "powerpc-apple-darwin"...Reading symbols for shared
libraries .... done
(gdb) l MAIN__
1 common i,j
2 common /label/l,m
3 i = 1
4 j = 2
5 k = 3
6 l = 4
7 m = 5
8 call sub
9 end
10 subroutine sub
(gdb) break 8
Breakpoint 1 at 0x2c28: file simtest.f, line 8.
(gdb) run
Starting program: /Users/george/f77/simtest
Reading symbols for shared libraries ..+. done
Breakpoint 1, MAIN__ () at simtest.f:8
8 call sub
(gdb) p i
Address of symbol "i" is unknown.
(gdb) p j
No symbol "j" in current context.
(gdb) p k
$1 = 3
Current language: auto; currently fortran
(gdb) p l
Address of symbol "l" is unknown.
(gdb) p m
No symbol "m" in current context.
(gdb) quit
The program is running. Exit anyway? (y or n) y
#
-------------------
--
Summary: Unable to reference symbols in Fortran COMMON due to
.stabs format
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: george at gly dot bris dot ac dot uk
GCC build triplet: powerpc-apple-darwin8.8.0
GCC host triplet: powerpc-apple-darwin8.8.0 (and others)
GCC target triplet: powerpc-apple-darwin8.8.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35154
More information about the Gcc-bugs
mailing list