Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5423973rwl; Wed, 28 Dec 2022 19:15:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXuvna1sWhaxV/UXF/KSIYUVIR4M2xY4Gdfg/sAzftatj5CTnmiX85q1aKCivgeLK6Z3bPCW X-Received: by 2002:a17:906:c192:b0:7c1:6fe:f4a2 with SMTP id g18-20020a170906c19200b007c106fef4a2mr22830518ejz.45.1672283737683; Wed, 28 Dec 2022 19:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672283737; cv=none; d=google.com; s=arc-20160816; b=Qj3DkFwpPgiz4DCShAowq1S+bfWq3xbZYZQAbSazFHaChUDG9Mg+v8CU1Yxu+O7MWI 3CyhT+nt66E83nEw9ln4/Bp54VwNxgqIdv7mOH1zgkTxKKLp8msM8l2BFdK3Sti7/SAg DBQn4/AyhM0AbieA/IqnIjmebqsD77sc11uVFb8JB/dYGxuxlK1jFR4bvMpNBuSXAC2H NFHzB5u7T+smXlYMNcqjlgFlkQSgzKtvQKim2npukGpc9+1KkH2SgyBRLfBA7EzMQiOo zHU5YybTnPGScEdTGzZkw5jnlFqx6H29pbaT2FS7+0oPJhWXGvSeHQREcwBUTWJsKL2f rvyQ== 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:dkim-signature:date; bh=W2y5Q0MidV2pB06RrMsTqoN2pUTODXKXYUYVjWNZyxk=; b=RzdipEVlx5p708Z8dlkOsvEs46HywJEZN772xS9Mn6GZAZ29yp6RBvt9yy1b/7AK92 enKtiuCSKacJ+EZHrYDWCzKemi6UPyT+BYO2Iif8287GlGyzvuiDm3CfuxhSkLmZPAzW 5YR7ZjzTKK3OGTbgEjOljaS08PwzmzHnLQLh9bcfMLa76KdnRCPlMrIayi9IBTu1tIRe aFzACHmJAqSWC6ncAVjjO40rSV61ekOTaPA4kcggvEXh5RJHwxMSqnEFrTjLhWKbkdwy X/nu8YuJSCqTFXSXsYXOpHzLbjxmp6dOARWr1QnYpz3DsU2Nhi2Zcj0tnis2fhYSNAI5 a6Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@t-8ch.de header.s=mail header.b=myggsIwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a1709063c4600b007cde24a85f5si11304497ejg.978.2022.12.28.19.15.21; Wed, 28 Dec 2022 19:15:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@t-8ch.de header.s=mail header.b=myggsIwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232613AbiL2C0i (ORCPT + 62 others); Wed, 28 Dec 2022 21:26:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbiL2C02 (ORCPT ); Wed, 28 Dec 2022 21:26:28 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6392112084 for ; Wed, 28 Dec 2022 18:26:27 -0800 (PST) Date: Thu, 29 Dec 2022 02:26:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=t-8ch.de; s=mail; t=1672280785; bh=ma/Nzifri2/2lcnUbcJQtDKR1prjLqpoLwiGi4kse+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=myggsIwD29wKaSzJi6/sb8Xw+bbmVxz3MLtgPg5fSSe1+I+h6J7PXpXpE5pClRZWV /f6wZQb2pW4TufWovV6AZ9KHILzJSSgGLnOtuVOm9tosf1rk9nsAvdbtb7YYXDzoYa l1cdGWdAxSkImXaXF50y8u4Sjotob/HurNR9l1cM= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Rong Tao Cc: linux@weissschuh.net, jpoimboe@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org Subject: Re: [PATCH v2 5/8] objtool: reduce memory usage of struct reloc Message-ID: <20221229022622.khboqwfe23e7u2en@snowball.t-8ch.de> References: <20221216-objtool-memory-v2-5-17968f85a464@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rong, On Thu, Dec 29, 2022 at 09:33:32AM +0800, Rong Tao wrote: > Is this likely to cause most RELOC failures? As shown in the following > example: > > #include > #include > > int main(void) > { > printf("%d\n", BFD_RELOC_S12Z_OPR); > return 0; > } > > The BFD_RELOC_S12Z_OPR equal to 2366. I'm not familiar with libbfd, so please correct me if I'm wrong. To me BFD_RELOC_S12Z_OPR looks like a value that is only used by libbfd. objtool does not use libbfd. The only values that objtools should see for the relocation types are the R_* constants from elf.h as they are used by the compiler and linker in the raw elf binary files. These never exceed the value 255, one byte. Indeed they seem to have been explicitly chosen like this. $ grep 'define R_.*NUM' /usr/include/elf.h #define R_68K_NUM 43 #define R_386_NUM 44 #define R_SPARC_NUM 253 #define R_MIPS_NUM 128 #define R_ALPHA_NUM 46 #define R_ARM_NUM 256 #define R_390_NUM 62 #define R_CRIS_NUM 20 #define R_X86_64_NUM 43 #define R_MN10300_NUM 35 #define R_M32R_NUM 256 /* Keep this the last entry. */ #define R_TILEPRO_NUM 130 #define R_TILEGX_NUM 130 #define R_RISCV_NUM 59 These _NUM constants are the highest actually used values, plus one. So all real values are smaller than 256. Thomas