mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
License-Update: copyright years (From OE-Core rev: 1d6ac3c811798732e6addc798656bbe104661d77) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
From bd78783254a7126d82eab26a2069b3a457b98e2e Mon Sep 17 00:00:00 2001
|
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
|
Date: Tue, 15 Aug 2017 17:13:59 +0800
|
|
Subject: [PATCH] Fix elf_cvt_gunhash if dest and src are same.
|
|
|
|
Upstream-Status: Pending
|
|
|
|
The 'dest' and 'src' can be same, we need to save the value of src32[2]
|
|
before swaping it.
|
|
|
|
Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
|
|
|
|
Rebase to 0.170
|
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
|
---
|
|
libelf/gnuhash_xlate.h | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
|
|
index 3a00ae0..40468fc 100644
|
|
--- a/libelf/gnuhash_xlate.h
|
|
+++ b/libelf/gnuhash_xlate.h
|
|
@@ -42,6 +42,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
|
|
words. We must detangle them here. */
|
|
Elf32_Word *dest32 = dest;
|
|
const Elf32_Word *src32 = src;
|
|
+ Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src
|
|
|
|
/* First four control words, 32 bits. */
|
|
for (unsigned int cnt = 0; cnt < 4; ++cnt)
|
|
@@ -52,7 +53,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
|
|
len -= 4;
|
|
}
|
|
|
|
- Elf32_Word bitmask_words = encode ? src32[2] : dest32[2];
|
|
+ Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2];
|
|
|
|
/* Now the 64 bit words. */
|
|
Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
|