From b3a3d7d90800b7c21ce8d82dbdbf17eeab163c7b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 31 Jan 2023 15:16:02 +1030 Subject: [PATCH] Silence ubsan warning about 1<<31 * merge.c (hash_blob): Write 1u << 31. --- bfd/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/merge.c b/bfd/merge.c index f21154dcd45..327bd66b341 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -279,7 +279,7 @@ hash_blob (const char *str, unsigned int len) uint32_t ret = 0; uint32_t mul = (1 << 0) + (1 << 2) + (1 << 3) + (1 << 5) + (1 << 7); mul += (1 << 11) + (1 << 13) + (1 << 17) + (0 << 19) + (1 << 23) + (1 << 29); - mul += (1 << 31); + mul += (1u << 31); if (len >= 8) { uint32_t acc = len * 0x9e3779b1; -- 2.30.2