Changeset 1253


Ignore:
Timestamp:
Feb 16, 2004, 4:42:39 AM (21 years ago)
Author:
bird
Message:

Fixed some library searching for OS/2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/ld/ldfile.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1252 r1253  
    8989  if (! realname)
    9090    return FALSE;
    91  
     91
    9292  len = strlen (realname);
    9393
     
    354354                                 + strlen (arch)
    355355                                 + strlen (suffix)
     356#if defined (__EMX__) /* Target feature really, but no target define to test on. */
     357                                 + 16);
     358#else
    356359                                 + 1);
    357 
     360#endif
     361
     362#if defined (__EMX__) /* Target feature really, but no target define to test on. */
     363      /* On OS/2 we have a complex naming scheme for libraries. They may have a
     364         prefix, we prefere the ones with. They may also have special suffixes
     365         depending on the library type. _s.a mean static, _dll.a mean dynaminc,
     366         plain .a might mean both and should be searched last.
     367
     368         TODO: make a ldemul_open_static_archive(). */
     369
     370      if (entry->is_archive)
     371        sprintf (string, "%s%s%s%s%s%s%s", search->name, slash,
     372                 lib, entry->filename, arch,
     373                 (entry->dynamic && ! link_info.relocateable ? "" : "_s"),
     374                 suffix);
     375      else
     376        sprintf (string, "%s%s%s", search->name, slash, entry->filename);
     377
     378      if (ldfile_try_open_bfd (string, entry))
     379        {
     380          entry->filename = string;
     381          entry->sysrooted = search->sysrooted;
     382          return TRUE;
     383        }
     384
     385      if (entry->is_archive)
     386        {
     387          /* without lib prefix. */
     388          sprintf (string, "%s%s%s%s%s%s", search->name, slash,
     389                   entry->filename, arch,
     390                   (entry->dynamic && ! link_info.relocateable ? "" : "_s"),
     391                   suffix);
     392          if (ldfile_try_open_bfd (string, entry))
     393            {
     394              entry->filename = string;
     395              entry->sysrooted = search->sysrooted;
     396              return TRUE;
     397            }
     398
     399          /* inverse the "_s". */
     400          sprintf (string, "%s%s%s%s%s%s%s", search->name, slash,
     401                   lib, entry->filename, arch,
     402                   (entry->dynamic && ! link_info.relocateable ? "_s" : ""),
     403                   suffix);
     404          if (ldfile_try_open_bfd (string, entry))
     405            {
     406              entry->filename = string;
     407              entry->sysrooted = search->sysrooted;
     408              return TRUE;
     409            }
     410
     411          /* without lib prefix and inverse "_s". */
     412          sprintf (string, "%s%s%s%s%s%s", search->name, slash,
     413                   entry->filename, arch,
     414                   (entry->dynamic && ! link_info.relocateable ? "_s" : ""),
     415                   suffix);
     416          if (ldfile_try_open_bfd (string, entry))
     417            {
     418              entry->filename = string;
     419              entry->sysrooted = search->sysrooted;
     420              return TRUE;
     421            }
     422        }
     423#else /* __EMX__ ^ */
    358424      if (entry->is_archive)
    359425        sprintf (string, "%s%s%s%s%s%s", search->name, slash,
     
    368434          return TRUE;
    369435        }
     436#endif /* __EMX__ */
     437
    370438
    371439      free (string);
     
    404472           arch = arch->next)
    405473        {
    406 #if defined (__EMX__) /* Target feature really, but no target define to test on. */
    407           found = ldfile_open_file_search (arch->name, entry, "", ".a");
    408           if (found)
    409             break;
    410 #endif /* __EMX__ */
    411474          found = ldfile_open_file_search (arch->name, entry, "lib", ".a");
    412475          if (found)
Note: See TracChangeset for help on using the changeset viewer.