Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102781716
D37038.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
998 B
Referenced Files
None
Subscribers
None
D37038.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D37038: kldxref: handle R_RISCV_64 relocation
Attached
Detach File
Event Timeline
Log In to Comment