summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch44
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb1
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
new file mode 100644
index 0000000000..05f1629d58
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -0,0 +1,44 @@
1Upstream-Status: Pending
2
3NEON instruction VLD1.64 was used to copy 64 bits data after type
4casting, and they will trigger alignment trap.
5This patch uses memcpy to avoid alignment problem.
6
7Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
8
9diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
10index d3a02d4..e7e9218 100644
11--- a/mkfs.ubifs/key.h
12+++ b/mkfs.ubifs/key.h
13@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
14 */
15 static inline void key_write(const union ubifs_key *from, void *to)
16 {
17- union ubifs_key *t = to;
18+ __le32 x[2];
19
20- t->j32[0] = cpu_to_le32(from->u32[0]);
21- t->j32[1] = cpu_to_le32(from->u32[1]);
22+ x[0] = cpu_to_le32(from->u32[0]);
23+ x[1] = cpu_to_le32(from->u32[1]);
24+
25+ memcpy(to, &x, 8);
26 memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
27 }
28
29@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
30 */
31 static inline void key_write_idx(const union ubifs_key *from, void *to)
32 {
33- union ubifs_key *t = to;
34+ __le32 x[2];
35+
36+ x[0] = cpu_to_le32(from->u32[0]);
37+ x[1] = cpu_to_le32(from->u32[1]);
38
39- t->j32[0] = cpu_to_le32(from->u32[0]);
40- t->j32[1] = cpu_to_le32(from->u32[1]);
41+ memcpy(to, &x, 8);
42 }
43
44 /**
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index f78bc7e7f9..52297c63ba 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
10SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b" 10SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
11SRC_URI = "git://git.infradead.org/mtd-utils.git \ 11SRC_URI = "git://git.infradead.org/mtd-utils.git \
12 file://add-exclusion-to-mkfs-jffs2-git-2.patch \ 12 file://add-exclusion-to-mkfs-jffs2-git-2.patch \
13 file://fix-armv7-neon-alignment.patch \
13" 14"
14 15
15PV = "1.5.1+git${SRCPV}" 16PV = "1.5.1+git${SRCPV}"