* emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
authorJeff Law <law@redhat.com>
Thu, 16 Sep 1999 20:53:09 +0000 (20:53 +0000)
committerJeff Law <law@redhat.com>
Thu, 16 Sep 1999 20:53:09 +0000 (20:53 +0000)
        Use the same filename extension for the bfd_elf_dt_needed_name call
        as we did for finding the library.

ld/ChangeLog
ld/emultempl/elf32.em

index c46803e023b549043fb80c685ff5fc136465f0ed..2538c44dbce9c0e660cb8e4727d44118aad18807 100644 (file)
@@ -1,5 +1,9 @@
 Thu Sep 16 10:59:56 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
+       Use the same filename extension for the bfd_elf_dt_needed_name call
+       as we did for finding the library.
+
        * emulparms/elf64hppa.sh (DATA_START_SYMBOLS): Define.
        (OTHER_READWRITE_SECTIONS): No longer define __hp_load_map.
 
index e590c71506ef9e1a43649dbe38c8d6e2ef1de7ae..1dfe8f4ca4be059bfc485067458b1e1eaeee209a 100644 (file)
@@ -133,13 +133,19 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
   if (bfd_check_format (entry->the_bfd, bfd_object)
       && (entry->the_bfd->flags & DYNAMIC) != 0)
     {
-      char *needed_name;
+      char *filname, *needed_name;
 
       ASSERT (entry->is_archive && entry->search_dirs_flag);
-      needed_name = (char *) xmalloc (strlen (filename)
-                                     + strlen (arch)
-                                     + sizeof "lib.so");
-      sprintf (needed_name, "lib%s%s.so", filename, arch);
+
+      /* Rather than duplicating the logic above.  Just use the
+        filename we recorded earlier.o
+
+        First strip off everything before the last '/'.  */
+      filename = strrchr (entry->filename, '/');
+      filename++;
+
+      needed_name = (char *) xmalloc (strlen (filename)) + 1;
+      strcpy (needed_name, filename);
       bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
     }