2009-01-03 Dave Korn <dave.korn.cygwin@gmail.com>
* pe-dll.c (autofilter_liblist): Add entry for shared libgcc. (libnamencmp): New function. (auto_export): Use it in place of strncmp when filtering libraries. Also rolled over ChangeLog to ChangeLog-2008
This commit is contained in:
parent
9dbe889014
commit
81b07b162c
1095
ld/ChangeLog
1095
ld/ChangeLog
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
34
ld/pe-dll.c
34
ld/pe-dll.c
|
@ -314,6 +314,7 @@ static const autofilter_entry_type autofilter_liblist[] =
|
|||
{ STRING_COMMA_LEN ("libcegcc") },
|
||||
{ STRING_COMMA_LEN ("libcygwin") },
|
||||
{ STRING_COMMA_LEN ("libgcc") },
|
||||
{ STRING_COMMA_LEN ("libgcc_s") },
|
||||
{ STRING_COMMA_LEN ("libstdc++") },
|
||||
{ STRING_COMMA_LEN ("libmingw32") },
|
||||
{ STRING_COMMA_LEN ("libmingwex") },
|
||||
|
@ -324,6 +325,37 @@ static const autofilter_entry_type autofilter_liblist[] =
|
|||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
/* Regardless of the suffix issue mentioned above, we must ensure that
|
||||
we do not falsely match on a leading substring, such as when libtool
|
||||
builds libstdc++ as a DLL using libsupc++convenience.a as an intermediate.
|
||||
This routine ensures that the leading part of the name matches and that
|
||||
it is followed by only an optional version suffix and a file extension,
|
||||
returning zero if so or -1 if not. */
|
||||
static int libnamencmp (const char *libname, const autofilter_entry_type *afptr)
|
||||
{
|
||||
if (strncmp (libname, afptr->name, afptr->len))
|
||||
return -1;
|
||||
|
||||
libname += afptr->len;
|
||||
|
||||
/* Be liberal in interpreting what counts as a version suffix; we
|
||||
accept anything that has a dash to separate it from the name and
|
||||
begins with a digit. */
|
||||
if (libname[0] == '-')
|
||||
{
|
||||
if (!ISDIGIT (*++libname))
|
||||
return -1;
|
||||
/* Ensure the filename has an extension. */
|
||||
while (*++libname != '.')
|
||||
if (!*libname)
|
||||
return -1;
|
||||
}
|
||||
else if (libname[0] != '.')
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const autofilter_entry_type autofilter_objlist[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN ("crt0.o") },
|
||||
|
@ -501,7 +533,7 @@ auto_export (bfd *abfd, def_file *d, const char *n)
|
|||
|
||||
while (afptr->name)
|
||||
{
|
||||
if (strncmp (libname, afptr->name, afptr->len) == 0 )
|
||||
if (libnamencmp (libname, afptr) == 0 )
|
||||
return 0;
|
||||
afptr++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue