ubsan: elfnn-aarch64.c:4595:19: runtime error: load of value 190
authorAlan Modra <amodra@gmail.com>
Tue, 28 Mar 2023 01:30:02 +0000 (12:00 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 28 Mar 2023 01:40:28 +0000 (12:10 +1030)
which is not a valid value for type '_Bool'

* elfnn-aarch64.c (stub_hash_newfunc): Clear all fields past root.

bfd/elfnn-aarch64.c

index c321ceb382ecf873e9558b2b84d6a761f86c4929..c4db1e6f168e97938089a23d9328ab42b08b8991 100644 (file)
@@ -2767,14 +2767,9 @@ stub_hash_newfunc (struct bfd_hash_entry *entry,
 
       /* Initialize the local fields.  */
       eh = (struct elf_aarch64_stub_hash_entry *) entry;
-      eh->adrp_offset = 0;
-      eh->stub_sec = NULL;
-      eh->stub_offset = 0;
-      eh->target_value = 0;
-      eh->target_section = NULL;
-      eh->stub_type = aarch64_stub_none;
-      eh->h = NULL;
-      eh->id_sec = NULL;
+      memset (&eh->stub_sec, 0,
+             (sizeof (struct elf_aarch64_stub_hash_entry)
+              - offsetof (struct elf_aarch64_stub_hash_entry, stub_sec)));
     }
 
   return entry;