aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1999-09-16 20:53:09 +0000
committerJeff Law <law@redhat.com>1999-09-16 20:53:09 +0000
commitd3cc5bd625c76b09b995c0f1f313fc1f83064d07 (patch)
treec1e44748d3ecc2183537950998e736c9b459d2c3 /ld
parent1209c612943c38328b38717f98065a37ea11d359 (diff)
downloadgdb-d3cc5bd625c76b09b995c0f1f313fc1f83064d07.zip
gdb-d3cc5bd625c76b09b995c0f1f313fc1f83064d07.tar.gz
gdb-d3cc5bd625c76b09b995c0f1f313fc1f83064d07.tar.bz2
* 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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/emultempl/elf32.em16
2 files changed, 15 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c46803e..2538c44 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index e590c71..1dfe8f4 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -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);
}