From b260f1cd74a9bdf4a454e539feddb3ed87378b7f Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 12 Mar 2024 18:39:53 -0700 Subject: [PATCH] kldxref: Handle R_RISCV_CHERI_CAPABILITY As with R_MORELLO_CAPINIT only the address is output. --- usr.sbin/kldxref/ef_riscv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/kldxref/ef_riscv.c b/usr.sbin/kldxref/ef_riscv.c index adc9e5679d8f..fab0fed1985d 100644 --- a/usr.sbin/kldxref/ef_riscv.c +++ b/usr.sbin/kldxref/ef_riscv.c @@ -77,7 +77,8 @@ ef_riscv_reloc(struct elf_file *ef, const void *reldata, Elf_Type reltype, le64enc(where, addr); break; case R_RISCV_CHERI_CAPABILITY: - warnx("unhandled R_RISCV_CHERI_CAPABILITY relocation"); + addr = EF_SYMADDR(ef, symidx) + addend; + le64enc(where, addr); break; default: warnx("unhandled relocation type %d", (int)rtype);