Enable pei386_auto_import by default. Only print a info message about auto
authorNick Clifton <nickc@redhat.com>
Fri, 7 Jun 2002 14:56:01 +0000 (14:56 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 7 Jun 2002 14:56:01 +0000 (14:56 +0000)
imports being resilved if this feature was not requested via a command line
switch.

include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/emultempl/pe.em
ld/ldmain.c

index c0a912a..55bd90d 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-07  Charles Wilson  <cwilson@ece.gatech.edu>
+
+       * bfdlink.h (struct bfd_link_info): Change type of
+       pei386_auto_import field to int so that -1 can mean enabled by
+       default and 1 can mean enabled by command line switch.
+
 2002-06-06  DJ Delorie  <dj@redhat.com>
 
        * hashtab.h (htab): Rearrange new members for backward
index b1411c3..719e706 100644 (file)
@@ -3,21 +3,21 @@
    Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
 
-This file is part of BFD, the Binary File Descriptor library.
+   This file is part of BFD, the Binary File Descriptor library.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef BFDLINK_H
 #define BFDLINK_H
@@ -288,9 +288,10 @@ struct bfd_link_info
   /* May be used to set DT_FLAGS_1 for ELF. */
   bfd_vma flags_1;
 
-  /* True if auto-import thunks for DATA items in pei386 DLLs 
-     should be generated/linked against.  */
-  boolean pei386_auto_import;
+  /* Non-zero if auto-import thunks for DATA items in pei386 DLLs 
+     should be generated/linked against.  Set to 1 if this feature
+     is explicitly requested by the user, -1 if enabled by default.  */
+  int pei386_auto_import;
 
   /* True if non-PLT relocs should be merged into one reloc section
      and sorted so that relocs against the same symbol come together.  */
index 6efe3d7..01f0bc0 100644 (file)
@@ -1,3 +1,17 @@
+2002-06-07  Charles Wilson  <cwilson@ece.gatech.edu>
+
+       * 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.
+
 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
 
        * scripttempl/elf.sc (.tbss): Fix mismatched parentheses/braces.
@@ -7,7 +21,7 @@
        * configure.host (hppa*64*-*-hpux11*): Define NATIVE_LIB_DIRS,
        HOSTING_CRT0 and HOSTING_LIBS.
 
-Wed Jun  5 20:42:31 2002  J"orn Rennecke <joern.rennecke@superh.com>
+2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
 
        * configure.tgt (shle*-*-elf*, sh64le-*-elf*): New configurations.
 
index 4701f6d..b84a3c7 100644 (file)
@@ -173,7 +173,7 @@ gld_${EMULATION_NAME}_before_parse()
 #ifdef DLL_SUPPORT
   config.dynamic_link = true;
   config.has_shared = 1;
-/* link_info.pei386_auto_import = true; */
+  link_info.pei386_auto_import = -1;
 
 #if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
 #if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
@@ -628,10 +628,10 @@ gld_${EMULATION_NAME}_parse_args(argc, argv)
       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,9 @@ pe_find_data_imports ()
           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"),
-                     undef->root.string, buf);
+             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;
index 25ae5ec..2c406eb 100644 (file)
@@ -260,6 +260,7 @@ main (argc, argv)
   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;
   link_info.combreloc = true;
   link_info.spare_dynamic_tags = 5;