Add new devices x1122 x1132 emulation.
[deliverable/binutils-gdb.git] / ld / pe-dll.c
index cac0dbec874b5423e265c09f5fcf83a960de9423..95cdd7e36c16f9a1b03183f0b7587a4b7b9845df 100644 (file)
@@ -225,6 +225,7 @@ static autofilter_entry_type autofilter_symbollist[] =
   { "impure_ptr", 10 },
   { "_pei386_runtime_relocator", 25 },
   { "do_pseudo_reloc", 15 },
+  { "cygwin_crt0", 11 },
   { NULL, 0 }
 };
 
@@ -2017,8 +2018,8 @@ make_import_fixup_mark (rel)
      overflowing this buffer...  */
     {
       free (fixup_name);
-      /* New buffer size is length of symbol, plus 25, but then
-        rounded up to the nearest multiple of 128.  */
+      /* New buffer size is length of symbol, plus 25, but
+        then rounded up to the nearest multiple of 128.  */
       buffer_len = ((strlen (sym->name) + 25) + 127) & ~127;
       fixup_name = (char *) xmalloc (buffer_len);
     }
@@ -2152,7 +2153,7 @@ make_runtime_pseudo_reloc (name, fixup_name, addend, parent)
 }
 
 /*     .section        .rdata
-       .rva            __pei386_runtime_relocator */
+       .rva            __pei386_runtime_relocator  */
 
 static bfd *
 pe_create_runtime_relocator_reference (parent)
@@ -2608,6 +2609,16 @@ pe_implied_import_dll (filename)
      to enable symbolic dll linking.  */
   dll_name = pe_as32 (expdata + 12) + erva;
 
+  /* Check to see if the dll has already been added to
+     the definition list and if so return without error.
+     This avoids multiple symbol definitions.  */
+  if (def_get_module (pe_def_file, dll_name))
+    {
+      if (pe_dll_extra_pe_debug)
+       printf ("%s is already loaded\n", dll_name);
+      return TRUE;
+    }
+
   /* Iterate through the list of symbols.  */
   for (i = 0; i < nexp; i++)
     {
@@ -2683,7 +2694,7 @@ pe_dll_fill_sections (abfd, info)
 
       /* Resize the sections.  */
       lang_size_sections (stat_ptr->head, abs_output_section,
-                         &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+                         &stat_ptr->head, 0, (bfd_vma) 0, NULL, TRUE);
 
       /* Redo special stuff.  */
       ldemul_after_allocation ();
@@ -2717,7 +2728,7 @@ pe_exe_fill_sections (abfd, info)
 
       /* Resize the sections.  */
       lang_size_sections (stat_ptr->head, abs_output_section,
-                         &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+                         &stat_ptr->head, 0, (bfd_vma) 0, NULL, TRUE);
 
       /* Redo special stuff.  */
       ldemul_after_allocation ();
This page took 0.023861 seconds and 4 git commands to generate.