svn commit: r355917 - head/sys/sys
Brandon Bergren
bdragon at FreeBSD.org
Thu Dec 19 22:35:17 UTC 2019
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:
*/
More information about the svn-src-all
mailing list