mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 03:42:22 +08:00
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.
This commit is contained in:
@ -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))
|
||||
sprintf (string, "%s/lib%s%s%s", search->name,
|
||||
filename, arch, EXTRA_SHLIB_EXTENSION);
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
if (! ldfile_try_open_bfd (string, entry))
|
||||
{
|
||||
free (string);
|
||||
return false;
|
||||
}
|
||||
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, '/');
|
||||
|
Reference in New Issue
Block a user