[PATCH 3/3] ld: Cleanup sframe_decoder_init_func_bfdinfo use of cookie->rel

Jan Beulich jbeulich@suse.com
Mon Feb 24 09:49:15 GMT 2025


On 21.02.2025 17:56, Jens Remus wrote:
> --- a/bfd/elf-sframe.c
> +++ b/bfd/elf-sframe.c
> @@ -118,9 +118,9 @@ sframe_decoder_init_func_bfdinfo (bfd *abfd,
>    if ((sec->flags & SEC_LINKER_CREATED) && cookie->rels == NULL)
>      return true;
>  
> +  cookie->rel = cookie->rels;
>    for (i = 0; i < fde_count; i++)
>      {
> -      cookie->rel = cookie->rels + i;
>        BFD_ASSERT (cookie->rel < cookie->relend);
>        /* Bookkeep the relocation offset and relocation index of each function
>  	 for later use.  */

How about going a step further and also changing

      sframe_decoder_set_func_reloc_index (sfd_info, i,
					   (cookie->rel - cookie->rels));

to

      sframe_decoder_set_func_reloc_index (sfd_info, i, i);

?

Jan



More information about the Binutils mailing list