Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp627863pxb; Thu, 14 Jan 2021 14:35:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/CLwaGWqKvtvzJfapiG55g9EVnB/mdnyp0Wo5zJEL8SwaHv7TVSkTVDkTce/+txPF/vj3 X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr6734236ejw.88.1610663755010; Thu, 14 Jan 2021 14:35:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610663755; cv=none; d=google.com; s=arc-20160816; b=gx+TjsZDn/Z+qTObOHwjrDePNE6o5harsP/Jl3mYEtaXzrpv29eUg6FVMtAnrKuFfu SZcGcvK1SThLpCFF7xnau2hdVczI7xtR5Jan+1sqlfIJABT6IwpJoUWR/E0WOa4EKTbB XRq4sV0Z5N5+dAWR0KX1QNmMEwqcCwSlTL4z9ERd4+3SDvxRvb1Tw3drliG8Za3mdv9H QeRG78xUInCnb9iql/PxuVo+wPRC2GCccFMKbUiO0il3xbv/6huetcJ6lJREvk7QoYCX 4wmyZAbm9J/p3F2ZgqeTghqZnB+PjJTT75FlxENJgNxhFER2OueOdXXhUFTAzVc/OqWX CQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QOaxopk0Vt0c18C4pnEsewzOIIMzXpSpyDsCoJ7fsp8=; b=zl/1KSMisDG3n63iJcx4+aBsQ9L4K2QerPgaJj0n0kDONw0SCTnuTAdEcI+ScrHSLP 4KEO+EOCOe13aVs7RoD0iQueqh9sURTdGmJfEHTyhhBP39ODR3KfczrvCqPp1Mpm7nMu rxjIT6GfHpdqQLFsS0J5D5ydpBh+F01N5hFG3dV8Ibway3qK+5bmsfRrbx+RwC4QhPH6 6cmVzleYeBVxlBamOjV7/dzAT6Tk6v+ye2kZfhSNu0l8TSUpTffoZroD+jc1buINWdln w2pjNLgzsa+0ur/Fu6OvM5Ge07G+CIW9muPoRf1DEJhy7ZRuN4lrRPfhtDUNgySs5Wdq NDVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q8oWVjd1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si3318179edq.449.2021.01.14.14.35.30; Thu, 14 Jan 2021 14:35:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q8oWVjd1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730702AbhANWcs (ORCPT + 99 others); Thu, 14 Jan 2021 17:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbhANWcr (ORCPT ); Thu, 14 Jan 2021 17:32:47 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 305F6C061575 for ; Thu, 14 Jan 2021 14:32:07 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id 2so4755436qtt.10 for ; Thu, 14 Jan 2021 14:32:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QOaxopk0Vt0c18C4pnEsewzOIIMzXpSpyDsCoJ7fsp8=; b=q8oWVjd1InoXRxycK2EAtoJD3bQPVAxcd3GoFRwpJn0sE/nyS67uW0rt9eyjm8vBAF gZ7/JTJbdSWcSDBeCTxvFDSHrAff1sI/VytZOwveMZ+T4K05m/JlniBUbiO5ZYhNSO14 tyb9Fs2TBXrDqa5sNsU+n7S9+X4ysUN5hFn0k/FSoW29mAW2j5kRA9wfc/zvhjH7Gjx+ PbxiyJgwHczWiCFKM5MGgXxk8HZqqBn853vIAwBDXS0r4HrRtuPsvdoPDt+SoqvZ9soH 874OqqatQIErXiOG4PfOh0Gxl7k6ynPKcnDgJHncg2hgT6qmNuDEGVGunZr8R00IukxV iilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QOaxopk0Vt0c18C4pnEsewzOIIMzXpSpyDsCoJ7fsp8=; b=Ceg2Rm2o9HZghv84Gtv2IT0ycDLxUIbGoQ41WltzWjlkfTiI57Pcil+v9B+w2XDAeh Hi36KyNDovE2qeVdd2dFp9YRWiFpXiltUd3JT63OHfN060PQwEaA1BJEOLAD8V+uLQNN SikDpijL91zBFl2LHxcqRpMkeoagwaB5g8aADc/e6UAtr//PckoPpa2tiBNo1OyIv7Uf PhibVEnhh9Ay9cXkd8R3BvSLC9OMaSXxY5p1hJlppBqbl6J2oZFSEjSqcc68Vxc6QZXH 9LvDW6cpYI0VgNA8ZSXu98mI0CzD7TNxLFh2xH0xN2vZen99Sr6l0rhreBoU8IZA34mk yzMA== X-Gm-Message-State: AOAM532d16bH9XtTA3rTbbFR3az8g3eti4JW6hd4y3tDkyV8iCkk71DR 2o68AuT1EnHaWn1bVHy51G6L7Mm2ERg= X-Received: by 2002:ac8:b07:: with SMTP id e7mr9295700qti.311.1610663526257; Thu, 14 Jan 2021 14:32:06 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id 195sm3875947qke.108.2021.01.14.14.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 14:32:05 -0800 (PST) Date: Thu, 14 Jan 2021 15:32:04 -0700 From: Nathan Chancellor To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Peter Zijlstra , Miroslav Benes Subject: Re: [PATCH] objtool: Don't fail on missing symbol table Message-ID: <20210114223204.GA1984019@ubuntu-m3-large-x86> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 04:24:15PM -0600, Josh Poimboeuf wrote: > Thanks to a recent binutils change which doesn't generate unused > symbols, it's now possible for thunk_64.o be completely empty with > 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 > Signed-off-by: Josh Poimboeuf Thanks for the quick fix! Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Is it worth a cc to stable given that I hit this in 5.4? I suppose it is not super critical now but it seems like someone might eventually hit this as times goes on and binutils 2.37 becomes more common. > --- > 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 be89c741ba9a..2b0f4f52f7b5 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"); > -- > 2.29.2 >