From ec74481d7e4afbc89e3785d22659d3897af36956 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 16 Sep 2020 09:22:36 +0930 Subject: [PATCH] PR26623, buffer overflow in ppc_symbol_is_valid PR 26623 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols. --- bfd/ChangeLog | 5 +++++ bfd/elf-bfd.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index cc5afb42d43..09e4a5fdd4e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-09-16 Alan Modra + + PR 26623 + * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols. + 2020-09-15 H.J. Lu * coff-x86_64.c (howto_table): Display PE relocation names. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index eebdf9ac738..9b0a2028d35 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -792,7 +792,8 @@ struct elf_size_info { }; #define elf_symbol_from(ABFD,S) \ - (((S)->the_bfd != NULL \ + ((((S)->flags & BSF_SYNTHETIC) == 0 \ + && (S)->the_bfd != NULL \ && (S)->the_bfd->xvec->flavour == bfd_target_elf_flavour \ && (S)->the_bfd->tdata.elf_obj_data != 0) \ ? (elf_symbol_type *) (S) \ -- 2.30.2