]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scripts/sorttable: Convert Elf_Ehdr to union
authorSteven Rostedt <rostedt@goodmis.org>
Sun, 5 Jan 2025 16:22:17 +0000 (11:22 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 8 Jan 2025 03:23:05 +0000 (22:23 -0500)
commit157fb5b3cfd2cb5950314f926a76e567fc1921c5
tree06eaca7de2589ffb0335fbc28dae3a4d24ef67dd
parent7ffc0d0819f438779ed592e2e2e3576f43ce14f0
scripts/sorttable: Convert Elf_Ehdr to 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_Ehdr macro with a
union that defines both Elf64_Ehdr and Elf32_Ehdr, with field e64 for the
64bit version, and e32 for the 32bit version.

Then a macro etype can be used instead to get to 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.148224465@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
scripts/sorttable.c
scripts/sorttable.h