Message ID | 167328367772.4906.2873693536526803314.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2269159wrt; Mon, 9 Jan 2023 09:06:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXtew4XGeoKSZRaxAu1BGWuY0rAfq6gqk3MFi2DlYczcPDqSXTfz5XDj4Z3aUdDomvvbv3Oy X-Received: by 2002:a17:907:86aa:b0:7c0:aea2:e910 with SMTP id qa42-20020a17090786aa00b007c0aea2e910mr90177115ejc.3.1673283967770; Mon, 09 Jan 2023 09:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673283967; cv=none; d=google.com; s=arc-20160816; b=JcMJDnmGlYZwtkvPKRuyHPyP93SIacGcXZEBNMUkQ/3oE4BIziWhEhthFmtakEeWek 0TIignjY5FXXtBI6psE4qR2gqNRMUtsysUjQrosoytQhrZYKTeg3DCurrvQAEp1l4AFJ FDQeYmH/Q1U0xiunL/3TckxVIJF6eHprYj+yNTP19RXy0JpRufWHdebFnGMJThXmyhZX Tq+oS8WzNeIOwojy9L4ri5YAGGiV+PpJCIeRA/YHJQBdwUTnxt+UevPBOJEg7OZzi0Xt Jz9enZmpfDV1jUNRPa7jKN8gJvO9r1vH37z0gnB7jzHtrqK6GJk5wHdY+PFJ7srTC9pY Xdhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=MmTEpx1rglD7bjrUm/jwfOColHcEYONm70QHf3GenQE=; b=rZb1qiwflsIoMesPOuziiHQC21EwXT7rIW4OjlePB04OAojR+t7FoQ3R/y/LbMeTYX /+EvRLYoyqutPlq6Wi1T2e+Ft6O4tJFIOwMQS9XH629f+giGOzbqAa2vnBoOGwm4UGFF t7OFPh8a19l7YqZdHmrxrYIHUEuTa7Fc5U298lQbOxB3x0CprPVN9sNFLEIJhXJrMyjT WiYpFcqdiynoUsHUF6+HTLv2jCkxjcifmNiO4NFkC2YUAind5+99DrADae43Qx0TOoMT MEveOqrucwcAKyoJNS0mGj6G8AgtdoEHoJMgLK0dAy8EJVyc6tWSZeiuLght95LF69of fcUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DCj6r5ws; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt10-20020a170907728a00b00783e7d72fc0si9164889ejc.272.2023.01.09.09.05.44; Mon, 09 Jan 2023 09:06:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DCj6r5ws; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235181AbjAIRCB (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Mon, 9 Jan 2023 12:02:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236688AbjAIRBr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Jan 2023 12:01:47 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E89E93DBD6; Mon, 9 Jan 2023 09:01:20 -0800 (PST) Date: Mon, 09 Jan 2023 17:01:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673283678; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MmTEpx1rglD7bjrUm/jwfOColHcEYONm70QHf3GenQE=; b=DCj6r5wsypfJH6WwaMxb2hEk3kB6Ef0xX/aFxrjpDXZBUSIDgjD0YGX0+vHQ9FThTIEE46 1Hz3RxBFTpcZ6c4W6YZWRGPzsIept9hmT/ZAN2tFKcCyEBFV8ibsvZq9lC8DGWUnGwSAaq 9Zk91fyoFTo3S3gRA4KbHS9FzjBn85ZAEF/JLkb8M/do+WM4OOC6exg9lO13U5NUrg3njA 6aaIE8j+N4kvcJxUM9AXgWYqOU3daAmIBsIUcuu6SmkDs5lh01UxFOapM6wEE6etsRvEgE XjnG+VPbc8pt7CQ7P4w+KgMvX+HJiUmaWO4M97HsustiKe0AzXvJwv3cSsYqzQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673283678; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MmTEpx1rglD7bjrUm/jwfOColHcEYONm70QHf3GenQE=; b=W/tVs/DyFQosdn+X9LEpr5YOUqiwQWGNiZ8uZrpirBKCR9M1y2mY7uTE4cQZUHgBkzsiYh qKTk9F1cFSPH98DQ== From: "tip-bot2 for Nicholas Piggin" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/urgent] objtool: Tolerate STT_NOTYPE symbols at end of section Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>, Sathvika Vasireddy <sv@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, Ingo Molnar <mingo@kernel.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221220101323.3119939-1-npiggin@gmail.com> References: <20221220101323.3119939-1-npiggin@gmail.com> MIME-Version: 1.0 Message-ID: <167328367772.4906.2873693536526803314.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754565409712766283?= X-GMAIL-MSGID: =?utf-8?q?1754565409712766283?= |
Series |
[tip:,core/urgent] objtool: Tolerate STT_NOTYPE symbols at end of section
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Jan. 9, 2023, 5:01 p.m. UTC
The following commit has been merged into the core/urgent branch of tip: Commit-ID: cad90e5381d840cf2296aaac9b3eff71a30b7c5b Gitweb: https://git.kernel.org/tip/cad90e5381d840cf2296aaac9b3eff71a30b7c5b Author: Nicholas Piggin <npiggin@gmail.com> AuthorDate: Tue, 20 Dec 2022 20:13:23 +10:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Mon, 09 Jan 2023 17:53:46 +01:00 objtool: Tolerate STT_NOTYPE symbols at end of section Hand-written asm often contains non-function symbols in executable sections. _end symbols for finding the size of instruction blocks for runtime processing is one such usage. optprobe_template_end is one example that causes the warning: objtool: optprobe_template_end(): can't find starting instruction This is because the symbol happens to be at the end of the file (and therefore end of a section in the object file). So ignore end-of-section STT_NOTYPE symbols instead of bailing out because an instruction can't be found. While we're here, add a more descriptive warning for STT_FUNC symbols found at the end of a section. [ This also solves a PowerPC regression reported by Sathvika Vasireddy. ] Reported-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reported-by: Sathvika Vasireddy <sv@linux.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Sathvika Vasireddy <sv@linux.ibm.com> Link: https://lore.kernel.org/r/20221220101323.3119939-1-npiggin@gmail.com --- tools/objtool/check.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4350be7..4b7c8b3 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -427,6 +427,15 @@ static int decode_instructions(struct objtool_file *file) if (func->type != STT_NOTYPE && func->type != STT_FUNC) continue; + if (func->offset == sec->sh.sh_size) { + /* Heuristic: likely an "end" symbol */ + if (func->type == STT_NOTYPE) + continue; + WARN("%s(): STT_FUNC at end of section", + func->name); + return -1; + } + if (func->return_thunk || func->alias != func) continue;