diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2025-07-12 10:58:06 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2025-07-12 11:33:25 +0200 |
commit | 3bf7cb6860c61184f7b95954dee13acabcbf425a (patch) | |
tree | e5a356f0d786c01713dd18da8fe0fc943ab5911b | |
parent | 11d33617e04dc6c54274ce69640218efd26519f5 (diff) | |
download | binutils-3bf7cb6860c61184f7b95954dee13acabcbf425a.zip binutils-3bf7cb6860c61184f7b95954dee13acabcbf425a.tar.gz binutils-3bf7cb6860c61184f7b95954dee13acabcbf425a.tar.bz2 |
bfd: fix recognition of arch-specific augmentations
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.
-rw-r--r-- | bfd/elf-eh-frame.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 0250a8f..aca1617 100644 --- 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; |