This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: PR 459: Shared library member is rejected for non-static link
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 18 Oct 2004 14:09:03 -0700
- Subject: PATCH: PR 459: Shared library member is rejected for non-static link
We should save/restore config.dynamic_link for linker script.
H.J.
-----
2004-10-18 H.J. Lu <hongjiu.lu@intel.com>
PR 459
* ldlang.c (load_symbols): Use the same -Bdynamic/-Bstatic
option on linker script as the one for linker script.
--- ld/ldlang.c.dynamic 2004-10-18 09:29:05.000000000 -0700
+++ ld/ldlang.c 2004-10-18 13:57:56.054499415 -0700
@@ -1773,6 +1773,7 @@ load_symbols (lang_input_statement_type
lang_statement_list_type *hold;
bfd_boolean bad_load = TRUE;
bfd_boolean save_ldlang_sysrooted_script;
+ bfd_boolean save_last_dynamic;
err = bfd_get_error ();
@@ -1809,7 +1810,12 @@ load_symbols (lang_input_statement_type
ldfile_assumed_script = TRUE;
parser_input = input_script;
+ /* We want to use the same -Bdynamic/-Bstatic as the one for
+ ENTRY. */
+ save_last_dynamic = config.dynamic_link;
+ config.dynamic_link = entry->dynamic;
yyparse ();
+ config.dynamic_link = save_last_dynamic;
ldfile_assumed_script = FALSE;
ldlang_sysrooted_script = save_ldlang_sysrooted_script;