]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix a use before initialization bug in the pdp11.c source file.
authorNick Clifton <nickc@redhat.com>
Fri, 5 Jun 2020 09:08:26 +0000 (10:08 +0100)
committerNick Clifton <nickc@redhat.com>
Fri, 5 Jun 2020 09:08:26 +0000 (10:08 +0100)
* pdp11.c (aout_link_add_symbols): Fix use before initialisation
bug.

bfd/ChangeLog
bfd/pdp11.c

index 0a34054da8cd1a72bd54e8117418db3b0d109930..011a49d5ecd6d0c0ff195dcce9f9ea975c352e88 100644 (file)
@@ -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
index 2eca67c4a7ccca221068abfa37a33e367dac0519..fecaa21ef5f4cafc63d6c7bae6ce16f1507dd804 100644 (file)
@@ -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;