lkml.org 
[lkml]   [2022]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2023-03-26 23:22    [W:0.079 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site