From 8fb8b35552738814a6bd10a9c1c2a0d3b3e2dc0f Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 17 Aug 2019 11:50:53 -0400 Subject: binutils-2.24.51: ldfile_try_open_bfd(): integrated pe_mdso_input_name(). --- binutils-2.24.51.midipix.patch | 72 ++++++++++++++++++++++++++++++------------ 1 file 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 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 <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 <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 -- cgit v1.2.3