summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2000-07-17 18:59:58 +0000
committerDJ Delorie <dj@delorie.com>2000-07-17 18:59:58 +0000
commit5dc9edfd590f633c06c4a32e41d9347974302f6b (patch)
tree9456e41bb738a599a05fbaf08b60a4dc1ece980d /ld
parente7f2859815086c3878377abf6d93b349bc3d28b4 (diff)
downloadbinutils-redhat-5dc9edfd590f633c06c4a32e41d9347974302f6b.tar.gz
* src/ld/emultempl/pe.em (gld_*_open_dynamic_archive): New search
order for dynamic library '-lfoo' on pei386: libfoo.dll.a, foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility errors introduced by the old dynamic lib search order.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/pe.em31
2 files changed, 31 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 24529c3aae..d25865bd2c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2000-07-16 Charles Wilson <cwilson@ece.gatech.edu>
+
+ * src/ld/emultempl/pe.em (gld_*_open_dynamic_archive): New search
+ order for dynamic library '-lfoo' on pei386: libfoo.dll.a,
+ foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility
+ errors introduced by the old dynamic lib search order.
+
2000-07-17 DJ Delorie <dj@cygnus.com>
* pe-dll.c (process_def_file): auto-export data items also
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 582d541895..0ffeffc061 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1387,16 +1387,33 @@ gld_${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
sprintf (string, "%s/%s.dll.a", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- /* Try "libfoo.dll" (preferred dll name) */
- sprintf (string, "%s/lib%s.dll", search->name, filename);
+/*
+ Try libfoo.a next. Normally, this would be interpreted as a static
+ library, but it *could* be an import library. For backwards compatibility,
+ libfoo.a needs to ==precede== libfoo.dll and foo.dll in the search,
+ or sometimes errors occur when building legacy packages.
+
+ Putting libfoo.a here means that in a failure case (i.e. the library
+ -lfoo is not found) we will search for libfoo.a twice before
+ giving up -- once here, and once when searching for a "static" lib.
+ for a "static" lib.
+*/
+ /* Try "libfoo.a" (import lib, or static lib, but must
+ take precedence over dll's) */
+ sprintf (string, "%s/lib%s.a", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
- {
- /* Finally, try "foo.dll" (alternate dll name) */
- sprintf (string, "%s/%s.dll", search->name, filename);
+ {
+ /* Try "libfoo.dll" (preferred dll name) */
+ sprintf (string, "%s/lib%s.dll", search->name, filename);
if (! ldfile_try_open_bfd (string, entry))
{
- free (string);
- return false;
+ /* Finally, try "foo.dll" (alternate dll name) */
+ sprintf (string, "%s/%s.dll", search->name, filename);
+ if (! ldfile_try_open_bfd (string, entry))
+ {
+ free (string);
+ return false;
+ }
}
}
}