[PATCH V4 3/8] bfd: fix recognition of arch-specific augmentations

Jan Beulich jbeulich@suse.com
Fri Jul 11 12:19:26 GMT 2025


On 09.07.2025 23:44, Jose E. Marchesi wrote:
> This patch fixes _bfd_elf_parse_eh_frame so it will not recognize
> machine/architecture specific augmentation characters in EH Frame
> CFIs.
> 
> Regtested in x86_64-linux-gnu and aarch64-linux-gnu.
> 
> bfd/ChangeLog:
> 
> 	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Recognize augmentation
> 	'B' only if targetting aarch64.

Similar to the earlier one - okay with ...

> --- a/bfd/elf-eh-frame.c
> +++ b/bfd/elf-eh-frame.c
> @@ -802,6 +802,8 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
>  		switch (*aug++)
>  		  {
>  		  case 'B':
> +                    if (abfd->arch_info->arch != bfd_arch_aarch64)
> +                      goto unrecognized;
>  		    break;
>  		  case 'L':
>  		    REQUIRE (read_byte (&buf, end, &cie->lsda_encoding));
> @@ -843,6 +845,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
>  		      REQUIRE (skip_bytes (&buf, end, per_width));
>  		    }
>  		    break;
> +                  unrecognized:
>  		  default:
>  		    /* Unrecognized augmentation. Better bail out.  */
>  		    goto free_no_table;

... indentation changed to the canonical tabs-then-spaces model.

Jan


More information about the Binutils mailing list