aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matt Weber <matthew.weber@rockwellcollins.com>2020-09-23 10:29:08 -0500
committerGravatar Peter Korsgaard <peter@korsgaard.com>2020-09-29 21:09:11 +0200
commit0bfc3e915d0d5866dcd33e3a964c924f3a9da16b (patch)
tree14d4f25d21e547ff829ac57421988503293ba8e1
parent6c7f4873e2a7eaffed8717bb60a438ba8530ad30 (diff)
downloadbuildroot-refs/heads/2020.05.x.tar.gz
buildroot-refs/heads/2020.05.x.tar.bz2
package/gcc: transition PowerPC 32 to secureplt2020.05.x
PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses runtime code generation to generate the PLT stubs. Secure-PLT was introduced with GCC 4.1 and Binutils 2.17 (base has GCC 4.2.1 and Binutils 2.17), and is a more secure PLT format, using a read-only linkage table, with the dynamic linker populating a non-executable index table. References to other distro/BSD transitions: https://patchwork.openembedded.org/patch/106621/ https://reviews.freebsd.org/D20598 Fixes a bug observed when creating SELinux policy where all apps require execmem because the heap requires execute before this change. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit f9b539bf4054d55da69280b19f4b99a91cbe6e0b) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/gcc/gcc.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index af25d268a7..a0d20161bd 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -212,6 +212,13 @@ HOST_GCC_COMMON_CONF_OPTS += \
--with-long-double-128
endif
+# Set default to Secure-PLT to prevent run-time
+# generation of PLT stubs (supports RELRO and
+# SELinux non-exemem capabilities)
+ifeq ($(BR2_powerpc),y)
+HOST_GCC_COMMON_CONF_OPTS += --enable-secureplt
+endif
+
# PowerPC64 big endian by default uses the elfv1 ABI, and PowerPC 64
# little endian by default uses the elfv2 ABI. However, musl has
# decided to use the elfv2 ABI for both, so we force the elfv2 ABI for