kldxref: Fix for 32-bit powerpc

R_PPC_RELATIVE lost its 32-bit handling in the libelf conversion.

Reported by:	bapt
Fixes:		0299afdff1 ("kldxref: Make use of libelf to be a portable cross tool")
This commit is contained in:
Jessica Clarke 2023-12-14 16:37:34 +00:00
parent 3850927066
commit d1ce87ae0d

View file

@ -69,7 +69,8 @@ ef_ppc_reloc(struct elf_file *ef, const void *reldata, Elf_Type reltype,
le64enc(where, val);
else
be64enc(where, val);
}
} else
be32enc(where, val);
break;
case R_PPC_ADDR32: /* word32 S + A */
val = EF_SYMADDR(ef, symidx) + addend;