* pe-dll.c (pe_bfd_is_dll): New function.
authorChristopher Faylor <me+cygwin@cgf.cx>
Mon, 18 Dec 2006 22:38:53 +0000 (22:38 +0000)
committerChristopher Faylor <me+cygwin@cgf.cx>
Mon, 18 Dec 2006 22:38:53 +0000 (22:38 +0000)
* pe-dll.h (pe_bfd_is_dll): Declare.
* emultempl/pe.em (gld_${EMULATION_NAME}_recognized_file): Recognize dlls using
pe_bfd_is_dll instead of using the filename extension.

ld/ChangeLog
ld/emultempl/pe.em
ld/pe-dll.c
ld/pe-dll.h
ld/testsuite/ChangeLog

index a9a4b85268c0c2c3df03ecc518c19934f1ba6976..34ff9cd1481a5d695ec6ecd43270d060f1eb4cd3 100644 (file)
@@ -1,3 +1,10 @@
+2006-12-18  Pedro Alves  <pedro_alves@portugalmail.pt>
+
+       * pe-dll.c (pe_bfd_is_dll): New function.
+       * pe-dll.h (pe_bfd_is_dll): Declare.
+       * emultempl/pe.em (gld_${EMULATION_NAME}_recognized_file): Recognize
+       dlls using pe_bfd_is_dll instead of using the filename extension.
+
 2006-12-15  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * configure.tgt (NATIVE_LIB_DIRS): Specify for spu-*-elf*.
index 5416fac75a5feb6c610be23776793b9f69012c09..1396e9842f270ef6bf243007ace532e29b1a0bf5 100644 (file)
@@ -1415,19 +1415,8 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT
 #ifdef TARGET_IS_arm_wince_pe
   pe_dll_id_target ("pei-arm-wince-little");
 #endif
-  if (bfd_get_format (entry->the_bfd) == bfd_object)
-    {
-      char fbuf[LD_PATHMAX + 1];
-      const char *ext;
-
-      if (REALPATH (entry->filename, fbuf) == NULL)
-       strncpy (fbuf, entry->filename, sizeof (fbuf));
-
-      ext = fbuf + strlen (fbuf) - 4;
-
-      if (strcmp (ext, ".dll") == 0 || strcmp (ext, ".DLL") == 0)
-       return pe_implied_import_dll (fbuf);
-    }
+  if (pe_bfd_is_dll (entry->the_bfd))
+    return pe_implied_import_dll (entry->filename);
 #endif
   return FALSE;
 }
index 43caa0c5982a5df111c237f2c3ec7e5f06f00943..0f0f2e04faeb261d7e6faedff4fe6279b57ee8e8 100644 (file)
@@ -2830,3 +2830,11 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info)
     }
   reloc_s->contents = reloc_d;
 }
+
+bfd_boolean
+pe_bfd_is_dll (bfd *abfd)
+{
+  return (bfd_get_format (abfd) == bfd_object
+          && obj_pe (abfd)
+          && pe_data (abfd)->dll);
+}
index c79e563b6985adca1a89ecc2e6a2294b99c7be10..eb24a8a9ae331a159fc0e307894e3f487887d917 100644 (file)
@@ -59,4 +59,7 @@ extern void pe_walk_relocs_of_symbol
   (struct bfd_link_info *, const char *, int (*) (arelent *, asection *));
 extern void pe_create_import_fixup
   (arelent * rel, asection *, int);
+extern bfd_boolean pe_bfd_is_dll
+  (bfd *);
+
 #endif /* PE_DLL_H */
index d333608a4951484e854ff73346614dfa99b41f4b..9a9daf86a593ad8728d0181ee9f7b936d844b76c 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-18  Pedro Alves  <pedro_alves@portugalmail.pt>
+
+       * ld-pe/direct.exp: New file.
+       * ld-pe/direct_client.c: Likewise.
+       * ld-pe/direct_dll.c: Likewise.
+
 2006-12-13  Dave Brolley  <brolley@redhat.com>
 
        * lib/ld-lib.exp (big_or_little_endian): Accept -meb and