Removing nested function from elfxx-aarch64.c

Matthieu Longo matthieu.longo@arm.com
Wed Mar 5 11:06:50 GMT 2025


On 2025-03-05 10:45, Nick Clifton wrote:
> 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
> 

Hi Nick,

The patch looks good to me.
I didn't know that nested functions was a problem, I was treating them 
more or less as the lambdas in C++.
I have some patches I need to update then :)

Regards,
Matthieu


More information about the Binutils mailing list