public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ubsan: elfnn-aarch64.c:4595:19: runtime error: load of value 190
@ 2023-03-28  2:09 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-03-28  2:09 UTC (permalink / raw)
  To: binutils

which is not a valid value for type '_Bool'

FAIL: ld-aarch64/erratum843419
FAIL: ld-aarch64/erratum843419_tls_ie
FAIL: aarch64-farcall-back
FAIL: aarch64-farcall-b-defsym
FAIL: aarch64-farcall-bl-defsym
FAIL: aarch64-farcall-b-plt
FAIL: aarch64-farcall-bl-plt
FAIL: aarch64-farcall-bl
FAIL: aarch64-farcall-b
FAIL: aarch64-farcall-b-none-function
FAIL: aarch64-farcall-bl-none-function
FAIL: aarch64-farcall-b-section
FAIL: aarch64-farcall-bl-section
FAIL: aarch64-farcall-group
FAIL: Check linker stubs with indirect calls handle BTI when target has BTI.

So, lack of init for a new field.  Let's fix this for the future too.

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

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index c321ceb382e..c4db1e6f168 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -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;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-28  2:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28  2:09 ubsan: elfnn-aarch64.c:4595:19: runtime error: load of value 190 Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).