aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-09-16 09:22:36 +0930
committerAlan Modra <amodra@gmail.com>2020-09-16 16:41:32 +0930
commitec74481d7e4afbc89e3785d22659d3897af36956 (patch)
tree8af4023515ccf78fca48a65a314376df05c711ab /bfd
parent12d8f940d0c09e808f56a898fe5936b2b8f0403c (diff)
downloadgdb-ec74481d7e4afbc89e3785d22659d3897af36956.zip
gdb-ec74481d7e4afbc89e3785d22659d3897af36956.tar.gz
gdb-ec74481d7e4afbc89e3785d22659d3897af36956.tar.bz2
PR26623, buffer overflow in ppc_symbol_is_valid
PR 26623 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-bfd.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cc5afb4..09e4a5f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index eebdf9a..9b0a202 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) \