RFC: Turning executable stack warnings into errors

Nick Clifton nickc@redhat.com
Wed Oct 18 10:44:49 GMT 2023


Hi Guys,

  I am working on a patch to turn the linker's warning messages about
  executable stacks into errors.  My intent is to use this to force
  programs that currently do have an executable stack to either change
  or deliberately disable the errors from the linker.  The plan is to
  then use this feature to help improve the security of Fedora
  binaries.

  I realise that the --fatal-warnings option could basically do the same
  thing, but that might be problematic for builds where some linker
  warnings are inevitable and can be safely ignored.  Hence I decided on
  a new command line option instead.
  
  The patch currently has these features:

  * The change is configurable, but not on by default.
  
  * There are new command line options to turn the future on and off as
    well as an option to only generate warnings (or errors) if an object
    file requests an executable stack, and not if one is requested via
    the '-z execstack' command line option.
    
  * A similar change is also made for the executable segments warning,
    creating the ability to turn it into an error as well.

  * Since linker errors cannot be ignored when running the linker
    testsuite the patch also needs to enhance a fair number of tests so
    that they do not fail if run with a linker configured to generate
    errors by default.

  Patch attached below.  Any comments ?

Cheers
  Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: execstack.error.patch
Type: text/x-patch
Size: 62100 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20231018/5a4d1968/attachment-0001.bin>


More information about the Binutils mailing list