From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EDE232C301 for ; Tue, 25 Nov 2025 18:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764094568; cv=none; b=Q5kMzIJz6YP9O2b5U5bThD0qpO1gDNKPVlzvYMsOOuRn1bli6mLtrGKplWj1YAojUhw1SaC8hWEjLZdd8mxfFcX99YKwX313UdSawKbfDWwrvbuJ+0VP26A5pmPaPSLy+hh022a870B/9DyOFIeFoX4uJwsaJiTyCeAiRmXKImE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764094568; c=relaxed/simple; bh=cZURNWn417tuFwVqUw9TepzjxG4JaJLAwUlqFHdN7bs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l/68q9y6CWhqxFN0nwETtiP6mi96okbnJJUmloqHYyFZAlSHLHjcjkWeR7R+Nt0Lk+zFd0xaN0Bhre7+ht2t4LILTHSKGtIUw8QRTnY34B6tlJKnqhvNmkBMY9l0XoIEhM8tc/VtIKLX6BEcq1j6iTyfkplo39O+El+p3859gdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mS3oqQE0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mS3oqQE0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AB53C116B1; Tue, 25 Nov 2025 18:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764094568; bh=cZURNWn417tuFwVqUw9TepzjxG4JaJLAwUlqFHdN7bs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mS3oqQE05YKat3bQLRNi/PN8KZwwo73RXEvABOR+AqB+kbvuKtb1+UHDAmbEeQA2z NWGZE2Yo3FhHcgynNst1VjKuZJvZFan7lTwS6iV5lbAThx0QK+r0UMHs5JewnaDzZW H+4Xgf/UjPopUor3l0lFHuH+2Zd22F3S3VrNNdxvuwWW6YxcpZRAArRixJhSGAcGXb UM2mxliTiCtjsECmFClwp/JJ1XoML+5ZRmcEO1trBqz7tkfSP71UwegqZ+L1WxWAnZ 5rUk0hpqTUsYvPiPVBTqFtaxOvYzSHYhZIWf0aYzjS7LxWPcELVzOk6GKQo+4JcmsT x9BvpPTg2JDjw== Date: Tue, 25 Nov 2025 11:16:04 -0700 From: Nathan Chancellor To: Alexandre Chartre Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, david.laight.linux@gmail.com Subject: Re: [PATCH v6 03/30] objtool: Disassemble code with libopcodes instead of running objdump Message-ID: <20251125181604.GA3595606@ax162> References: <20251121095340.464045-1-alexandre.chartre@oracle.com> <20251121095340.464045-4-alexandre.chartre@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251121095340.464045-4-alexandre.chartre@oracle.com> Hi Alexandre, On Fri, Nov 21, 2025 at 10:53:13AM +0100, Alexandre Chartre wrote: > objtool executes the objdump command to disassemble code. Use libopcodes > instead to have more control about the disassembly scope and output. > If libopcodes is not present then objtool is built without disassembly > support. > > Signed-off-by: Alexandre Chartre ... > diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h > index d89f8b5ec14e3..18c0e69ee6170 100644 > --- a/tools/objtool/include/objtool/arch.h > +++ b/tools/objtool/include/objtool/arch.h > @@ -103,4 +103,13 @@ bool arch_absolute_reloc(struct elf *elf, struct reloc *reloc); > unsigned int arch_reloc_size(struct reloc *reloc); > unsigned long arch_jump_table_sym_offset(struct reloc *reloc, struct reloc *table); > > +#ifdef DISAS > + > +#include This include of bfd.h breaks the build for me: $ make -skj"$(nproc)" ARCH=x86_64 CROSS_COMPILE=x86_64-linux- clean defconfig bzImage In file included from tools/objtool/include/objtool/arch.h:108, from check.c:14: /usr/include/bfd.h:35:2: error: #error config.h must be included before this header 35 | #error config.h must be included before this header | ^~~~~ ... where my bfd.h has: #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ /* PR 14072: Ensure that config.h is included first. */ #if !defined PACKAGE && !defined PACKAGE_VERSION #error config.h must be included before this header #endif Something like this cures it for me but I am not sure if that is a proper fix or not since I see config.h in my binutils build folder has many other defines. Cheers, Nathan diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index df793ca6fc1a..96df4a73da23 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -87,7 +87,7 @@ BUILD_DISAS := n ifeq ($(feature-libbfd),1) BUILD_DISAS := y - OBJTOOL_CFLAGS += -DDISAS + OBJTOOL_CFLAGS += -DDISAS -DPACKAGE="objtool-disas" OBJTOOL_LDFLAGS += -lopcodes endif