Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2018 04:30:24 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341616 - head/sys/powerpc/powerpc
Message-ID:  <201812060430.wB64UOZF045428@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812060430.wB64UOZF045428>