From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227Z3LrxnxPY8WrzpuhsthVRMrhMrsARKt/Jt6nCnMK9KNiScRs8Y2esc7vMV2OHBTSxahVX ARC-Seal: i=1; a=rsa-sha256; t=1516610881; cv=none; d=google.com; s=arc-20160816; b=waUtgf4NvPr72JsOTXX9GmpgIYeeubHwLyhbB1sDLlMwOvnkrXAgksunYrDHv2WDAx uvuFlalnqfmWSeURyKhAzqwlBhxWEo/UE0Qzqo7duf7P+5h+nKeT6hvrY4GKphCVTXmc 92+BSRBFLsng4WL5ywucx+rlVkkSo8xKihEWMptk6RCXazJtHYEgcYa9EmtZOQBLVKJ9 4S7NtVuv5aqJ5KZOQ9MW1GfG24NYTV0JfTsYsGajzKI6S7pTIeYpn8bJbYhaibfbW820 NzQrrHWzIhy0kcwZjdvIY4fJofGnAsla+cwlW98AubuyIZzwk6u1aDCiA2dEelZtHkq/ YNpQ== 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=8ozmGZiz+qnY6p5p9rhSOpr61vVcFbgcazagAvtL5sw=; b=lqBp06bBSAAKvOU8cUQGSdnyESUhhFpCo5GXQl992UZvnYomXFDISteli8bSGcaJa9 OBMSQ+Of4GV0AFWSv1GrvknxkzW0C9ccjEla2MxivZCv4h4dBMMhJSKHF7V3p68J9hTf ZxJx35605N28IaofCxMyECQNjjLRtLFPSlWbTZL6Z0sCg4yNmPu6/qth024g/Gfzj/2+ jHum03r9nUJu64OycsMaE4k24yhAm6o0vncTScKtSxcb2lBbCph+6q7QVo+YZM19Y/oj aaBXITh+wMvxBbROjh0mD/hvSVQc8PDxY1l7Logu71tEtJfnNM7GsBzqMyIEuzsxmgcz FbCw== 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.9 16/47] objtool: Improve error message for bad file argument Date: Mon, 22 Jan 2018 09:45:27 +0100 Message-Id: <20180122083926.732068365@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@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?1590281772198492773?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-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" @@ -370,7 +371,8 @@ struct elf *elf_open(const char *name) elf->fd = open(name, O_RDONLY); if (elf->fd == -1) { - perror("open"); + fprintf(stderr, "objtool: Can't open '%s': %s\n", + name, strerror(errno)); goto err; }