[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
This commit is contained in:
Brandon Bergren 2019-12-19 22:35:16 +00:00
parent 5d3bd9e242
commit 59efc3a839
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355917

View File

@ -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:
*/