modpost: error out if addend_*_rel() is not implemented for REL arch

JIRA: https://issues.redhat.com/browse/RHEL-28063

commit 64f140417d818aa374788acc9cb8328165747262
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Fri May 12 01:24:22 2023 +0900

    modpost: error out if addend_*_rel() is not implemented for REL arch

    The section mismatch check relies on the relocation entries.

    For REL, the addend value is implicit, so we need some code to compute
    it. Currently, EM_386, EM_ARM, and EM_MIPS are supported. This commit
    makes sure we covered all the cases.

    I believe the other architectures use RELA, where the explicit r_addend
    field exists.

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Signed-off-by: Donald Dutile <ddutile@redhat.com>
This commit is contained in:
Donald Dutile 2024-05-09 01:53:57 -04:00
parent c966289643
commit a43d31cfdc
1 changed files with 2 additions and 0 deletions

View File

@ -1608,6 +1608,8 @@ static void section_rel(const char *modname, struct elf_info *elf,
if (addend_mips_rel(elf, sechdr, &r))
continue;
break;
default:
fatal("Please add code to calculate addend for this architecture\n");
}
sym = elf->symtab_start + r_sym;
/* Skip special sections */