PR26623, buffer overflow in ppc_symbol_is_valid
authorAlan Modra <amodra@gmail.com>
Tue, 15 Sep 2020 23:52:36 +0000 (09:22 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Sep 2020 07:11:32 +0000 (16:41 +0930)
PR 26623
* elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.

bfd/ChangeLog
bfd/elf-bfd.h

index cc5afb42d43c3d53ff1b3f0d6d7083f61fa29e34..09e4a5fdd4ec9ad32c23dabb59b0613025916ffd 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-16  Alan Modra  <amodra@gmail.com>
+
+       PR 26623
+       * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
+
 2020-09-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        * coff-x86_64.c (howto_table): Display PE relocation names.
index eebdf9ac738d55d781ac95d3d813eb51a48300c1..9b0a2028d35fda8353a3355f9171ec77601160cb 100644 (file)
@@ -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)                                   \