diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2025-01-05 11:22:19 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2025-01-07 22:23:05 -0500 |
commit | 200d015e73b4da69bcd8212a7c58695452b12bad (patch) | |
tree | 4667ca3e10a912befe635e09a2441e6a034d6304 /scripts/sorttable.c | |
parent | 545f6cf8f4c9a268e0bab2637f1d279679befdbf (diff) |
scripts/sorttable: Convert Elf_Sym MACRO over to a union
In order to remove the double #include of sorttable.h for 64 and 32 bit
to create duplicate functions for both, replace the Elf_Sym macro with a
union that defines both Elf64_Sym and Elf32_Sym, with field e64 for the
64bit version, and e32 for the 32bit version.
It can then use the macro etype to get the proper value.
This will eventually be replaced with just single functions that can
handle both 32bit and 64bit ELF parsing.
Cc: bpf <bpf@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Cc: Martin Kelly <martin.kelly@crowdstrike.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/20250105162345.528626969@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'scripts/sorttable.c')
-rw-r--r-- | scripts/sorttable.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/sorttable.c b/scripts/sorttable.c index 94497b8ab04c..57792cf2aa89 100644 --- a/scripts/sorttable.c +++ b/scripts/sorttable.c @@ -74,6 +74,11 @@ typedef union { Elf64_Shdr e64; } Elf_Shdr; +typedef union { + Elf32_Sym e32; + Elf64_Sym e64; +} Elf_Sym; + static uint32_t (*r)(const uint32_t *); static uint16_t (*r2)(const uint16_t *); static uint64_t (*r8)(const uint64_t *); |