public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: patch for cofflink.c [take 2]
@ 2000-07-03 11:42 Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2000-07-03 11:42 UTC (permalink / raw)
  To: snowball3; +Cc: binutils

Hi Mark,

: 2000-07-03  Mark Elbrecht  <snowball3@bigfoot.com>
: 
: 	* cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into
: 	  an external symbol for a non-shared, non-relocatable link.

Approved and applied.

I also took the liberty of turning the test for a weak external symbol
into a macro, since exactly the same code is used several time
elsewhere in the file.

Cheers
	Nick

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

* patch for cofflink.c [take 2]
@ 2000-07-02 21:14 Mark E.
  0 siblings, 0 replies; 2+ messages in thread
From: Mark E. @ 2000-07-02 21:14 UTC (permalink / raw)
  To: binutils

This patch improves on the first by taking into account whether a link is shared or 
relocatable.

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

	* cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into
	  an external symbol for a non-shared, non-relocatable link.
.
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/03 04:07:08
*************** _bfd_coff_write_global_sym (h, data)
*** 2560,2565 ****
--- 2560,2573 ----
        isym.n_sclass = C_STAT;
      }
  
+   /* When a weak symbol is not overriden by a strong one,
+      turn it into an external symbol when not building a
+      shared or relocateable object.  */
+   if (!finfo->info->shared && !finfo->info->relocateable)
+     if (isym.n_sclass == C_WEAKEXT
+         || (obj_pe (finfo->output_bfd) && isym.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);

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

end of thread, other threads:[~2000-07-03 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-03 11:42 patch for cofflink.c [take 2] Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2000-07-02 21:14 Mark E.

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