summaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/module-sections.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2025-05-12 22:12:44 -0700
committerDan Williams <dan.j.williams@intel.com>2025-05-12 22:12:44 -0700
commit15ff5d0e90bb044b94d9a4ac57276829861a954d (patch)
tree28bcf60949db629b0b772f6eebf026714dc38fe9 /arch/riscv/kernel/module-sections.c
parenta0372b3831785e15de605cd13d2ed78a79a9b435 (diff)
parent7c3f259dfe03f5dcd898126602818a8fbe94d3c5 (diff)
Merge branch 'for-6.16/tsm-mr' into tsm-next
Merge measurement-register infrastructure for v6.16. Resolve conflicts with the establishment of drivers/virt/coco/guest/ for cross-vendor common TSM functionality. Address a mis-merge with a fixup from Lukas: Link: http://lore.kernel.org/20250509134031.70559-1-lukas.bulwahn@redhat.com
Diffstat (limited to 'arch/riscv/kernel/module-sections.c')
-rw-r--r--arch/riscv/kernel/module-sections.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/riscv/kernel/module-sections.c b/arch/riscv/kernel/module-sections.c
index e264e59e596e..91d0b355ceef 100644
--- a/arch/riscv/kernel/module-sections.c
+++ b/arch/riscv/kernel/module-sections.c
@@ -73,16 +73,17 @@ static bool duplicate_rela(const Elf_Rela *rela, int idx)
static void count_max_entries(Elf_Rela *relas, int num,
unsigned int *plts, unsigned int *gots)
{
- unsigned int type, i;
-
- for (i = 0; i < num; i++) {
- type = ELF_RISCV_R_TYPE(relas[i].r_info);
- if (type == R_RISCV_CALL_PLT) {
+ for (int i = 0; i < num; i++) {
+ switch (ELF_R_TYPE(relas[i].r_info)) {
+ case R_RISCV_CALL_PLT:
+ case R_RISCV_PLT32:
if (!duplicate_rela(relas, i))
(*plts)++;
- } else if (type == R_RISCV_GOT_HI20) {
+ break;
+ case R_RISCV_GOT_HI20:
if (!duplicate_rela(relas, i))
(*gots)++;
+ break;
}
}
}