diff options
author | midipix <writeonce@midipix.org> | 2019-08-17 11:50:53 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-08-17 11:50:53 -0400 |
commit | 8fb8b35552738814a6bd10a9c1c2a0d3b3e2dc0f (patch) | |
tree | a363014b5e2c35a7582de70cfe8a3e945588cac4 | |
parent | 6cb2f4e49bc871ff4cfdfb29cd8bb660bfa3e0f9 (diff) | |
download | chainport-8fb8b35552738814a6bd10a9c1c2a0d3b3e2dc0f.tar.bz2 chainport-8fb8b35552738814a6bd10a9c1c2a0d3b3e2dc0f.tar.xz |
binutils-2.24.51: ldfile_try_open_bfd(): integrated pe_mdso_input_name().
-rw-r--r-- | binutils-2.24.51.midipix.patch | 72 |
1 files changed, 52 insertions, 20 deletions
diff --git a/binutils-2.24.51.midipix.patch b/binutils-2.24.51.midipix.patch index 5a2f0f4..08d7aa9 100644 --- a/binutils-2.24.51.midipix.patch +++ b/binutils-2.24.51.midipix.patch @@ -257,6 +257,26 @@ diff -ru --new-file a/bfd/pe-mdso.h b/bfd/pe-mdso.h +const char * pe_mdso_input_name(const char * input_name); + +#endif +diff --ru --new-file a/ld/ldfile.c b/ld/ldfile.c +--- a/ld/ldfile.c 2014-07-03 01:37:48.000000000 -0400 ++++ b/ld/ldfile.c 2019-08-17 11:38:31.062209027 -0400 +@@ -122,6 +122,16 @@ bfd_boolean + ldfile_try_open_bfd (const char *attempt, + lang_input_statement_type *entry) + { ++ ++#ifdef PE_TARGET_MDSO ++ if (!entry->flags.dynamic) { ++ (void)0; ++ } else if (!(attempt = pe_mdso_input_name(attempt))) { ++ fprintf(stderr,"%s: pe_mdso_input_name() returned an error.\n",program_name); ++ xexit(EXIT_FAILURE); ++ } ++#endif ++ + entry->the_bfd = bfd_openr (attempt, entry->target); + + if (verbose) diff -ru --new-file a/ld/ldlang.c b/ld/ldlang.c --- a/ld/ldlang.c 2014-07-03 01:37:48.000000000 -0400 +++ b/ld/ldlang.c 2019-08-16 12:31:17.048504021 -0400 @@ -327,7 +347,7 @@ diff --ru --new-file a/ld/sysdep.h b/ld/sysdep.h #include <sys/types.h> diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em --- a/ld/emultempl/pe.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pe.em 2019-08-16 03:27:04.540631764 -0400 ++++ b/ld/emultempl/pe.em 2019-08-17 11:38:31.062209027 -0400 @@ -69,6 +69,14 @@ fragment <<EOF #include "ldbuildid.h" #include "coff/internal.h" @@ -437,7 +457,7 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em } #if defined(TARGET_IS_shpe) /* ARM doesn't need relocs. */ -@@ -2298,10 +2324,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive +@@ -2298,16 +2324,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive } libname_fmt [] = { @@ -451,25 +471,31 @@ diff -ru --new-file a/ld/emultempl/pe.em b/ld/emultempl/pe.em /* Alternate explicit import library for dll's. */ - { "%s.dll.a", FALSE }, + { "%s"PE_IMPLIB_SUFFIX, FALSE }, ++#ifdef PE_TARGET_MDSO ++ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ ++ { "lib%s"PE_DSO_SUFFIX, FALSE }, ++#endif /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ -@@ -2310,10 +2340,10 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.a", FALSE }, + /* The 'native' spelling of an import lib name is "foo.lib". */ { "%s.lib", FALSE }, ++#ifndef PE_TARGET_MDSO #ifdef DLL_SUPPORT /* Try "<prefix>foo.dll" (preferred dll name, if specified). */ -- { "%s%s.dll", TRUE }, -+ { "%s%s"PE_DSO_SUFFIX, TRUE }, - #endif - /* Try "libfoo.dll" (default preferred dll name). */ -- { "lib%s.dll", FALSE }, -+ { "lib%s"PE_DSO_SUFFIX, FALSE }, + { "%s%s.dll", TRUE }, +@@ -2316,6 +2351,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.dll", FALSE }, /* Finally try 'native' dll name "foo.dll". */ { "%s.dll", FALSE }, ++#endif /* Note: If adding more formats to this table, make sure to check to + see if their length is longer than libname_fmt[0].format, and if + so, update the call to xmalloc() below. */ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em --- a/ld/emultempl/pep.em 2014-07-03 01:37:48.000000000 -0400 -+++ b/ld/emultempl/pep.em 2019-08-16 03:27:04.540631764 -0400 ++++ b/ld/emultempl/pep.em 2019-08-17 11:38:31.062209027 -0400 @@ -67,6 +67,14 @@ fragment <<EOF #include "ldbuildid.h" #include "coff/internal.h" @@ -577,36 +603,42 @@ diff -ru --new-file a/ld/emultempl/pep.em b/ld/emultempl/pep.em } if (pep_out_def_filename) -@@ -2062,10 +2088,14 @@ gld_${EMULATION_NAME}_open_dynamic_archive +@@ -2062,16 +2088,25 @@ gld_${EMULATION_NAME}_open_dynamic_archive } libname_fmt [] = { + /* optionally support ldso-specific import libraries */ -+ #ifdef PE_TARGET_MDSO ++#ifdef PE_TARGET_MDSO + { "lib%s"PE_DSOLIB_SUFFIX, FALSE }, -+ #endif ++#endif /* Preferred explicit import library for dll's. */ - { "lib%s.dll.a", FALSE }, + { "lib%s"PE_IMPLIB_SUFFIX, FALSE }, /* Alternate explicit import library for dll's. */ - { "%s.dll.a", FALSE }, + { "%s"PE_IMPLIB_SUFFIX, FALSE }, ++#ifdef PE_TARGET_MDSO ++ /* libfoo.so precedes libfoo.a, generate mdso implib as needed */ ++ { "lib%s"PE_DSO_SUFFIX, FALSE }, ++#endif /* "libfoo.a" could be either an import lib or a static lib. For backwards compatibility, libfoo.a needs to precede libfoo.dll and foo.dll in the search. */ -@@ -2074,10 +2104,10 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.a", FALSE }, + /* The 'native' spelling of an import lib name is "foo.lib". */ { "%s.lib", FALSE }, ++#ifndef PE_TARGET_MDSO #ifdef DLL_SUPPORT /* Try "<prefix>foo.dll" (preferred dll name, if specified). */ -- { "%s%s.dll", TRUE }, -+ { "%s%s"PE_DSO_SUFFIX, TRUE }, - #endif - /* Try "libfoo.dll" (default preferred dll name). */ -- { "lib%s.dll", FALSE }, -+ { "lib%s"PE_DSO_SUFFIX, FALSE }, + { "%s%s.dll", TRUE }, +@@ -2080,6 +2115,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive + { "lib%s.dll", FALSE }, /* Finally try 'native' dll name "foo.dll". */ { "%s.dll", FALSE }, ++#endif /* Note: If adding more formats to this table, make sure to check to + see if their length is longer than libname_fmt[0].format, and if + so, update the call to xmalloc() below. */ diff -ru --new-file a/ld/configure.tgt b/ld/configure.tgt --- a/ld/configure.tgt 2014-07-03 01:37:48.000000000 -0400 +++ b/ld/configure.tgt 2019-08-15 06:52:04.192983142 -0400 |