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

Joel Sherrill joel at rtems.org
Tue Mar 21 15:16:43 UTC 2023


I'm ok with this if Kinsey confirms it

On Tue, Mar 21, 2023, 4:11 AM <chrisj at rtems.org> wrote:

> 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
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230321/4e0f2c7e/attachment.htm>


More information about the devel mailing list