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

Kinsey Moore kinsey.moore at oarcorp.com
Tue Mar 21 15:19:11 UTC 2023


Joel,
This is fine for fixing the warnings for the time being. We still need to
address the AArch64 break due to binutils >= 2.40 (2.39 does not have the
bad patch).

Kinsey

On Tue, Mar 21, 2023 at 10:17 AM Joel Sherrill <joel at rtems.org> wrote:

> 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
>>
> _______________________________________________
> 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/10de51ec/attachment.htm>


More information about the devel mailing list