[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221229055713.7eqozt57aknqujjl@snowball.t-8ch.de>
Date: Thu, 29 Dec 2022 05:57:13 +0000
From: Thomas Weißschuh <thomas@...ch.de>
To: Rong Tao <rtoax@...mail.com>
Cc: jpoimboe@...nel.org, linux-kernel@...r.kernel.org,
linux@...ssschuh.net, peterz@...radead.org,
Rong Tao <rongtao@...tc.cn>
Subject: Re: [PATCH v2 5/8] objtool: reduce memory usage of struct reloc
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
Powered by blists - more mailing lists