From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2263WDndVZG3gNt2qrIxFxAUN1YZKzqMXMqP7hO++dkKhc2BH2LYxUfzZHRZFO20DOv5RwJv ARC-Seal: i=1; a=rsa-sha256; t=1516611098; cv=none; d=google.com; s=arc-20160816; b=hzqAEJ9LwUOYf2+fUBMyK9AQLtX1i18L1w7QIQ6Yp1HjbNhxDKV5p2qSTYZI2RA8pR hMKo2KaLSXP6Enx/oDvUlqeid6m+Qt4C3wEbOwYt20IMZ39BZ9qevS9T5Ap+zZpZpfiV HjQXmQRtMTVaPeFn3PDFeDspqgvjMgdrbvY2DgBFU8HjjqiXhpIAmxNPqv7dF4zOmCUm Lyh7R2hvHnfCfsOnkpADjisyqwdgQSqWN/xnnSZJTcUsim9bOSvIp/Ma6qfV1RTX62PM sf1tDOTxqIQvtA6nknr5UKojYbOlOkXCdDz+Xr8vsQYdGFjlMF/kYA1BrMwQR2kDSsnC 1n1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XY9t7WQZZn1SrqQebnItZeyimfq7Hm532ZV507+TBEg=; b=NzTkl9cb25QKr9lprjICtZEaoW86Zas73Z3p3dF3iEYH9CS6eP9XQxnvAbzxim+ZTN OOYo9MUw4oESC/dvLo8rBFyGvsmUxTdOz0gVPHuapYgfWkysuVdpvAeA+heM7ALeWYRk 6Ozr6/jkQ9A7wDq4oMjZjcqzxkB8ljU+gqsqrZFFNdnEUegLu1UnCg4VEjm/RzBAgKMv Y2CTtkk8GZdak3R8povKW6t50peHB+WXzCHEvteldnfl4nspRpGF8nS0fRaXqoI+MSkx MFasSQS2uTggjf/K0SHgKthXm8Rvd4Qj0FRBFw4koL49G19st4f0A+d5VEI+Zfl+P5Oh mqUw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Markus , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.14 34/89] objtool: Improve error message for bad file argument Date: Mon, 22 Jan 2018 09:45:14 +0100 Message-Id: <20180122083958.060956365@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281772198492773?= X-GMAIL-MSGID: =?utf-8?q?1590281998939498658?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Poimboeuf commit 385d11b152c4eb638eeb769edcb3249533bb9a00 upstream. If a nonexistent file is supplied to objtool, it complains with a non-helpful error: open: No such file or directory Improve it to: objtool: Can't open 'foo': No such file or directory Reported-by: Markus Signed-off-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/406a3d00a21225eee2819844048e17f68523ccf6.1516025651.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/objtool/elf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "elf.h" #include "warn.h" @@ -358,7 +359,8 @@ struct elf *elf_open(const char *name, i elf->fd = open(name, flags); if (elf->fd == -1) { - perror("open"); + fprintf(stderr, "objtool: Can't open '%s': %s\n", + name, strerror(errno)); goto err; }