[PATCH] ld: testsuite: Fix a few backslash-related issues on MinGW.

Jan Dubiec jdx@o2.pl
Fri Jul 17 15:43:41 GMT 2026


On 17.07.2026 16:05, Maciej W. Rozycki wrote:
[...]

>   This doesn't answer my question; we know from your report that it happens
> "somewhere in the linker" already.  Please point me at the source code
> line this happens at.  I have no MinGW host system available to track it
> down myself.
I don't know the exact line number, but look at ld/ldfile.c. Near the 
top it has the following definition:

[...]
#ifdef VMS
static char *slash = "";
#else
#if defined (_WIN32) && !defined (__CYGWIN32__)
static char *slash = "\\";
#else
static char *slash = "/";
#endif
#endif
[...]

and then four times calls concat() (concat.c from libiberty), e.g. like 
this:

[...]
if (entry->flags.maybe_archive && !entry->flags.full_name_provided)
     string = concat (search->name, slash, lib, entry->filename,
                      arch, suffix, (const char *) NULL);
else
     string = concat (search->name, slash, entry->filename,
                      (const char *) 0);

if (ldfile_try_open_bfd (string, entry))
[...]

But does it really matter? The definition of slash appears to be 30+ 
years old, and the binutils tools have been working successfully on 
Windows for many years. The issue clearly lies with the test cases.

/J.D.



More information about the Binutils mailing list