aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2006-12-18 22:38:53 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2006-12-18 22:38:53 +0000
commitff2bdb9c0d6a2a966336c6b1d5cee3ce5bc109fe (patch)
treea735301729c6c03ac6c10e931bd47a628abafee3
parent69fbadd53d1404744d3e6032c42397c894d66be3 (diff)
downloadgdb-ff2bdb9c0d6a2a966336c6b1d5cee3ce5bc109fe.zip
gdb-ff2bdb9c0d6a2a966336c6b1d5cee3ce5bc109fe.tar.gz
gdb-ff2bdb9c0d6a2a966336c6b1d5cee3ce5bc109fe.tar.bz2
* 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.
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/pe.em15
-rw-r--r--ld/pe-dll.c8
-rw-r--r--ld/pe-dll.h3
-rw-r--r--ld/testsuite/ChangeLog6
5 files changed, 26 insertions, 13 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index a9a4b85..34ff9cd 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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*.
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 5416fac..1396e98 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -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;
}
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 43caa0c..0f0f2e0 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -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);
+}
diff --git a/ld/pe-dll.h b/ld/pe-dll.h
index c79e563..eb24a8a 100644
--- a/ld/pe-dll.h
+++ b/ld/pe-dll.h
@@ -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 */
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index d333608..9a9daf8 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -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