summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-01-08 04:20:28 -0500
committermidipix <writeonce@midipix.org>2019-01-08 04:53:01 -0500
commit7309536a8066effa6ac16ae20fd363b0471818cb (patch)
treebbd49e546f25059336c49325c5d30a67c907aa54
parentbe8db556054f9dfc9d2f81d23ed74e9efe4c98aa (diff)
downloadchainport-7309536a8066effa6ac16ae20fd363b0471818cb.tar.bz2
chainport-7309536a8066effa6ac16ae20fd363b0471818cb.tar.xz
binutils-2.24.51: properly handle weak symbols that are also hidden.
-rw-r--r--binutils-2.24.51.midipix.patch50
1 files changed, 33 insertions, 17 deletions
diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch
index 68e6ec9..c6baf39 100644
--- a/binutils-2.24.51.midipix.patch
+++ b/binutils-2.24.51.midipix.patch
@@ -581,24 +581,40 @@ diff -ru a/ld/pe-dll.c b/ld/pe-dll.c
}
if (pe_details->underscored && *sn == '_')
-@@ -761,7 +781,20 @@
- /* Fill data flag properly, from dlltool.c. */
- if (!is_dup)
- p->flag_data = !(symbols[j]->flags & BSF_FUNCTION);
+@@ -756,12 +776,30 @@
+ int is_dup = 0;
+ def_file_export *p;
+
+- p = def_file_add_export (pe_def_file, sn, 0, -1,
+- NULL, &is_dup);
+- /* Fill data flag properly, from dlltool.c. */
+- if (!is_dup)
+- p->flag_data = !(symbols[j]->flags & BSF_FUNCTION);
+- }
++ if (weaksym) {
++ blhew = bfd_link_hash_lookup (info->hash, weaksym,
++ FALSE, FALSE, FALSE);
++ }
+
-+ if (weaksym)
-+ {
-+ blhew = bfd_link_hash_lookup (info->hash, weaksym,
-+ FALSE, FALSE, FALSE);
-+ if (blhew->type != bfd_link_hash_defined)
-+ {
-+ free (p->internal_name);
-+ p->internal_name = objsym;
-+ }
-+ }
- }
-+ if (weaksym)
-+ free (weaksym);
++ if (!weaksym || blhew) {
++ p = def_file_add_export (pe_def_file, sn, 0, -1,
++ NULL, &is_dup);
++
++ /* Fill data flag properly, from dlltool.c. */
++ if (!is_dup)
++ p->flag_data = !(symbols[j]->flags & BSF_FUNCTION);
++
++ if (weaksym) {
++ if (blhew->type != bfd_link_hash_defined) {
++ free (p->internal_name);
++ p->internal_name = objsym;
++ }
++ }
++
++ if (weaksym)
++ free (weaksym);
++ }
++ }
}
}
}