From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF08EC7618F for ; Thu, 18 Jul 2019 01:37:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E28D21019 for ; Thu, 18 Jul 2019 01:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388845AbfGRBhd (ORCPT ); Wed, 17 Jul 2019 21:37:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387683AbfGRBh2 (ORCPT ); Wed, 17 Jul 2019 21:37:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58E3A8667D; Thu, 18 Jul 2019 01:37:28 +0000 (UTC) Received: from treble.redhat.com (ovpn-122-211.rdu2.redhat.com [10.10.122.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CA505D9CC; Thu, 18 Jul 2019 01:37:27 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , Nick Desaulniers , Arnd Bergmann , Jann Horn , Randy Dunlap Subject: [PATCH v2 14/22] objtool: Warn on zero-length functions Date: Wed, 17 Jul 2019 20:36:49 -0500 Message-Id: <03d429c4fa87829c61c5dc0e89652f4d9efb62f1.1563413318.git.jpoimboe@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 18 Jul 2019 01:37:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All callable functions should have an ELF size. Signed-off-by: Josh Poimboeuf Acked-by: Peter Zijlstra (Intel) Tested-by: Nick Desaulniers --- tools/objtool/check.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 9bf4844d9226..16454cbca679 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2357,6 +2357,12 @@ static int validate_functions(struct objtool_file *file) if (func->type != STT_FUNC) continue; + if (!func->len) { + WARN("%s() is missing an ELF size annotation", + func->name); + warnings++; + } + if (func->pfunc != func || func->alias != func) continue; -- 2.20.1