diff options
author | midipix <writeonce@midipix.org> | 2015-06-06 13:23:14 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2015-06-06 13:23:14 -0400 |
commit | 40ec1af0496be0e6129e5eaf72ec8b5d2568a78d (patch) | |
tree | 8292ea4fa855af9bc70e13164a5d78e52274a299 | |
parent | ddd158398d0ca50f577f1434bc546515b9a35e92 (diff) | |
download | chainport-40ec1af0496be0e6129e5eaf72ec8b5d2568a78d.tar.bz2 chainport-40ec1af0496be0e6129e5eaf72ec8b5d2568a78d.tar.xz |
binutils-2.24.51: updated patch.
+ PE/COFF: allow a reference to an external symbol in one object file be satisfied
by a weak definition in another.
+ a special thanks to Rich Felker, primary author of musl libc, for identifying the
spot at which a fix needed to be applied.
signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information.
-rw-r--r-- | binutils-2.24.51.midipix.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch index 369b820..ae202c5 100644 --- a/binutils-2.24.51.midipix.patch +++ b/binutils-2.24.51.midipix.patch @@ -521,3 +521,29 @@ diff -ru --new-file a/gas/configure.tgt b/gas/configure.tgt case ${cpu} in x86_64*) fmt=coff em=pep ;; i*) fmt=coff em=pe ;; +diff -ru a/bfd/cofflink.c b/bfd/cofflink.c +--- a/bfd/cofflink.c 2014-07-03 01:37:20.000000000 -0400 ++++ b/bfd/cofflink.c 2015-06-06 11:07:57.716291339 -0400 +@@ -320,6 +320,7 @@ + bfd_byte *esym; + bfd_byte *esym_end; + bfd_size_type amt; ++ char *weaksym; + + symcount = obj_raw_syment_count (abfd); + +@@ -476,6 +477,14 @@ + addit = FALSE; + } + ++ if (!strncmp (name, ".weak.", 6) && strchr (name + 6, '.')) ++ { ++ weaksym = strdup (name + 6); ++ *(strchr(weaksym, '.')) = 0; ++ name = weaksym; ++ flags |= BSF_WEAK; ++ } ++ + if (addit) + { + if (! (bfd_coff_link_add_one_symbol |