aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2014-10-28 13:09:41 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-10-30 13:12:58 +0000
commitb7936bacf0cc89bdda6722d317274bd4a3af840a (patch)
tree77c035013ca7089457f0807d0dba9fe22971c5be /meta/recipes-devtools/elfutils/elfutils
parentc84bfa0f519e0bb74aed833a6318c21d91fce377 (diff)
downloadopenembedded-core-contrib-b7936bacf0cc89bdda6722d317274bd4a3af840a.tar.gz
openembedded-core-contrib-b7936bacf0cc89bdda6722d317274bd4a3af840a.tar.bz2
openembedded-core-contrib-b7936bacf0cc89bdda6722d317274bd4a3af840a.zip
elfutils: fix elf_cvt_gnuhash
The 'dest' and 'src' can be same, we need to save the value of src32[2] before swaping it. Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch b/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
new file mode 100644
index 0000000000..374cba555e
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
@@ -0,0 +1,29 @@
+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>
+diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
+index 6faf113..04d9ca1 100644
+--- a/libelf/gnuhash_xlate.h
++++ b/libelf/gnuhash_xlate.h
+@@ -40,6 +40,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)
+@@ -50,7 +51,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];