Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2019 22:35:16 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355917 - head/sys/sys
Message-ID:  <201912192235.xBJMZGVo085502@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdragon
Date: Thu Dec 19 22:35:16 2019
New Revision: 355917
URL: https://svnweb.freebsd.org/changeset/base/355917

Log:
  [PowerPC] Only move linker sets to .data on ELFv1
  
  In r268055, powerpc64 was special cased regarding linker sets to not mark
  the function pointer as 'const'.
  
  This appears to have been done to ensure the compiler generates the function
  descriptors correctly. When non-const, the function descriptors will end up
  in the .data.rel.local section, and the linker set symbols will get
  relocations pointing to them there.
  
  Since function pointers on ELFv2 are "just" pointers like other platforms,
  we can leave them const like they are on every other platform.
  
  Reviewed by:	jhibbits
  Differential Revision:	https://reviews.freebsd.org/D22796

Modified:
  head/sys/sys/linker_set.h

Modified: head/sys/sys/linker_set.h
==============================================================================
--- head/sys/sys/linker_set.h	Thu Dec 19 19:34:25 2019	(r355916)
+++ head/sys/sys/linker_set.h	Thu Dec 19 22:35:16 2019	(r355917)
@@ -42,8 +42,11 @@
  * For ELF, this is done by constructing a separate segment for each set.
  */
 
-#if defined(__powerpc64__)
+#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
 /*
+ * ELFv1 pointers to functions are actaully pointers to function
+ * descriptors.
+ *
  * Move the symbol pointer from ".text" to ".data" segment, to make
  * the GCC compiler happy:
  */



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