[PATCH v2] ld: Make library member file suffix comparisons case insensitive when cross compiling too

Nick Clifton nickc@redhat.com
Tue Aug 23 14:01:06 GMT 2022


Hi Martin,

> +/* Hardcoded case insensitive comparison. filename_cmp is insensitive
> + * when running on Windows, but when cross compiling to Windows, we
> + * also want similar comparisons to be case insensitive. */
> +static int stricmp (const char *s1, const char *s2)
> +{
> +  for (;;)
> +    {
> +      int c1 = TOLOWER (*s1++);
> +      int c2 = TOLOWER (*s2++);
> +
> +      if (c1 != c2)
> +        return (c1 - c2);
> +
> +      if (c1 == '\0')
> +        return 0;
> +    }
> +}

The implementation of filename_cmp() in libiberty also treats forward
slashes and backward slashes as the same, on DOS based filesystems.
Shouldn't this be carried over to stricmp() as well ?

Cheers
   Nick



More information about the Binutils mailing list