Enable errors for executable stacks.

This commit is contained in:
Nick Clifton 2023-11-21 10:17:22 +00:00
parent 8cbdd69541
commit 00415f44d2
2 changed files with 38 additions and 3 deletions

View File

@ -1479,3 +1479,35 @@ diff -rupN binutils.orig/ld/testsuite/ld-x86-64/pr23189.d binutils-2.41/ld/tests
#readelf: -r --wide #readelf: -r --wide
There are no relocations in this file. There are no relocations in this file.
--- binutils.orig/bfd/elflink.c 2023-11-14 13:16:18.706749224 +0000
+++ binutils-2.41/bfd/elflink.c 2023-11-14 13:17:27.584837271 +0000
@@ -7150,14 +7150,6 @@ bfd_elf_size_dynamic_sections (bfd *outp
though the choice is the result of another command line option. */
if (info->warn_execstack == 1)
{
- if (info->error_execstack)
- {
- _bfd_error_handler
- (_("\
-error: creating an executable stack because of -z execstack command line option"));
- return false;
- }
-
_bfd_error_handler
(_("\
warning: enabling an executable stack because of -z execstack command line option"));
@@ -7219,14 +7211,6 @@ warning: enabling an executable stack be
on the command line. */
if (noteobj)
{
- if (info->error_execstack)
- {
- _bfd_error_handler (_("\
-error: %s: is triggering the generation of an executable stack (because it has an executable .note.GNU-stack section)"),
- bfd_get_filename (noteobj));
- return false;
- }
-
_bfd_error_handler (_("\
warning: %s: requires executable stack (because the .note.GNU-stack section is executable)"),
bfd_get_filename (noteobj));

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities Summary: A GNU collection of binary utilities
Name: binutils%{?_with_debug:-debug} Name: binutils%{?_with_debug:-debug}
Version: 2.41 Version: 2.41
Release: 13%{?dist} Release: 14%{?dist}
License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later LGPL-2.1-or-later AND LGPL-2.0-or-later License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later LGPL-2.1-or-later AND LGPL-2.0-or-later
URL: https://sourceware.org/binutils URL: https://sourceware.org/binutils
@ -38,8 +38,8 @@ URL: https://sourceware.org/binutils
%define warn_for_rwx_segments 1 %define warn_for_rwx_segments 1
# Turn the above warnings into errors. Only effective if the warnings are enabled. # Turn the above warnings into errors. Only effective if the warnings are enabled.
%define error_for_executable_stacks 0 %define error_for_executable_stacks 1
%define error_for_rwx_segments 0 %define error_for_rwx_segments 1
# Enable support for GCC LTO compilation. # Enable support for GCC LTO compilation.
# Disable if it is necessary to work around bugs in LTO. # Disable if it is necessary to work around bugs in LTO.
@ -1295,6 +1295,9 @@ exit 0
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%changelog %changelog
* Tue Nov 21 2023 Nick Clifton <nickc@redhat.com> - 2.41-14
- Enable errors for executable stacks.
* Fri Nov 10 2023 Nick Clifton <nickc@redhat.com> - 2.41-13 * Fri Nov 10 2023 Nick Clifton <nickc@redhat.com> - 2.41-13
- Make the GOLD linker ignore the "-z pack-relative-relocs" option. (#2248936) - Make the GOLD linker ignore the "-z pack-relative-relocs" option. (#2248936)