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=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 C1363C433DB for ; Fri, 22 Jan 2021 13:54:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B72922D57 for ; Fri, 22 Jan 2021 13:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728054AbhAVNyr (ORCPT ); Fri, 22 Jan 2021 08:54:47 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:54304 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727896AbhAVNyn (ORCPT ); Fri, 22 Jan 2021 08:54:43 -0500 Date: Fri, 22 Jan 2021 13:53:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1611323640; 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; bh=RnxhB8ONGz0zpdWFDHgiUNcqqyRyHOR1I0JMIRvOpVE=; b=feH4g8w59hKzp0IDOApIV17Gq2aLyeIxNod+bID09iVGlt2O3tWLDFPnU6fhDcL0l6ax4p UGJI+qkbvsaCTxNVnS6fqZc+j5vEh61YRfDlF3CCWlr1vBwuQSshO48YiFsakSAT01tXFT Gsh+ujhk3RZFnno2BYluOnTr/T5g/6ANxbloS8Y33Afk/bE0b9aeCACOa74xnFUkGren2z fhU2oWWT4nm/sNxWFtsVgh8S4Hz5wIE83YTpXUIL/bnSWOO9xkGjnesuvImrDG7dmVSd/p Xb5RNRsesZIybUta7AY3gP5rLDlWzdR9iACpWY854ZSPpfdUS6saXGvzaetK6w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1611323640; 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; bh=RnxhB8ONGz0zpdWFDHgiUNcqqyRyHOR1I0JMIRvOpVE=; b=x+pt40GlFZ3BmmHtkKrblZVn0vRwls39Ij/xVVwwgclD+YDBcSOSkkQFx93vNrlBc4sEiJ h2vVW6CDLYW7KZAw== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/urgent] objtool: Don't fail on missing symbol table Cc: Nathan Chancellor , Miroslav Benes , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <161132363950.414.18137582178365260536.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 1d489151e9f9d1647110277ff77282fe4d96d09b Gitweb: https://git.kernel.org/tip/1d489151e9f9d1647110277ff77282fe4d96d09b Author: Josh Poimboeuf AuthorDate: Thu, 14 Jan 2021 16:14:01 -06:00 Committer: Josh Poimboeuf CommitterDate: Thu, 21 Jan 2021 15:49:58 -06:00 objtool: Don't fail on missing symbol table Thanks to a recent binutils change which doesn't generate unused symbols, it's now possible for thunk_64.o be completely empty without CONFIG_PREEMPTION: no text, no data, no symbols. We could edit the Makefile to only build that file when CONFIG_PREEMPTION is enabled, but that will likely create confusion if/when the thunks end up getting used by some other code again. Just ignore it and move on. Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Reviewed-by: Miroslav Benes Tested-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/1254 Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index f9682db..d8421e1 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf) symtab = find_section_by_name(elf, ".symtab"); if (!symtab) { - WARN("missing symbol table"); - return -1; + /* + * A missing symbol table is actually possible if it's an empty + * .o file. This can happen for thunk_64.o. + */ + return 0; } symtab_shndx = find_section_by_name(elf, ".symtab_shndx");