]> git.itanic.dy.fi Git - linux-stable/commit
modpost: factor out the common boilerplate of section_rel(a)
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 Oct 2023 17:04:48 +0000 (02:04 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 18 Oct 2023 08:16:09 +0000 (17:16 +0900)
commit77f9f57164561d0acbb9d6b2ca78280925f52aaa
tree4e2ac05604f71ab9365a5b62ef2b56e6cde53288
parent29ae5c02ed743c62e3c0619013b2bcd280bc562d
modpost: factor out the common boilerplate of section_rel(a)

The first few lines of section_rel() and section_rela() are the same.
They both retrieve the index of the section to which the relocaton
applies, and skip known-good sections. This common code should be moved
to check_sec_ref().

Avoid ugly casts when computing 'start' and 'stop', and also make the
Elf_Rel and Elf_Rela pointers const.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/mod/modpost.c