Removing nested function from elfxx-aarch64.c

Nick Clifton nickc@redhat.com
Wed Mar 5 10:45:28 GMT 2025


Hi Matthieu,

   I hope that you do not mind, but I am checking in the attached patch to
   remove the nested bfd_is_non_dynamic_elf_object function from
   bfd_linear_search_one_with_gnu_property in elfxx-aarch64.c and instead
   replace it with an ordinary inline static function.

   Whilst nested functions are supported by gcc, they are not by others
   (most notably Clang in this case, which is how I encountered this
   issue).  More than that however they can require the use of an executable
   stack (depending upon the compiler and the architecture) and this is
   a bad thing from a security point of view.

Cheers
   Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-nested-func.patch
Type: text/x-patch
Size: 1712 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250305/31efee5b/attachment-0001.bin>


More information about the Binutils mailing list