summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/uftrace
diff options
context:
space:
mode:
authorwangmy <wangmy@fujitsu.com>2021-05-13 15:55:43 +0800
committerKhem Raj <raj.khem@gmail.com>2021-05-14 07:26:46 -0700
commit54feab11a1866435107df366005b50aba3b8d1cd (patch)
tree6cbd0f55fbd066183168a2e4d6be99aa3e6db901 /meta-oe/recipes-devtools/uftrace
parentdcb9ecc1e5720c9614b1cd27575e1e4886dff5c1 (diff)
downloadmeta-openembedded-54feab11a1866435107df366005b50aba3b8d1cd.tar.gz
uftrace: Fix a plthook crash on aarch64 with binutils2.35.1 and later versions on aarch64
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/uftrace')
-rw-r--r--meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch27
-rw-r--r--meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch47
-rw-r--r--meta-oe/recipes-devtools/uftrace/uftrace_0.9.4.bb2
3 files changed, 48 insertions, 28 deletions
diff --git a/meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch b/meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch
deleted file mode 100644
index ac17cf433..000000000
--- a/meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From 0bc502989822506af308a559ac1cd52af82cac03 Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@cn.fujitsu.com>
3Date: Wed, 14 Apr 2021 09:35:35 +0900
4Subject: [PATCH] Fix error on aarch64 with binutils2.35.1.
5
6WARN: child terminated by signal: 11: Segmentation fault
7
8Upstream-status: Pending
9
10Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
11---
12 arch/aarch64/mcount-arch.h | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/arch/aarch64/mcount-arch.h b/arch/aarch64/mcount-arch.h
16index 69efe521..60c2c1ba 100644
17--- a/arch/aarch64/mcount-arch.h
18+++ b/arch/aarch64/mcount-arch.h
19@@ -31,7 +31,7 @@ struct mcount_arch_context {
20 double d[ARCH_MAX_FLOAT_REGS];
21 };
22
23-#define ARCH_PLT0_SIZE 32
24+#define ARCH_PLT0_SIZE 16
25 #define ARCH_PLTHOOK_ADDR_OFFSET 0
26
27 struct mcount_disasm_engine;
diff --git a/meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch b/meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch
new file mode 100644
index 000000000..bf997d6e4
--- /dev/null
+++ b/meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch
@@ -0,0 +1,47 @@
1From 0851278471472c6be69a936cc3698aa50a646ffd Mon Sep 17 00:00:00 2001
2From: Lei Maohui <leimaohui@cn.fujitsu.com>
3Date: Wed, 12 May 2021 17:06:31 +0900
4Subject: [PATCH] aarch64: Fix a plthook crash on aarch64 with binutils2.35.1
5 and later versions
6
7plthook is always crashed in Ubuntu 20.10 aarch64, which uses binutils 2.35.1.
8Since the `plt_entsize` is not automatically set in this version, we have to
9explicitly set the value.
10
11This patch fixes the following problem.
12
13 $ uname -m
14 aarch64
15
16 $ cat /etc/os-release | grep PRETTY_NAME
17 PRETTY_NAME="Ubuntu 20.10"
18
19 $ gcc -pg tests/s-abc.c
20
21 $ uftrace record a.out
22 WARN: child terminated by signal: 7: Bus error
23
24Fixed: #1254
25
26Upstream-status: submitted [Sent to https://github.com/namhyung/uftrace/pull/1248]
27
28Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
29---
30 utils/symbol.c | 1 +
31 1 file changed, 1 insertion(+)
32
33diff --git a/utils/symbol.c b/utils/symbol.c
34index 29a1d295..01e52dab 100644
35--- a/utils/symbol.c
36+++ b/utils/symbol.c
37@@ -560,6 +560,7 @@ int load_elf_dynsymtab(struct symtab *dsymtab, struct uftrace_elf_data *elf,
38 }
39 else if (elf->ehdr.e_machine == EM_AARCH64) {
40 plt_addr += 16; /* AARCH64 PLT0 size is 32 */
41+ plt_entsize = 16;
42 }
43 else if (elf->ehdr.e_machine == EM_386) {
44 plt_entsize += 12;
45--
462.25.1
47
diff --git a/meta-oe/recipes-devtools/uftrace/uftrace_0.9.4.bb b/meta-oe/recipes-devtools/uftrace/uftrace_0.9.4.bb
index 4b4fc831c..a04fccca7 100644
--- a/meta-oe/recipes-devtools/uftrace/uftrace_0.9.4.bb
+++ b/meta-oe/recipes-devtools/uftrace/uftrace_0.9.4.bb
@@ -13,7 +13,7 @@ inherit autotools
13PV .= "+git${SRCPV}" 13PV .= "+git${SRCPV}"
14SRCREV = "d648bbffedef529220896283fb59e35531c13804" 14SRCREV = "d648bbffedef529220896283fb59e35531c13804"
15SRC_URI = "git://github.com/namhyung/${BPN} \ 15SRC_URI = "git://github.com/namhyung/${BPN} \
16 file://0001-Fix-error-on-aarch64-with-binutils2.35.1.patch \ 16 file://0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch \
17 " 17 "
18S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
19 19