public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olchansk at panix dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/16485] Private subroutines from different modules collide during linking.
Date: Mon, 12 Jul 2004 04:39:00 -0000	[thread overview]
Message-ID: <20040712043901.22872.qmail@sourceware.org> (raw)
In-Reply-To: <20040712004514.16485.olchansk@panix.com>


------- Additional Comments From olchansk at panix dot com  2004-07-12 04:38 -------
This change to module.c::write_symbol0() fixes the symbol collisions. My project
now almost links, except for the missing "entry" symbols. Yay!

Something silly is going on. This is how I understand this problem (feel free to
laugh at me if I got it completly backwards). gfc_sym_mangled_function_id()
depends on sym->module to create unique mangled names. However, private module
subroutines arrive there with sym->module blank and mangling cannot happen. So,
who sets sym->module? The only place I could find is in
module.c::write_symbol(). Internal subroutines do not go through "write_symbol"
and their sym->module remains blank.

Fix to module.c::write_symbol0(): add lines marked "+" (no cvs diff this time,
sorry).

  sym = st->n.sym;

  if (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic
      && !sym->attr.subroutine && !sym->attr.function)
    return;

+  if (sym->attr.proc == PROC_MODULE && sym->module[0] == 0)
+    strcpy (sym->module, module_name);

  if (!check_access (sym->attr.access, sym->ns->default_access))
    return;

K.O.


-- 


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


  reply	other threads:[~2004-07-12  4:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-12  0:45 [Bug fortran/16485] New: " olchansk at panix dot com
2004-07-12  4:39 ` olchansk at panix dot com [this message]
2004-07-12  6:25 ` [Bug fortran/16485] " pinskia at gcc dot gnu dot org
2004-07-12 12:37 ` tobi at gcc dot gnu dot org
2004-07-13 17:19 ` tobi at gcc dot gnu dot org
2004-09-02 10:51 ` tobi at gcc dot gnu dot org
2004-09-15 13:13 ` cvs-commit at gcc dot gnu dot org
2004-09-15 13:16 ` pbrook at gcc dot gnu dot org
2004-11-06 15:43 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040712043901.22872.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).