svn commit: r341616 - head/sys/powerpc/powerpc
Justin Hibbits
jhibbits at FreeBSD.org
Thu Dec 6 04:30:25 UTC 2018
Author: jhibbits
Date: Thu Dec 6 04:30:24 2018
New Revision: 341616
URL: https://svnweb.freebsd.org/changeset/base/341616
Log:
powerpc: Fix ELFv2 JMP_SLOT relocation fixup
The jump slot is a function pointer, not a descriptor pointer, in ELFv2. Just
write the pointer itself over, not the contents of the pointer, which would be
the first instruction of the function.
Modified:
head/sys/powerpc/powerpc/elf64_machdep.c
Modified: head/sys/powerpc/powerpc/elf64_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/elf64_machdep.c Thu Dec 6 04:28:39 2018 (r341615)
+++ head/sys/powerpc/powerpc/elf64_machdep.c Thu Dec 6 04:30:24 2018 (r341616)
@@ -332,7 +332,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas
#if !defined(_CALL_ELF) || _CALL_ELF == 1
memcpy(where, (Elf_Addr *)addr, 3*sizeof(Elf_Addr));
#else
- memcpy(where, (Elf_Addr *)addr, sizeof(Elf_Addr));
+ *where = addr;
#endif
__asm __volatile("dcbst 0,%0; sync" :: "r"(where) : "memory");
break;
More information about the svn-src-head
mailing list