Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps AT cygwin DOT com Delivered-To: mailing list cygwin-apps AT cygwin DOT com Message-ID: <3CF6B33A.2060405@ece.gatech.edu> Date: Thu, 30 May 2002 19:18:18 -0400 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: Charles Wilson CC: binutils AT sources DOT redhat DOT com, cygwin-apps AT cygwin DOT com Subject: Re: [PATCH] pei386: make --enable-auto-import default References: <3CF68E17 DOT 6060008 AT ece DOT gatech DOT edu> Content-Type: multipart/mixed; boundary="------------080700050408090604090505" X-Virus-Scanned: by amavisd-milter (http://amavis.org/) This is a multi-part message in MIME format. --------------080700050408090604090505 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Blarg. The dangers of "one last change" without actually testing it. Use the attached patch instead of earlier one... this one actually compiles, works, and does what the changelog claims. Sorry for the confusion. --Chuck Charles Wilson wrote: > auto-import has been turned on by default in the cygwin build since > November, with no ill effects. This patch turns it on by default in > general, but also changes the way auto-import-related > warning/informational messages are issued, depending on whether > auto-import is on by default, or is explicitly enabled (obviously there > are no auto-import-related messages when auto-import is explicitly > disabled...) > > Since the tests in /bfd/ against pei386_auto_import are already against > "zero/non-zero", then we can use the same -1 == default (implicitly > enabled), 1 == explicitly enabled, 0 == explicitly disabled formuation > that stdcall_fixup uses. > > ./bfd/cofflink.c: if (!h && info->pei386_auto_import) > ./bfd/linker.c: if (info->pei386_auto_import) > > When info->pei386_auto_import = -1 (default) then we continue to issue a > message when auto-importing a variable. If info->pei386_auto_import = > 1, then we suppress those informational messages -- the user obviously > knows that she is auto-importing variables, since she explicitly > --enabled them. > > I downgraded the "Warning: resolving %s by linking to %s (auto-import)" > message to 'info_msg' on stdout, instead of 'einfo' on stderr. > > --Chuck > > 2002-05-30 Charles Wilson > > * ld/ldmain.c (main): initialize link_info.pei386_auto_import > to -1 == implicit enable. > * ld/emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): > initialize link_info.pei386_auto_import to -1 == implicit > enable. > (gld_${EMULATION_NAME}_parse_args): When processing > --enable-auto-import and --disable-auto-import options, use > '1' and '0' instead of 'true' and 'false'. > (pe_find_data_imports): Only issue message about auto-import > when the feature is implicitly enabled. Downgrade message to > informational instead of warning. --------------080700050408090604090505 Content-Type: text/plain; name="binutils.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="binutils.patch" Index: ld/ldmain.c =================================================================== RCS file: /cvs/src/src/ld/ldmain.c,v retrieving revision 1.47 diff -u -r1.47 ldmain.c --- ld/ldmain.c 22 May 2002 05:08:30 -0000 1.47 +++ ld/ldmain.c 30 May 2002 23:13:01 -0000 @@ -259,7 +259,7 @@ link_info.eh_frame_hdr = false; link_info.flags = (bfd_vma) 0; link_info.flags_1 = (bfd_vma) 0; - link_info.pei386_auto_import = false; + link_info.pei386_auto_import = -1; /* 0=disable 1=enable */ link_info.combreloc = true; link_info.spare_dynamic_tags = 5; Index: ld/emultempl/pe.em =================================================================== RCS file: /cvs/src/src/ld/emultempl/pe.em,v retrieving revision 1.63 diff -u -r1.63 pe.em --- ld/emultempl/pe.em 27 May 2002 08:22:08 -0000 1.63 +++ ld/emultempl/pe.em 30 May 2002 23:13:05 -0000 @@ -173,7 +173,7 @@ #ifdef DLL_SUPPORT config.dynamic_link = true; config.has_shared = 1; -/* link_info.pei386_auto_import = true; */ + link_info.pei386_auto_import = -1; /* 1=enable 0=disable */ #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2) #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe @@ -628,10 +628,10 @@ pe_dll_do_default_excludes = 0; break; case OPTION_DLL_ENABLE_AUTO_IMPORT: - link_info.pei386_auto_import = true; + link_info.pei386_auto_import = 1; break; case OPTION_DLL_DISABLE_AUTO_IMPORT: - link_info.pei386_auto_import = false; + link_info.pei386_auto_import = 0; break; case OPTION_ENABLE_EXTRA_PE_DEBUG: pe_dll_extra_pe_debug = 1; @@ -912,8 +912,11 @@ sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1); if (sym && sym->type == bfd_link_hash_defined) { - einfo (_("Warning: resolving %s by linking to %s (auto-import)\n"), + if (link_info.pei386_auto_import == -1) + { + info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"), undef->root.string, buf); + } { bfd *b = sym->u.def.section->owner; asymbol **symbols; --------------080700050408090604090505--