Page MenuHomeFreeBSD

D37038.diff
No OneTemporary

D37038.diff

diff --git a/usr.sbin/kldxref/ef_riscv.c b/usr.sbin/kldxref/ef_riscv.c
--- a/usr.sbin/kldxref/ef_riscv.c
+++ b/usr.sbin/kldxref/ef_riscv.c
@@ -45,10 +45,10 @@
ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase,
Elf_Off dataoff, size_t len, void *dest)
{
- Elf_Addr *where, val;
+ Elf_Addr *where;
const Elf_Rela *rela;
Elf_Addr addend, addr;
- Elf_Size rtype;
+ Elf_Size rtype, symidx;
switch (reltype) {
case EF_RELOC_RELA:
@@ -57,6 +57,7 @@
dataoff);
addend = rela->r_addend;
rtype = ELF_R_TYPE(rela->r_info);
+ symidx = ELF_R_SYM(rela->r_info);
break;
default:
return (EINVAL);
@@ -66,10 +67,13 @@
return (0);
switch (rtype) {
+ case R_RISCV_64: /* S + A */
+ addr = EF_SYMADDR(ef, symidx) + addend;
+ *where = addr;
+ break;
case R_RISCV_RELATIVE: /* B + A */
addr = addend + relbase;
- val = addr;
- *where = val;
+ *where = addr;
break;
default:
warnx("unhandled relocation type %d", (int)rtype);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 2:51 AM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688832
Default Alt Text
D37038.diff (998 B)

Event Timeline