]> git.ipfire.org Git - thirdparty/linux.git/commit - tools/objtool/check.c
objtool: Consolidate rel/rela handling
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 30 May 2023 17:20:56 +0000 (10:20 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 7 Jun 2023 17:03:15 +0000 (10:03 -0700)
commit53257a977a69b5eabbaafb64dcd767d2a4fef2b3
tree330e0fa0f2417613b8199d23c5853dbd53654864
parenta5bd623653231bce8657978e9d2c2ebfaf19e297
objtool: Consolidate rel/rela handling

The GElf_Rel[a] structs have more similarities than differences.  It's
safe to hard-code the assumptions about their shared fields as they will
never change.  Consolidate their handling where possible, getting rid of
duplicated code.

Also, at least for now we only ever create rela sections, so simplify
the relocation creation code to be rela-only.

Link: https://lore.kernel.org/r/dcabf6df400ca500ea929f1e4284f5e5ec0b27c8.1685464332.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/check.c
tools/objtool/elf.c
tools/objtool/include/objtool/elf.h