Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp624967pxb; Thu, 14 Jan 2021 14:30:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR/SPq5A1e9ODRm0tHYkGytca9wbDgB5dwf2x+TUb7XmcjoQIh8VPnOYG8yZbZORPLFNW/ X-Received: by 2002:a17:906:44a:: with SMTP id e10mr2120977eja.265.1610663422737; Thu, 14 Jan 2021 14:30:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610663422; cv=none; d=google.com; s=arc-20160816; b=KGWZlXvFeYrb3h6rv7eRG45weJIdXzeSoYKfU6h/rjw2GKV3wsXaetb0IoNEdp3ofH 7E6lhGKr1tg+W/JxHhZ2DTofd3t0dHIqq0DRrC3hhFEeggkwYrsBWudlR6gu71Jlw3Od 7KYAhcTfBayg8+IRLDlPkB794JLakX0IhCXO5bTr0x1pCTFCa+cjGrso2AhI8DuclO/4 j0psl+L8HqJE10AxXNxFcksVkXc9h1UzuTKdFYZmVZdmAmjt9ZF8wCCNRGOGOCVMyP0q pSwpypugwLCAv6kmlDYD4c+csPU8mBuBjVOVgeWSm87VTwm8FFX47qdvmyrhW0xBT9pb aTTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LGpFlJGSVR1hP37dBeomfMm+jKU/Sspz4e2JR6Dw5mQ=; b=nT8c/nJlojFFMlrPe0eezKA1mImNGs0g+Y3BHocSzN2EYG/jna8wa98uTnpoQvJwVt aSIQZK67U1L0k0QVlL9l79dnOjn7OnbdaJSRTH/kYMyGbPCNmfCs0UndpmecvGVIutQd O/JSTTp02AcRh1i9R6F5ugLDbfujYNGIaJWutr/oEmLf7188Q4uzmzDa3HY9abgG8vz5 Cu+TBP9pWtv+BUelb7hbzTFXr9op2a4S+++XySEcggbYzFq8MnAmDja63XgfrBHlJM1v odx1hsKcKT4azrKSVfDnzsif6hQcuI9qYW1TeGnXYXDbHZB+oBl5Xg0aoVfxR1s0H/u+ zxeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HndssyqS; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg3si2748987ejc.744.2021.01.14.14.29.35; Thu, 14 Jan 2021 14:30:22 -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=@redhat.com header.s=mimecast20190719 header.b=HndssyqS; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730477AbhANW0o (ORCPT + 99 others); Thu, 14 Jan 2021 17:26:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52855 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728563AbhANW0n (ORCPT ); Thu, 14 Jan 2021 17:26:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610663117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LGpFlJGSVR1hP37dBeomfMm+jKU/Sspz4e2JR6Dw5mQ=; b=HndssyqSg759SdAdmeN2Tals1cM2F4uPW0FNL/2rJF/6+52ZLVHkaCLfXfeI24kXfn/KSz dwJoHej7kvhdQb6df9F0rnXa71/eoKaVcB2+pF/xQHuTnNEkst3DZRSlw34q7s0wqwxSKk XdL6wDGj47CBMmpg9ZKGBGgZgBeCorc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-RcD-CRHJMpmAv-h7btU2NQ-1; Thu, 14 Jan 2021 17:25:13 -0500 X-MC-Unique: RcD-CRHJMpmAv-h7btU2NQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3737801FCC; Thu, 14 Jan 2021 22:25:11 +0000 (UTC) Received: from treble.redhat.com (ovpn-120-156.rdu2.redhat.com [10.10.120.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08F1619C45; Thu, 14 Jan 2021 22:25:09 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Nick Desaulniers , Peter Zijlstra , Miroslav Benes , Nathan Chancellor Subject: [PATCH] objtool: Don't fail on missing symbol table Date: Thu, 14 Jan 2021 16:24:15 -0600 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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