Page 1 of 1

Fortran on X86 : Linker does not find an EQIVALENT in module

Posted: Thu Jun 15, 2023 2:37 am
by joukj
See the following sample. the variable $GLOBAL$RGB is in the module in an equivalent statement, but the linker does not pick it up

Code: Select all

rumba-jj) f90/vers
VSI Fortran X8.5-0002 (GEM 50X2N) for X86 systems
rumba-jj) ty global.f90
module global

  integer( kind = 1 ) :: rgb( 3 )
  character ( len=1 ) :: rgb_ch( 3 )
!
  equivalence ( rgb ,  rgb_ch )
!
end module global
  15-JUN-2023 08:26:32
rumba-jj) ty test.f90
program test
use global
!
  implicit none
!
! reset memory
  rgb = 0
end
  15-JUN-2023 08:26:39
rumba-jj) f90 global
rumba-jj) f90 test
rumba-jj) link test,global
%ILINK-W-NUDFSYMS, 1 undefined symbol:
%ILINK-I-UDFSYM, 	$GLOBAL$RGB 
%ILINK-W-USEUNDEF, undefined symbol $GLOBAL$RGB referenced
	section: $CODE$
	offset: %X0000000000000027
	module: TEST 
	file: $DISK0:[JOUKJ.test]TEST.OBJ;71 
Leaving out the EQUIVALENCE, it links just fine, but then my program will not work.. For the moment I do not have a work-around for this one.

Re: Fortran on X86 : Linker does not find an EQIVALENT in module

Posted: Thu Jun 15, 2023 5:17 am
by hb
Which means that there is no symbol $GLOBAL$RGB defined in GLOBAL.OBJ (ANALYZE/OBJECT/SECTION=SYMTAB shows a GLOBAL%RGB, which the linker can't match with the undefined symbol in TEST).

In other words, it's a FORTRAN compiler problem, not (as one might conclude from the subject) a linker problem.

Re: Fortran on X86 : Linker does not find an EQIVALENT in module

Posted: Thu Jun 15, 2023 5:50 am
by joukj
Sure the GLOBAL%RGB should be there. but the $GLOBAL$RGB is missing (on IA64 I have them both in the obj-file.

Re: Fortran on X86 : Linker does not find an EQIVALENT in module

Posted: Thu Jun 15, 2023 9:55 pm
by jreagan
I'll put it on the list

Re: Fortran on X86 : Linker does not find an EQIVALENT in module

Posted: Thu Nov 16, 2023 2:01 am
by joukj
Looks like thiis solved in the new Fortran Compiler (X8.5-007)

Thanks

Jouk