diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-12-06 04:30:24 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-12-06 04:30:24 +0000 |
commit | ac37786a0a216703840b03fe8be74cf9dceb0d3a (patch) | |
tree | 37bc0a9b89f031df176d65f9c69aa824d0ac8e12 | |
parent | 7c4f1a1c5ac05474dcaf86bfd4493be02edf59ff (diff) | |
download | src-ac37786a0a216703840b03fe8be74cf9dceb0d3a.tar.gz src-ac37786a0a216703840b03fe8be74cf9dceb0d3a.zip |
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.
Notes
Notes:
svn path=/head/; revision=341616
-rw-r--r-- | sys/powerpc/powerpc/elf64_machdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 74a13064bd41..9fd0964dc108 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -332,7 +332,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, #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; |