Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2298051pxb; Fri, 5 Feb 2021 14:14:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFs5w6q1wfehQY+HoqDr9yNOJs7ckjwcFlgeEOucPWKJSJY1aq3t28QBrTuLIlnd0oPmYJ X-Received: by 2002:a05:6402:27cd:: with SMTP id c13mr5615644ede.263.1612563293495; Fri, 05 Feb 2021 14:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612563293; cv=none; d=google.com; s=arc-20160816; b=pv7ZeNo++vfkZxa/glzBuHtoSnOs7V6Ou9ajdth6LSs/KJqzzZcdEqj6hIsYjlrDZr mlutjiCbYE7zw7aZGxv7E3D2LeCFXcHEMjaefKFnGoDJZLRJH15dqVyxo5nOwcuYMCe1 3WDNaikjRo5Lap6I+asqaLFN9HKOcZbl8C2fcYzyKKc0qLZQFqhyNAbGq/hQUzrzW7yL X7nwIAsUKg+hGy9a7n2yzmIl+edhsNDgruGt0eQM1KlmQSBWVVNq4jwGX+UuNuhlq//j OUmW+nH+wOUw0jCO43SZhZ/lgJU66vnKEhu9CLGn8U+j6Drp2wpwndKBMau37VvaXZUH Eyfg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pVnHwMf0URzUTj05VqDFGKdWLCT8xkVkESZvZ9Ow8ZU=; b=Y/WwKt732BGjSL+7q/E0gA4KaUALIJywBTZCIsESTVQ1AWDMpPId0KN4dEagXyUHYN Xr+sjakNrQX1LrOhxzUsWpMXt7qlpoYe4EeSka5hhZEbosbEvSgZZEra4mdtfSVcfVD8 mj8cnXmS+eEwwTktXdqZTyCkRcO3E68T/ZNajWZ5d2RJh4WDIjB+gFVCwQl3lu0iaJiJ +QxhC14Hgciuh+W8uS62G5zX+TDmsrV9Q/fX/EoGAlF2WJUeD08LXH/bJQWV/CUvKEi0 MVpFhZYEC0ddQtEkggFNVe2f3gFGhtmx4TDhqlhKBfQgeQkRpIJaAPTDHw/oiQ7ZfP42 pQ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZlCcYlz; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si2840453ejb.502.2021.02.05.14.14.29; Fri, 05 Feb 2021 14:14:53 -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=@linuxfoundation.org header.s=korg header.b=2ZlCcYlz; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232935AbhBEWMZ (ORCPT + 99 others); Fri, 5 Feb 2021 17:12:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:45252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232941AbhBEO5X (ORCPT ); Fri, 5 Feb 2021 09:57:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 41364650B7; Fri, 5 Feb 2021 14:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534475; bh=C8ZbliidtWdLrQu2YqsKNvIB9f+KJX3XYeJa+/oUWqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZlCcYlznZ+cvXOJpS3/mzjJT5/oAJVVYgjF0iQLA6KYc0aU6uJMHpzZMcYG4D6Vz NKQ9AlYfKQIrzPO7+AscSzCxaVhD7Y5Zv3bb4bV2ksl3JgObpq4lF9bFmKwet+BUiC x/3H85EbdptlOSq6VCsZLz6zWDsk17bDJesJYbS0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Miroslav Benes , Josh Poimboeuf , Sasha Levin Subject: [PATCH 4.14 14/15] objtool: Dont fail on missing symbol table Date: Fri, 5 Feb 2021 15:08:59 +0100 Message-Id: <20210205140650.308445732@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140649.733510103@linuxfoundation.org> References: <20210205140649.733510103@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf [ Upstream commit 1d489151e9f9d1647110277ff77282fe4d96d09b ] 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 Signed-off-by: Sasha Levin --- 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 d089c711355a9..fa269622a974e 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -226,8 +226,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; } symbols_nr = symtab->sh.sh_size / symtab->sh.sh_entsize; -- 2.27.0