diff options
author | Jeff Law <law@redhat.com> | 1999-11-04 06:45:07 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1999-11-04 06:45:07 +0000 |
commit | 93a6d43674ccaf3089bd29f7f3aa7b8e7b65d99c (patch) | |
tree | 4d15052a94a6f304bbcf98090a08cce50180aa40 /ld/emultempl | |
parent | 53b0d3971a015b795bd0230e9a6632f9d52a120b (diff) | |
download | gdb-93a6d43674ccaf3089bd29f7f3aa7b8e7b65d99c.zip gdb-93a6d43674ccaf3089bd29f7f3aa7b8e7b65d99c.tar.gz gdb-93a6d43674ccaf3089bd29f7f3aa7b8e7b65d99c.tar.bz2 |
Wed Nov 3 23:31:19 1999 Jeffrey A Law (law@cygnus.com)
* emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
Clean up code to use EXTRA_SHLIB_EXTENSION.
1999-09-14 Ulrich Drepper <drepper@cygnus.com>
* configure.in: Define EXTRA_SHLIB_EXTENSION to ".sl" for HP target.
* config.in: Add EXTRA_SHLIB_EXTENSION.
* emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
Search for second shared lib extension only if EXTRA_SHLIB_EXTENSION
is defined.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/elf32.em | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index e33e0ca..f2ff4d8 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -95,24 +95,31 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry) filename = entry->filename; + /* This allocates a few bytes too many when EXTRA_SHLIB_EXTENSION + is defined, but it does not seem worth the headache to optimize + away those two bytes of space. */ string = (char *) xmalloc (strlen (search->name) + strlen (filename) + strlen (arch) +#ifdef EXTRA_SHLIB_EXTENSION + + strlen (EXTRA_SHLIB_EXTENSION) +#endif + sizeof "/lib.so"); sprintf (string, "%s/lib%s%s.so", search->name, filename, arch); +#ifdef EXTRA_SHLIB_EXTENSION + /* Try the .so extension first. If that fails build a new filename + using EXTRA_SHLIB_EXTENSION. */ if (! ldfile_try_open_bfd (string, entry)) - { - /* It failed using .so, try again with .sl for oddball systems - that use a different naming scheme (ie hpux). */ - sprintf (string, "%s/lib%s%s.sl", search->name, filename, arch); + sprintf (string, "%s/lib%s%s%s", search->name, + filename, arch, EXTRA_SHLIB_EXTENSION); +#endif - if (! ldfile_try_open_bfd (string, entry)) - { - free (string); - return false; - } + if (! ldfile_try_open_bfd (string, entry)) + { + free (string); + return false; } entry->filename = string; @@ -133,12 +140,12 @@ 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 *filname, *needed_name; + char *needed_name; ASSERT (entry->is_archive && entry->search_dirs_flag); /* Rather than duplicating the logic above. Just use the - filename we recorded earlier.o + filename we recorded earlier. First strip off everything before the last '/'. */ filename = strrchr (entry->filename, '/'); |