[PATCH 10/10][HACK] objtool: Shrink reloc

From: Peter Zijlstra
Date: Wed Feb 08 2023 - 12:24:24 EST


Glorious hack, do not merge. Good for another ~850M of allyesconfig
savings.

Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
tools/objtool/include/objtool/elf.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -71,17 +71,23 @@ struct reloc {
union {
GElf_Rela rela;
GElf_Rel rel;
+ struct {
+ u64 offset;
+ u64 __bar;
+ s64 addend;
+ };
};
struct section *sec;
struct symbol *sym;
struct list_head sym_reloc_entry;
- unsigned long offset;
- unsigned int type;
- s64 addend;
int idx;
+ unsigned short type;
bool jump_table_start;
};

+static_assert(offsetof(struct reloc, rela.r_offset) == offsetof(struct reloc, offset));
+static_assert(offsetof(struct reloc, rela.r_addend) == offsetof(struct reloc, addend));
+
#define ELF_HASH_BITS 20

struct elf {