This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32103] New: Module with equivalence draws "unsatisfied reference"
- From: "toon at moene dot indiv dot nluug dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2007 12:38:39 -0000
- Subject: [Bug fortran/32103] New: Module with equivalence draws "unsatisfied reference"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Given this eq-mod.f90
module aap
real a(5)
real b(3)
equivalence (a(3),b(1))
end module aap
and the following main program eq-main.f90
use aap, only : b
print*,b
end
draws, when compiling with GNU Fortran (GCC) 4.2.1 20070523 (prerelease),
as follows:
toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -c eq-mod.f90
toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -c eq-main.f90
toon@laptop:~/g95-bugs$ /usr/rel/bin/gfortran -static eq-main.o eq-mod.o
eq-main.o: In function `MAIN__':
eq-main.f90:(.text+0x78): undefined reference to `__aap(bool)'
collect2: ld returned 1 exit status
The "(bool)" is a red herring, caused by collect2's "helpful" reinterpretation
of the following external reference:
toon@laptop:~/g95-bugs$ nm eq-main.o
U __aap__b
...
--
Summary: Module with equivalence draws "unsatisfied reference"
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: toon at moene dot indiv dot nluug dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32103