[PATCH] binutils: Disable stack exec and RWX section warnings

chrisj at rtems.org chrisj at rtems.org
Tue Mar 21 11:11:14 UTC 2023


From: Chris Johns <chrisj at rtems.org>

Binutils 2.39 and later enable by default warnings for executables
with executable stack and RWX sections. Disable them.

Closes #4881
---
 source-builder/config/binutils-2-1.cfg | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/source-builder/config/binutils-2-1.cfg b/source-builder/config/binutils-2-1.cfg
index 6de33ae..df121af 100644
--- a/source-builder/config/binutils-2-1.cfg
+++ b/source-builder/config/binutils-2-1.cfg
@@ -32,6 +32,18 @@ URL: 	   http://sources.redhat.com/binutils
  %define with_gold 0
 %endif
 
+#
+# Disable the new default options to check for stack exec and RWX sections
+# instroduced in 2.39.
+#
+%define binutils_extra_config %nil
+%ifn %{defined without_stackexec}
+ %define binutils_extra_config %{binutils_extra_config} --disable-warn-execstack
+%endif
+%ifn %{defined without_rwx_sections}
+ %define binutils_extra_config %{binutils_extra_config} --disable-warn-rwx-segments
+%endif
+
 #
 # Source
 #
@@ -75,7 +87,8 @@ URL: 	   http://sources.redhat.com/binutils
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
-    --mandir=%{_mandir} --infodir=%{_infodir}
+    --mandir=%{_mandir} --infodir=%{_infodir} \
+    %{binutils_extra_config}
 
   %{__make} %{?_smp_mflags} all
 
-- 
2.37.1



More information about the devel mailing list