This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
patch for cofflink.c [take 2]
- To: binutils at sourceware dot cygnus dot com
- Subject: patch for cofflink.c [take 2]
- From: "Mark E." <snowball3 at bigfoot dot com>
- Date: Mon, 3 Jul 2000 00:15:02 -0400
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);