public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mumit Khan <khan@xraylith.wisc.EDU>
To: binutils@sourceware.cygnus.com
Subject: (fixed patch) pe-dll fix for exporting common symbols
Date: Thu, 01 Jul 1999 00:00:00 -0000	[thread overview]
Message-ID: <199906241943.OAA06490@mercury.xraylith.wisc.edu> (raw)

Ooops! Looks like I sent the wrong file. Please ignore the last one.

The following change allows i386-pe ``ld --shared'' to export common 
symbols correctly.

Thu Jun 24 12:41:50 1999  Mumit Khan  <khan@xraylith.wisc.edu>

	* pe-dll.c (process_def_file): Export common symbols correctly.

Index: pe-dll.c
===================================================================
RCS file: /cvs/binutils/binutils/ld/pe-dll.c,v
retrieving revision 1.2
diff -u -3 -p -u -p -r1.2 pe-dll.c
--- pe-dll.c	1999/05/11 21:06:48	1.2
+++ pe-dll.c	1999/06/24 20:48:17
@@ -383,13 +383,23 @@ process_def_file (abfd, info)
 				   name,
 				   false, false, true);
 
-      if (blhe && (blhe->type == bfd_link_hash_defined))
+      if (blhe 
+          && (blhe->type == bfd_link_hash_defined
+	      || (blhe->type == bfd_link_hash_common)))
 	{
 	  count_exported++;
 	  if (!pe_def_file->exports[i].flag_noname)
 	    count_exported_byname++;
-	  exported_symbol_offsets[i] = blhe->u.def.value;
-	  exported_symbol_sections[i] = blhe->u.def.section;
+          if (blhe->type == bfd_link_hash_defined)
+	    {
+	      exported_symbol_offsets[i] = blhe->u.def.value;
+	      exported_symbol_sections[i] = blhe->u.def.section;
+	    }
+	  else
+	    {
+	      exported_symbol_offsets[i] = 0;
+	      exported_symbol_sections[i] = blhe->u.c.p->section;
+	    }
 	  if (pe_def_file->exports[i].ordinal != -1)
 	    {
 	      if (max_ordinal < pe_def_file->exports[i].ordinal)

Regards,
Mumit

             reply	other threads:[~1999-07-01  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-01  0:00 Mumit Khan [this message]
1999-07-01  0:00 ` Ian Lance Taylor
1999-07-01  0:00   ` Mumit Khan
1999-07-01  0:00     ` Ian Lance Taylor
1999-07-01  0:00       ` Mumit Khan
1999-07-01  0:00         ` DJ Delorie
1999-07-01  0:00           ` take 2: " Mumit Khan

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=199906241943.OAA06490@mercury.xraylith.wisc.edu \
    --to=khan@xraylith.wisc.edu \
    --cc=binutils@sourceware.cygnus.com \
    /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).