gdb/
[binutils-gdb.git] / ld / emultempl / pep.em
index 13129780b56d6066c41166a5c5eb741579e6a9d6..39daa079c08fa6e79344c531c2ac23a139eb57c5 100644 (file)
@@ -139,7 +139,7 @@ gld_${EMULATION_NAME}_before_parse (void)
 #ifdef DLL_SUPPORT
   config.dynamic_link = TRUE;
   config.has_shared = 1;
-  link_info.pei386_auto_import = -1;
+  link_info.pei386_auto_import = 1;
   link_info.pei386_runtime_pseudo_reloc = 2; /* Use by default version 2.  */
 #endif
 }
@@ -185,7 +185,6 @@ enum options
   OPTION_EXCLUDE_LIBS,
   OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC,
   OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC,
-  OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1,
   OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2,
   OPTION_EXCLUDE_MODULES_FOR_IMPLIB,
   OPTION_USE_NUL_PREFIXED_IMPORT_TABLES,
@@ -263,7 +262,6 @@ gld${EMULATION_NAME}_add_options
     {"enable-extra-pep-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG},
     {"enable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC},
     {"disable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC},
-    {"enable-runtime-pseudo-reloc-v1", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1},
     {"enable-runtime-pseudo-reloc-v2", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2},
 #endif
     {"enable-long-section-names", no_argument, NULL, OPTION_ENABLE_LONG_SECTION_NAMES},
@@ -736,9 +734,6 @@ gld${EMULATION_NAME}_handle_option (int optc)
     case OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC:
       link_info.pei386_runtime_pseudo_reloc = 0;
       break;
-    case OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1:
-      link_info.pei386_runtime_pseudo_reloc = 1;
-      break;
     case OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2:
       link_info.pei386_runtime_pseudo_reloc = 2;
       break;
@@ -1097,22 +1092,6 @@ pep_find_data_imports (void)
              asymbol **symbols;
              int nsyms, i;
 
-             if (link_info.pei386_auto_import == -1)
-               {
-                 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.\n"));
-                   }
-               }
-
              if (!bfd_generic_link_read_symbols (b))
                {
                  einfo (_("%B%F: could not read symbols: %E\n"), b);
@@ -1698,6 +1677,9 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
          { ".text",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
            0, 0, 0, 0 },
+         { ".idata",
+           SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
+           0, 0, 0, 0 },
          { ".rdata",
            SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
            0, 0, 0, 0 },
@@ -1711,6 +1693,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       enum orphan_save_index
        {
          orphan_text = 0,
+         orphan_idata,
          orphan_rodata,
          orphan_data,
          orphan_bss
@@ -1744,7 +1727,10 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
       else if ((s->flags & SEC_READONLY) == 0)
        place = &hold[orphan_data];
       else if ((s->flags & SEC_CODE) == 0)
-       place = &hold[orphan_rodata];
+       {
+         place = (!strncmp (secname, ".idata\$", 7) ? &hold[orphan_idata]
+                                                    : &hold[orphan_rodata]);
+       }
       else
        place = &hold[orphan_text];
 
@@ -1928,7 +1914,7 @@ sed $sc ldscripts/${EMULATION_NAME}.xbn                   >> e${EMULATION_NAME}.c
 echo '  ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xn                 >> e${EMULATION_NAME}.c
 if test -n "$GENERATE_AUTO_IMPORT_SCRIPT" ; then
-echo '  ; else if (link_info.pei386_auto_import == 1) return'  >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.pei386_auto_import == 1 && link_info.pei386_runtime_pseudo_reloc != 2) return'    >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xa                 >> e${EMULATION_NAME}.c
 fi
 echo '  ; else return'                                 >> e${EMULATION_NAME}.c