diff options
author | Roy Li <rongqing.li@windriver.com> | 2014-10-28 13:09:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:37:41 +0000 |
commit | 7fb6b0fd615c43c57f68357029ecf0311cec515b (patch) | |
tree | 3a8414f223fb60eb9e0f5677297aa5a626bb5a8c /meta/recipes-devtools | |
parent | 70ad0500e7de53892e61c8ceae94064ae6370d79 (diff) | |
download | poky-7fb6b0fd615c43c57f68357029ecf0311cec515b.tar.gz |
elfutils: fix elf_cvt_gnuhash
The 'dest' and 'src' can be same, we need to save the value of src32[2]
before swaping it.
(From OE-Core rev: b7936bacf0cc89bdda6722d317274bd4a3af840a)
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch | 29 | ||||
-rw-r--r-- | meta/recipes-devtools/elfutils/elfutils_0.148.bb | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/elfutils/elfutils_0.158.bb | 1 |
3 files changed, 31 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 @@ | |||
1 | Fix elf_cvt_gunhash if dest and src are same. | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | The 'dest' and 'src' can be same, we need to save the value of src32[2] | ||
6 | before swaping it. | ||
7 | |||
8 | Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com> | ||
9 | diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h | ||
10 | index 6faf113..04d9ca1 100644 | ||
11 | --- a/libelf/gnuhash_xlate.h | ||
12 | +++ b/libelf/gnuhash_xlate.h | ||
13 | @@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode) | ||
14 | words. We must detangle them here. */ | ||
15 | Elf32_Word *dest32 = dest; | ||
16 | const Elf32_Word *src32 = src; | ||
17 | + Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src | ||
18 | |||
19 | /* First four control words, 32 bits. */ | ||
20 | for (unsigned int cnt = 0; cnt < 4; ++cnt) | ||
21 | @@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode) | ||
22 | len -= 4; | ||
23 | } | ||
24 | |||
25 | - Elf32_Word bitmask_words = encode ? src32[2] : dest32[2]; | ||
26 | + Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2]; | ||
27 | |||
28 | /* Now the 64 bit words. */ | ||
29 | Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4]; | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/meta/recipes-devtools/elfutils/elfutils_0.148.bb index 110624297e..ab956390b3 100644 --- a/meta/recipes-devtools/elfutils/elfutils_0.148.bb +++ b/meta/recipes-devtools/elfutils/elfutils_0.148.bb | |||
@@ -32,6 +32,7 @@ SRC_URI += "\ | |||
32 | file://dso-link-change.patch \ | 32 | file://dso-link-change.patch \ |
33 | file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \ | 33 | file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \ |
34 | file://elfutils-ar-c-fix-num-passed-to-memset.patch \ | 34 | file://elfutils-ar-c-fix-num-passed-to-memset.patch \ |
35 | file://Fix_elf_cvt_gunhash.patch \ | ||
35 | " | 36 | " |
36 | # Only apply when building uclibc based target recipe | 37 | # Only apply when building uclibc based target recipe |
37 | SRC_URI_append_libc-uclibc = " file://uclibc-support.patch" | 38 | SRC_URI_append_libc-uclibc = " file://uclibc-support.patch" |
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.158.bb b/meta/recipes-devtools/elfutils/elfutils_0.158.bb index ef3dd0bb40..42724a1590 100644 --- a/meta/recipes-devtools/elfutils/elfutils_0.158.bb +++ b/meta/recipes-devtools/elfutils/elfutils_0.158.bb | |||
@@ -30,6 +30,7 @@ SRC_URI += "\ | |||
30 | file://dso-link-change.patch \ | 30 | file://dso-link-change.patch \ |
31 | file://m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch \ | 31 | file://m4-biarch.m4-tweak-AC_RUN_IFELSE-for-cross-compiling.patch \ |
32 | file://fixheadercheck.patch \ | 32 | file://fixheadercheck.patch \ |
33 | file://Fix_elf_cvt_gunhash.patch \ | ||
33 | " | 34 | " |
34 | 35 | ||
35 | # Only apply when building uclibc based target recipe | 36 | # Only apply when building uclibc based target recipe |