Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp294858pxb; Fri, 15 Jan 2021 03:33:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxslkNzUSYktfcKzb+thEaqA5W73Js9X22L6StsjO1ALKLRLA0vlHhVJIZTWSwDHJnPGjlI X-Received: by 2002:aa7:c1d2:: with SMTP id d18mr9125380edp.261.1610710423784; Fri, 15 Jan 2021 03:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610710423; cv=none; d=google.com; s=arc-20160816; b=iNsWWpxSUu0sbFSuwxO7O8Ei1gJ5YNL60PGL/vy+lju+PyJvWEUK87ntkHuoJXFqtt lzHuwNJIHVd24kvTgZLIlLUVIX2fiW0jzaze5dcK9Iih0Gqa4l/YjX/Ya0tW490ILmDl 2irRE1mKAivddyPvFeaJGX+7HRSWSojJXMOUkLFjyDiUNFtwKex2iljgLPgUl1b0crU8 YbJ44e3BvA/oYBwLo8AJT0QmqHgPBPhSTqX0IIJay3pN0QIRUeD+RR39ZJIxtTgnRwgH p6OWTeri0o2T0FJbe7iJFk8vMpt+yi5hgW7f63gkmccbH4KzHElRB4DHirUFGq1vGvAh /zKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=jTNaYwe4lRdHGY4mcAebZbqdoMVwkJtRzybHW6CdiCU=; b=g4lv57bccWirHrWCFG12rkR80BFTkgMawGWA9+U7FcmVM7x0OxBsv8i9rYWuNbzXpo fTHwPByDVUZ2hwwsjQ9RLdvNf1BKmEblObUSZDhaR6DPKFq1FAakd0Ox/hj9xaC03BBL xIgp3q9isEA9mjzqdIJyau3+7h+RixRtYdGOWhPlbBV0YNd8TJP72l6OyoafYHPMjOEb +KQfzmW5bL7XW/Vnk2QfatymPuDD7UE1h/62xPv1VfCmRVlOdWJGg8ITAnJG605MLJOr 4/5dan8pYxaGRPjMqT2sZuNgg6n4h/+2jRO2xiFae07cbxsGTDHayRTfm4OKpPPCRa/U xdWA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si4027348ejx.27.2021.01.15.03.33.19; Fri, 15 Jan 2021 03:33:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727330AbhAOLcI (ORCPT + 99 others); Fri, 15 Jan 2021 06:32:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:35152 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbhAOLcI (ORCPT ); Fri, 15 Jan 2021 06:32:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EF8CAACB0; Fri, 15 Jan 2021 11:31:26 +0000 (UTC) Date: Fri, 15 Jan 2021 12:31:26 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: x86@kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Peter Zijlstra , Nathan Chancellor Subject: Re: [PATCH] objtool: Don't fail on missing symbol table In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Jan 2021, 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. "without CONFIG_PREEMPTION", or did I misunderstand? > 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 Reviewed-by: Miroslav Benes with the note below. > --- > 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; > } We rely on .symtab presence elsewhere in the code. See elf_create_{rel,rela}_reloc_section(). However, there should never be a problem. If there is a need to create a new reloc section (either for a static call site, or ORC), there should always be a symbol to create it for (or because of it). Miroslav