summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch')
-rw-r--r--meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
new file mode 100644
index 0000000000..2f718eb827
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
@@ -0,0 +1,42 @@
1From e98670f7c7b4c73fb65534949716fd8d043960d5 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:13:59 +0800
4Subject: [PATCH 2/7] Fix elf_cvt_gunhash if dest and src are same.
5
6Upstream-Status: Pending
7
8The 'dest' and 'src' can be same, we need to save the value of src32[2]
9before swaping it.
10
11Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
12
13Rebase to 0.170
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 libelf/gnuhash_xlate.h | 3 ++-
17 1 file changed, 2 insertions(+), 1 deletion(-)
18
19diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
20index 6faf113..04d9ca1 100644
21--- a/libelf/gnuhash_xlate.h
22+++ b/libelf/gnuhash_xlate.h
23@@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
24 words. We must detangle them here. */
25 Elf32_Word *dest32 = dest;
26 const Elf32_Word *src32 = src;
27+ Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src
28
29 /* First four control words, 32 bits. */
30 for (unsigned int cnt = 0; cnt < 4; ++cnt)
31@@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
32 len -= 4;
33 }
34
35- Elf32_Word bitmask_words = encode ? src32[2] : dest32[2];
36+ Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2];
37
38 /* Now the 64 bit words. */
39 Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
40--
411.8.3.1
42