aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-06-05 10:08:26 +0100
committerNick Clifton <nickc@redhat.com>2020-06-05 10:08:26 +0100
commit9c65eeacd88bc02aad537394930b48c50fb616d6 (patch)
tree9f0f70de0144e1c46ec2e6d5b18321b30be88175 /bfd
parentd3d1cc7b13b4b1f11862d6b58174c81536fb3340 (diff)
downloadgdb-9c65eeacd88bc02aad537394930b48c50fb616d6.zip
gdb-9c65eeacd88bc02aad537394930b48c50fb616d6.tar.gz
gdb-9c65eeacd88bc02aad537394930b48c50fb616d6.tar.bz2
Fix a use before initialization bug in the pdp11.c source file.
* pdp11.c (aout_link_add_symbols): Fix use before initialisation bug.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/pdp11.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0a34054..011a49d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-05 Nick Clifton <nickc@redhat.com>
+
+ * pdp11.c (aout_link_add_symbols): Fix use before initialisation
+ bug.
+
2020-06-05 Nelson Chu <nelson.chu@sifive.com>
* elfnn-riscv.c (riscv_merge_attributes): Add new boolean
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index 2eca67c..fecaa21 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -2925,14 +2925,15 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
type = H_GET_8 (abfd, p->e_type);
- /* Ignore debugging symbols. */
- if (is_stab(type, name))
- continue;
-
/* PR 19629: Corrupt binaries can contain illegal string offsets. */
if (GET_WORD (abfd, p->e_strx) >= obj_aout_external_string_size (abfd))
return FALSE;
name = strings + GET_WORD (abfd, p->e_strx);
+
+ /* Ignore debugging symbols. */
+ if (is_stab (type, name))
+ continue;
+
value = GET_WORD (abfd, p->e_value);
flags = BSF_GLOBAL;
string = NULL;