public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Mark E." <snowball3@bigfoot.com>
To: binutils@sourceware.cygnus.com
Subject: patch for cofflink.c
Date: Sun, 02 Jul 2000 17:13:00 -0000	[thread overview]
Message-ID: <395FA274.29278.293B59@localhost> (raw)

Hi guys, I believe I found a bug. In this example:

int func_weak() __attribute__((weak));

int func_weak()
{
  return 0;
}


"func_weak" is listed as weak in the final executable. Shouldn't it be turned into a 
strong definition for output? It will also make it unneccessary to change GBD to treat 
C_WEAKEXT symbols like C_EXT.

00001570 W _func_weak

2000-07-02  Mark Elbrecht  <snowball3@bigfoot.com>

	* cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into
	  a strong one for the final output.

Index: src/bfd/cofflink.c
===================================================================
RCS file: /cvs/src/src/bfd/cofflink.c,v
retrieving revision 1.17
diff -c -p -r1.17 cofflink.c
*** cofflink.c	2000/06/19 01:22:37	1.17
--- cofflink.c	2000/07/02 23:54:04
*************** _bfd_coff_write_global_sym (h, data)
*** 2560,2565 ****
--- 2560,2571 ----
        isym.n_sclass = C_STAT;
      }
  
+   /* When a weak symbol is not overriden by a strong one,
+      turn it into an external symbol for the final output.  */
+   if (isym.n_sclass == C_WEAKEXT
+       || (obj_pe (abfd) && sym.n_sclass == C_NT_WEAK))
+     isym.n_sclass = C_EXT;
+ 
    isym.n_numaux = h->numaux;
    
    bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) finfo->outsyms);

             reply	other threads:[~2000-07-02 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-02 17:13 Mark E. [this message]
2000-07-02 20:43 Mark E.

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=395FA274.29278.293B59@localhost \
    --to=snowball3@bigfoot.com \
    --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).