From acb8dbc92e12684ff9e0da8fdbf2beb0e43ccacb Mon Sep 17 00:00:00 2001 From: nickc Date: Thu, 4 Oct 2007 13:55:25 +0000 Subject: [PATCH] PR linker/4844 * emultempl/pep.em (pep_find_data_imports): Issue a warning message if auto importing is triggered without --enable-auto-import having been specified on the command line. * emultempl/pe.em (pe_find_data_imports): Likewise. --- ld/ChangeLog | 6 ++++++ ld/emultempl/pe.em | 16 ++++++++++++++-- ld/emultempl/pep.em | 16 ++++++++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index dc5f02a9a0..a611417d7b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2007-10-04 Nick Clifton + PR linker/4844 + * emultempl/pep.em (pep_find_data_imports): Issue a warning + message if auto importing is triggered without + --enable-auto-import having been specified on the command line. + * emultempl/pe.em (pe_find_data_imports): Likewise. + PR linker/5097 * emultempl/armelf.em (arm_elf_finish): Fix spelling typo. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 43ce8e91d2..503f79ec2a 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -920,8 +920,20 @@ pe_find_data_imports (void) int nsyms, symsize, i; if (link_info.pei386_auto_import == -1) - info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"), - undef->root.string, buf); + { + static bfd_boolean warned = FALSE; + + info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"), + undef->root.string, buf); + + /* PR linker/4844. */ + if (! warned) + { + warned = TRUE; + einfo (_("%P: warning: auto-importing has been activated without --enable-auto-import specified on the command line.\n\ +This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.")); + } + } symsize = bfd_get_symtab_upper_bound (b); symbols = (asymbol **) xmalloc (symsize); diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 9e27e15f12..36b4f61237 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -884,8 +884,20 @@ pep_find_data_imports (void) int nsyms, symsize, i; if (link_info.pei386_auto_import == -1) - info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"), - undef->root.string, buf); + { + static bfd_boolean warned = FALSE; + + info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"), + undef->root.string, buf); + + /* PR linker/4844. */ + if (! warned) + { + warned = TRUE; + einfo (_("%P: warning: auto-importing has been activated without --enable-auto-import specified on the command line.\n\ +This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.")); + } + } symsize = bfd_get_symtab_upper_bound (b); symbols = xmalloc (symsize); -- 2.11.0