From ddd158398d0ca50f577f1434bc546515b9a35e92 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 5 Jun 2015 01:55:30 -0400 Subject: binutils-2.24.51: updated patch. + PE shared libraries: allow weak aliases to be exported. signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information. --- binutils-2.24.51.midipix.patch | 45 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch index 493bed7..369b820 100644 --- a/binutils-2.24.51.midipix.patch +++ b/binutils-2.24.51.midipix.patch @@ -370,9 +370,8 @@ diff -ru --new-file a/binutils/winduni.c b/binutils/winduni.c { 1, "WINDOWS-1252" }, { 437, "MS-ANSI" }, { 737, "MS-GREEK" }, -diff -ru --new-file a/ld/pe-dll.c b/ld/pe-dll.c --- a/ld/pe-dll.c 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/pe-dll.c 2015-02-28 09:36:05.942808235 -0500 ++++ b/ld/pe-dll.c 2015-06-05 01:41:53.468944737 -0400 @@ -40,6 +40,7 @@ #include "coff/internal.h" #include "../bfd/libcoff.h" @@ -392,7 +391,47 @@ diff -ru --new-file a/ld/pe-dll.c b/ld/pe-dll.c + #endif { NULL, 0 } }; - + +@@ -648,6 +653,7 @@ + struct bfd_section *s; + def_file_export *e = 0; + bfd_boolean resort_needed; ++ char *weaksym; + + if (!pe_def_file) + pe_def_file = def_file_empty (); +@@ -737,6 +743,15 @@ + if (is_import (sn)) + continue; + ++ if (!strncmp (sn, ".weak.", 6) && strchr (sn + 6, '.')) ++ { ++ weaksym = strdup (sn + 6); ++ *(strchr (weaksym, '.')) = '\0'; ++ sn = weaksym; ++ } ++ else ++ weaksym = 0; ++ + name = xmalloc (strlen ("__imp_") + strlen (sn) + 1); + sprintf (name, "%s%s", "__imp_", sn); + +@@ -761,7 +776,15 @@ + /* Fill data flag properly, from dlltool.c. */ + if (!is_dup) + p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); ++ ++ if (weaksym) ++ { ++ free (p->internal_name); ++ p->internal_name = strdup (symbols[j]->name); ++ } + } ++ if (weaksym) ++ free (weaksym); + } + } + } diff -ru --new-file a/bfd/config.bfd b/bfd/config.bfd --- a/bfd/config.bfd 2014-07-03 01:37:20.000000000 -0400 +++ b/bfd/config.bfd 2015-02-14 11:27:08.199179775 -0500 -- cgit v1.2.3