From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 3D1DE3858407; Thu, 4 Aug 2022 20:08:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D1DE3858407 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: syscalls.cc: remove ".dll" from blessed_executable_suffixes X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 288788f91eadf307aa77853396917d9f9398adb9 X-Git-Newrev: c2aa5b6d74139cc2236f4cdf415d7a133a61042d Message-Id: <20220804200827.3D1DE3858407@sourceware.org> Date: Thu, 4 Aug 2022 20:08:27 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2022 20:08:27 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc2aa5b6d741= 39cc2236f4cdf415d7a133a61042d commit c2aa5b6d74139cc2236f4cdf415d7a133a61042d Author: Ken Brown Date: Wed Aug 3 16:45:23 2022 -0400 Cygwin: syscalls.cc: remove ".dll" from blessed_executable_suffixes =20 This reverts commit d9e9c7b5a7. The latter added ".dll" to the blessed_executable_suffixes array because on 32-bit Windows, the GetBinaryType function would report that a 64-bit DLL is an executable, contrary to the documentation of that function. =20 That anomaly does not exist on 64-bit Windows, so we can remove ".dll" from the list. Reverting the commit does, however, change the behavior of the rename(2) syscall in the following unlikely situation: Suppose we have an executable foo.exe and we make the call =20 rename ("foo", "bar.dll"); =20 Previously, foo.exe would be renamed to bar.dll. So bar.dll would then be an executable without the .exe extension. The new behavior is that foo.exe will be renamed to bar.dll.exe. [Exception: If there already existed an executable (not a DLL!) with the name bar.dll, then .exe will not be appended.] Diff: --- winsup/cygwin/globals.cc | 1 - winsup/cygwin/syscalls.cc | 6 ------ 2 files changed, 7 deletions(-) diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index e8147cb5c..e909d0f8f 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -120,7 +120,6 @@ const int __collate_load_error =3D 0; extern UNICODE_STRING _RDATA ro_u_empty =3D _ROU (L""); extern UNICODE_STRING _RDATA ro_u_lnk =3D _ROU (L".lnk"); extern UNICODE_STRING _RDATA ro_u_exe =3D _ROU (L".exe"); - extern UNICODE_STRING _RDATA ro_u_dll =3D _ROU (L".dll"); extern UNICODE_STRING _RDATA ro_u_com =3D _ROU (L".com"); extern UNICODE_STRING _RDATA ro_u_scr =3D _ROU (L".scr"); extern UNICODE_STRING _RDATA ro_u_sys =3D _ROU (L".sys"); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 2a481b8e5..94cb57648 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2098,12 +2098,6 @@ nt_path_has_executable_suffix (PUNICODE_STRING upath) static const PUNICODE_STRING blessed_executable_suffixes[] =3D { &ro_u_com, - &ro_u_dll, /* Messy, messy. Per MSDN, the GetBinaryType function is - supposed to return with ERROR_BAD_EXE_FORMAT. if the file - is a DLL. On 64-bit Windows, this works as expected for - 32-bit and 64-bit DLLs. On 32-bit Windows this only works - for 32-bit DLLs. For 64-bit DLLs, 32-bit Windows returns - true with the type set to SCS_64BIT_BINARY. */ &ro_u_exe, &ro_u_scr, &ro_u_sys,