Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5558255rwl; Wed, 28 Dec 2022 22:14:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXvYm28fwI8+w8sv3NabbfpetPZAFqwrxzNqRPBMOyXai2beal7iA5O3KtW04tlVhmlN7lAx X-Received: by 2002:a17:906:8806:b0:829:6036:eaa1 with SMTP id zh6-20020a170906880600b008296036eaa1mr29245361ejb.49.1672294482357; Wed, 28 Dec 2022 22:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672294482; cv=none; d=google.com; s=arc-20160816; b=Et/afRC/vrsFeHCe9Wi0fPjpRW4ohXGvTAcEvrvkabwzoKAbvi9ygsnWggFRE7ghgh rqXcjkLHzvxP4pZHp6j7BwYcEhxqLl/JTCnH6jCwkIeXViFj1ioxycdfntvkOa4mc+1S /nVWzj8PCfnoaRC28kmO2v2S7by0zPb9wr8Ma/x01E8wJwefwdVMDlJ6JXDQWm/pR5Gc 0gqNY1evz8AixuP3pP0E6/IcULtoyP5OW+aiArGaLdCxmsC0dv+yUjau1p/iknLFTZVl i/NrOD3haRsDzfjnj1G51NqciE6nYIvj0zSsqGIFisMVBMH30mHQc0z7chi1X+9LNNzM KQNg== 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=cIHP9yD9G+bx5aNu5MrflzjUp24WKENxSHrbM2h71xQ=; b=UBbJOnQ4LWt7XWGNHZPGh+H4OE+Nb6fCI4fsKDK9nb8r7K5AS3XuXL/EuTpMbyZZ0l VKWQ9aliTkfn9GOe7nusSHt6JNrgutBOrEzodkiIuH2LEx/oGTI7yNB6fFVwYdP3uIkk BdIaMtXU1jXKZN8MYAhQYdSTVuE50wDQwcNTdJFNBRirExcX2ZPaZ7140rEjP88mrLps 058AzXyElTGKdjU2BVtL55Hp03R2bHXDNkQcrChH3uz8/mpliGXCcqGuMAsU2VpV9BB1 DRjr42dflS/lz0iZist+mtqTIHqDG/l3OafY3QaL6aV2vlrW7Tdt2a00t+VFabdeCL1x PpIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@t-8ch.de header.s=mail header.b=E4DNfR50; 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 dn16-20020a17090794d000b0084514612c2fsi16230972ejc.613.2022.12.28.22.14.24; Wed, 28 Dec 2022 22:14:42 -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=E4DNfR50; 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 S231405AbiL2F6N (ORCPT + 62 others); Thu, 29 Dec 2022 00:58:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiL2F6J (ORCPT ); Thu, 29 Dec 2022 00:58:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2EF12AD8 for ; Wed, 28 Dec 2022 21:58:06 -0800 (PST) Date: Thu, 29 Dec 2022 05:57:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=t-8ch.de; s=mail; t=1672293484; bh=2oenb/kN5pBS8hqh35Ct7FrTf1XoGDzcXM6kZ3RuzwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E4DNfR50NLl4iJ2X6MUGiZJNPdzytuZ9er0KhYd5SiBOtgwPYY1sToN7amgiekjUo P7YwNTy4M7Y4gj0q3t2O1u93XGO1yvaDAVnZJ5LkNBmxsn9Y1cG65ygm9idIDLJ2AX ZCV/ekmfcHZskaNincaL3L2qtdvlvUlf64Ks9rGo= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Rong Tao Cc: jpoimboe@kernel.org, linux-kernel@vger.kernel.org, linux@weissschuh.net, peterz@infradead.org, Rong Tao Subject: Re: [PATCH v2 5/8] objtool: reduce memory usage of struct reloc Message-ID: <20221229055713.7eqozt57aknqujjl@snowball.t-8ch.de> References: <20221229022622.khboqwfe23e7u2en@snowball.t-8ch.de> 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 11:29:07AM +0800, Rong Tao wrote: > Hi, Thomas: > > In /usr/include/elf.h has: > > #define ELF32_R_TYPE(val) ((val) & 0xff) > #define ELF64_R_TYPE(i) ((i) & 0xffffffff) > ^^^^^^^^^^ > > So, I still feel that keeping 'unsigned int' is a good option. Can we just > use __attribute__((packed)) for wasted padding bytes? As the struct contains addresses, packing it will create a ton of compiler warnings and will be much more likely to break than reducing the width of 'type'. Given that reducing the width of 'type' * is currently absolutely safe, * is unlikely to break in the future, as the elf designers seem to be actively trying to stay within this range anyways, * saves 8 bytes from a very heavily allocated struct, having a measurable impact on the build process, I continue to propose this aproach. Let's let the maintainers decide. Thomas