public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block
@ 2003-08-27  4:21 s dot blackett at auckland dot ac dot nz
  2003-08-27  4:22 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: s dot blackett at auckland dot ac dot nz @ 2003-08-27  4:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Block Data initialisation only from first shared library
                    of a common block
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s dot blackett at auckland dot ac dot nz
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i586-mandrake-linux-gnu

When several shared libraries using the same common block are linked together
then only block data initialisation from the first library is used.  The link
changes the block data symbol to .data in each case and the final link seems to
just use the first one.
The enclosed tar builds three executables, test_block_data which has the BLOCK
DATA in the first library and so succeeds, test_block_data2 which has the same
libraries linked in the reverse order and fails and test_block_data3 which links
the objects without the libraries and so succeeds.


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

* [Bug fortran/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
@ 2003-08-27  4:22 ` s dot blackett at auckland dot ac dot nz
  2003-08-27  4:25 ` s dot blackett at auckland dot ac dot nz
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: s dot blackett at auckland dot ac dot nz @ 2003-08-27  4:22 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From s dot blackett at auckland dot ac dot nz  2003-08-27 04:22 -------
Created an attachment (id=4659)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4659&action=view)
A small test case demonstrating the bug


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

* [Bug fortran/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
  2003-08-27  4:22 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
@ 2003-08-27  4:25 ` s dot blackett at auckland dot ac dot nz
  2003-08-27 13:46 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: s dot blackett at auckland dot ac dot nz @ 2003-08-27  4:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From s dot blackett at auckland dot ac dot nz  2003-08-27 04:25 -------
This was previously reported as
    g77 block data initialization
    * To: egcs-bugs at cygnus dot com
    * Subject: g77 block data initialization
   * Date: Mon, 19 Oct 1998 09:00:49 -0600


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

* [Bug fortran/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
  2003-08-27  4:22 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
  2003-08-27  4:25 ` s dot blackett at auckland dot ac dot nz
@ 2003-08-27 13:46 ` pinskia at gcc dot gnu dot org
  2003-08-27 13:49 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-27 13:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-27 13:46 -------
*** Bug 12073 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
                   ` (2 preceding siblings ...)
  2003-08-27 13:46 ` pinskia at gcc dot gnu dot org
@ 2003-08-27 13:49 ` pinskia at gcc dot gnu dot org
  2003-08-27 13:58 ` [Bug other/12074] " pinskia at gcc dot gnu dot org
  2003-08-27 20:47 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-27 13:49 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-27 13:49 -------
Link to the original report <http://gcc.gnu.org/ml/gcc-bugs/1998-10/msg00543.html>.


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

* [Bug other/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
                   ` (3 preceding siblings ...)
  2003-08-27 13:49 ` pinskia at gcc dot gnu dot org
@ 2003-08-27 13:58 ` pinskia at gcc dot gnu dot org
  2003-08-27 20:47 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-27 13:58 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|fortran                     |other
         Resolution|                            |INVALID


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-27 13:58 -------
The problem is ld.so (not a GCC problem) is not knowing that lib*init.so needs to run the inits in 
that library before print runs.
The fix is to add a reference to lib*init.so to lib*print.so:
all: test_block_data test_block_data2 test_block_data3

test_block_data : test_block_data.o libtest_block_data_print.so libtest_block_data_init.so
        gcc -o $@ $< -L. -ltest_block_data_init -ltest_block_data_print

test_block_data2 : test_block_data.o libtest_block_data_print.so libtest_block_data_init.so
        gcc -o $@ $< -L. -ltest_block_data_print -ltest_block_data_init

test_block_data3 : test_block_data.o test_block_data_init.o test_block_data_print.o
        gcc -o $@ $^ -lg2c

libtest_block_data_init.so : test_block_data_init.o
        gcc -shared -o $@ $^

libtest_block_data_print.so : test_block_data_print.o libtest_block_data_init.so
        gcc -shared -o $@ $^ -lg2c -L. -ltest_block_data_init

%.o : %.f
        g77 -c -o $@ -fpic $^

The code then works all the time, not this happens also for c++ and other languages, it is not a 
fortran specific problem.


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

* [Bug fortran/12074] Block Data initialisation only from first shared library of a common block
  2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
                   ` (4 preceding siblings ...)
  2003-08-27 13:58 ` [Bug other/12074] " pinskia at gcc dot gnu dot org
@ 2003-08-27 20:47 ` s dot blackett at auckland dot ac dot nz
  5 siblings, 0 replies; 7+ messages in thread
From: s dot blackett at auckland dot ac dot nz @ 2003-08-27 20:47 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


s dot blackett at auckland dot ac dot nz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|other                       |fortran


------- Additional Comments From s dot blackett at auckland dot ac dot nz  2003-08-27 20:47 -------
Thanks a lot.


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

end of thread, other threads:[~2003-08-27 20:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-27  4:21 [Bug fortran/12074] New: Block Data initialisation only from first shared library of a common block s dot blackett at auckland dot ac dot nz
2003-08-27  4:22 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz
2003-08-27  4:25 ` s dot blackett at auckland dot ac dot nz
2003-08-27 13:46 ` pinskia at gcc dot gnu dot org
2003-08-27 13:49 ` pinskia at gcc dot gnu dot org
2003-08-27 13:58 ` [Bug other/12074] " pinskia at gcc dot gnu dot org
2003-08-27 20:47 ` [Bug fortran/12074] " s dot blackett at auckland dot ac dot nz

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).