[PATCH] ld: Unify the directory separator on Windows.
Maciej W. Rozycki
macro@orcam.me.uk
Sun Jul 26 04:06:29 GMT 2026
On Fri, 24 Jul 2026, Jan Beulich wrote:
> That said, I'm okay with the code change, but I'd like the description
> to be accurate. I'm inclined to suggest to replace that part of the
> description with just
>
> "This piece of code appears to be a leftover from the dark Windows 9x
> era, or even earlier."
It's not clear what the rationale was as the origin was lost between
commit 1730ec6b1848 and commit 252b5132c75, which we have no history for
other than:
Thu Jan 29 16:04:21 1998 Mumit Khan <khan@xraylith.wisc.edu>
* ldfile.c (slash): Set to backslash if _WIN32 but not
__CYGWIN32__.
(ldfile_open_file_search): If __MSDOS__ or _WIN32, accept a
leading backslash or a leading x: as an absolute path.
(ldfile_find_command_file): Use slash rather than / when
generating name to try.
* lexsup.c (PATH_SEPARATOR): Define.
(set_default_dirlist): Use PATH_SEPARATOR rather than ':'.
> (as I think even Win9x was already capable of dealing with '/', at least
> in the common case. Iirc even newer versions of ancient DOS were capable
> of that.)
It may make sense to summarise findings from the discussion I referred:
<https://inbox.sourceware.org/gdb-patches/20260629212430.340516-1-pedro@palves.net/>.
Maciej
More information about the Binutils
mailing list