public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55891] New: Problem with shared library and EQUIVALENCE on darwin 11.4.2 x86_64
@ 2013-01-07  2:36 brtnfld at hdfgroup dot org
  2013-01-07  9:39 ` [Bug fortran/55891] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: brtnfld at hdfgroup dot org @ 2013-01-07  2:36 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55891

             Bug #: 55891
           Summary: Problem with shared library and EQUIVALENCE on darwin
                    11.4.2 x86_64
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: brtnfld@hdfgroup.org


On a x86_64 system with Darwin Kernel Version 11.4.2, and if you use to compile
the programs:

gfortran -shared -fPIC  mod.f90 -o lib.so
gfortran -fPIC main.f90 lib.so

The main program does not receive the values from the module (i.e. the print
statement will print 0,0). It works if you use a static library.

main.f90:

PROGRAM main
  USE LIB2
  IMPLICIT NONE
  CALL f()
  PRINT*,i,j
END PROGRAM main

mod.f90:

MODULE LIB2
  INTEGER i
  INTEGER :: j
  EQUIVALENCE (j, i)
CONTAINS
  SUBROUTINE f()
    IMPLICIT NONE
    j = 40
  END SUBROUTINE f
END MODULE LIB2

nm lib.so
0000000000000f9a T ___lib2_MOD_f
0000000000000f94 t __dyld_func_lookup
0000000000001010 S _lib2.eq.0_
                 U dyld_stub_binder
0000000000000f80 t dyld_stub_binding_helper


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-06  6:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07  2:36 [Bug fortran/55891] New: Problem with shared library and EQUIVALENCE on darwin 11.4.2 x86_64 brtnfld at hdfgroup dot org
2013-01-07  9:39 ` [Bug fortran/55891] " burnus at gcc dot gnu.org
2013-01-07 11:50 ` dominiq at lps dot ens.fr
2013-01-22 11:52 ` dominiq at lps dot ens.fr
2013-02-06  6:01 ` brtnfld at hdfgroup dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).