[PING][PATCH] binutils: Avoid renaming over existing files

Siddhesh Poyarekar siddhesh@gotplt.org
Mon Feb 15 16:11:26 GMT 2021


On 2/15/21 9:29 PM, Michael Matz wrote:
> What happens when stripping executables that are currently executing?
> You can't open them for writing (ETXTBSY), but you can delete/rename them.
> (There are other reasons why nominally writable files can't be opened for
> writing while delete/rename is possible)
> Does the behaviour change with your patch?

strip (or objcopy, etc.) will fail for existing files if the write fails 
for any reason, including ETXTBSY.  It's a tradeoff to preserve 
permissions and attributes; attempting to restore those is an endless 
race since there will always be some that binutils will miss.

Siddhesh


More information about the Binutils mailing list