From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 737DA3858D3C for ; Wed, 22 Feb 2023 01:35:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 737DA3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x629.google.com with SMTP id e9so2082298plh.2 for ; Tue, 21 Feb 2023 17:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3bJsb/pTw339jA1XICep30ZeYy6XF//4HBrHzugkwiA=; b=ZnUTawnS9ufCHl/6ey6mXU7KwLzNqhvkiJMrN5HPbPadJJ5x/hCbmg/zu4lKCZKgjI MgBmMHONRA/ybXIatn7BGb2xK7nEyb9RTw/DL6akXiFvRLiOQvujsCnP8BQuHrOgiL/d j180xmrKJk95c3sGIsD/BS8vIMBZghpq+1tbMaAJm4rG3BxrLDRsCa3VW7SgXh03w6Ha 3eKjEfBoc1fVsqJdhnHpUu+9Z9Yj+AZhF84ctSnhguVYtMvvOc0BOXrhUWeS4qoOJjve gBvqBJs2FhnhWUhUJ3gd7Y1erqEqeVcRtFYRKSKw/5ya90vl5/J5G1QaXEp7+5mtQl6v 7sLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3bJsb/pTw339jA1XICep30ZeYy6XF//4HBrHzugkwiA=; b=1uwGhdaUzZjfsAHRkwmv25k57WZaDh+yobOijdpGO39UGgUZW/m5VLX9ODngdz9iJs E3bcDtRwbLC8X+VCuQO/9HeqKNUnagiUsjg367tNwiElQp787X1FIhbXwawE4cKMHSOF tf9FSJMtZzhLCVlCXhHeII5IJU1gaaAa66VBQ+9ZPoE0EX/cvSqy824Jd5dUa3DvTr9T wGFmOqkqa1VWRgyrUll3ynHEalLscrbibMpKRAcRYQqY4n/QYPVt1k00t3pX5iicRiCL k2dXYJJOmB0SHrl/o43x7IGehujExSHm6bF8IptaaSwz23vWlRNKyRfPHjuNHVvHGe+X 5ggw== X-Gm-Message-State: AO0yUKUHkfIRmTsfmIZKGT9hGtbmV9MsgixUjpvNOzVq1AYABRHax5A3 gG5X6UEN970/xTazJP2Pm1J2B7ERZDE= X-Google-Smtp-Source: AK7set8M/5OeS3yn70w6z7OZTIPXPd2og4Sj595YUF8foVup2uFzVsJi5TXVKyiBV2xWX9lCEwQxAA== X-Received: by 2002:a17:90a:db92:b0:22c:5703:3d9f with SMTP id h18-20020a17090adb9200b0022c57033d9fmr6426854pjv.38.1677029708413; Tue, 21 Feb 2023 17:35:08 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id d6-20020a17090a2a4600b002369d39672asm3582579pjg.33.2023.02.21.17.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:35:07 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 5B3AC1142D29; Wed, 22 Feb 2023 12:05:05 +1030 (ACDT) Date: Wed, 22 Feb 2023 12:05:05 +1030 From: Alan Modra To: Andreas Schwab Cc: Alan Modra via Binutils , Paul Naidoo Subject: Re: `strip: X.so could not create temporary file to hold stripped copy: cause of error unknown` Message-ID: References: <87y1oq4kdi.fsf@igel.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y1oq4kdi.fsf@igel.home> X-Spam-Status: No, score=-3035.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Feb 22, 2023 at 01:24:57AM +0100, Andreas Schwab wrote: > On Feb 22 2023, Alan Modra via Binutils wrote: > > > On Tue, Feb 21, 2023 at 08:43:56PM +0000, Paul Naidoo wrote: > >> |strip --remove-section=.note.ABI-tag > >> /usr/lib/x86_64-linux-gnu/libQt5Core.so.5| > >> > >> However executing the command returns the error: |strip: > >> /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: could not create temporary file > >> to hold stripped copy: cause of error unknown| > > > > You don't have write access in /usr/lib/x86_64-linux-gnu/. > > I think this will improve the error message: > > diff --git a/binutils/objcopy.c b/binutils/objcopy.c > index cf830442b3c..98c567bd955 100644 > --- a/binutils/objcopy.c > +++ b/binutils/objcopy.c > @@ -4884,6 +4884,7 @@ strip_main (int argc, char *argv[]) > > if (tmpname == NULL) > { > + bfd_set_error (bfd_error_system_call); > bfd_nonfatal_message (argv[i], NULL, NULL, > _("could not create temporary file to hold stripped copy")); > status = 1; Yes, or even better: * bucomm.c (make_tempname, make_tempdir): Set bfd_error on error. diff --git a/binutils/bucomm.c b/binutils/bucomm.c index df60ce06547..c268fd3d913 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -555,6 +555,7 @@ make_tempname (const char *filename, int *ofd) if (fd == -1) { free (tmpname); + bfd_set_error (bfd_error_system_call); return NULL; } *ofd = fd; @@ -583,7 +584,10 @@ make_tempdir (const char *filename) #endif #endif if (ret == NULL) - free (tmpname); + { + free (tmpname); + bfd_set_error (bfd_error_system_call); + } return ret; } -- Alan Modra Australia Development Lab, IBM