]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld: Rename a file on Windows fails if target already exists
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 18 Jul 2025 15:04:09 +0000 (17:04 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Tue, 22 Jul 2025 14:39:50 +0000 (16:39 +0200)
commit233cd5946413108bf4902b22a9cb23ad0a468f5e
treea6b4374c281430e9a6b4b2ac59ad2ce716e3ba56
parent9087bd989b5ff3c02386fc66afc187f37d31aa34
ld: Rename a file on Windows fails if target already exists

To rename a file on Windows, the target name cannot exist. Removing file
prior to renaming ensures this is handled.
To remove a file on Windows, the file cannot be open. Closing the bfd
handle ensures this is handled.
Moved call to free on isympp / osympp to after bfd is closed to align
with comment earlier in the cmdline_add_object_only_section function.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
ld/ldlang.c