All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Armin Kuster" <akuster808@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [harkknott 07/23] uftrace: Fix a plthook crash on aarch64 with binutils2.35.1 and later versions on aarch64
Date: Wed, 26 May 2021 04:52:22 -0700	[thread overview]
Message-ID: <a1ae03d0964df5ff7cc1c37c1f95eae60dd07800.1622029873.git.akuster808@gmail.com> (raw)
In-Reply-To: <cover.1622029873.git.akuster808@gmail.com>

From: wangmy <wangmy@fujitsu.com>

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 54feab11a1866435107df366005b50aba3b8d1cd)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 ...error-on-aarch64-with-binutils2.35.1.patch | 27 -----------
 ...thook-crash-on-aarch64-with-binutils.patch | 47 +++++++++++++++++++
 .../recipes-devtools/uftrace/uftrace_0.9.4.bb |  2 +-
 3 files changed, 48 insertions(+), 28 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch
 create mode 100644 meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch

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 ac17cf433f..0000000000
--- a/meta-oe/recipes-devtools/uftrace/uftrace/0001-Fix-error-on-aarch64-with-binutils2.35.1.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 0bc502989822506af308a559ac1cd52af82cac03 Mon Sep 17 00:00:00 2001
-From: Lei Maohui <leimaohui@cn.fujitsu.com>
-Date: Wed, 14 Apr 2021 09:35:35 +0900
-Subject: [PATCH] Fix error on aarch64 with binutils2.35.1.
-
-WARN: child terminated by signal: 11: Segmentation fault
-
-Upstream-status: Pending
-
-Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
----
- arch/aarch64/mcount-arch.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/aarch64/mcount-arch.h b/arch/aarch64/mcount-arch.h
-index 69efe521..60c2c1ba 100644
---- a/arch/aarch64/mcount-arch.h
-+++ b/arch/aarch64/mcount-arch.h
-@@ -31,7 +31,7 @@ struct mcount_arch_context {
- 	double d[ARCH_MAX_FLOAT_REGS];
- };
- 
--#define ARCH_PLT0_SIZE  32
-+#define ARCH_PLT0_SIZE  16
- #define ARCH_PLTHOOK_ADDR_OFFSET  0
- 
- 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 0000000000..bf997d6e4b
--- /dev/null
+++ b/meta-oe/recipes-devtools/uftrace/uftrace/0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch
@@ -0,0 +1,47 @@
+From 0851278471472c6be69a936cc3698aa50a646ffd Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Wed, 12 May 2021 17:06:31 +0900
+Subject: [PATCH] aarch64: Fix a plthook crash on aarch64 with binutils2.35.1
+ and later versions
+
+plthook is always crashed in Ubuntu 20.10 aarch64, which uses binutils 2.35.1.
+Since the `plt_entsize` is not automatically set in this version, we have to
+explicitly set the value.
+
+This patch fixes the following problem.
+
+  $ uname -m
+  aarch64
+
+  $ cat /etc/os-release | grep PRETTY_NAME
+  PRETTY_NAME="Ubuntu 20.10"
+
+  $ gcc -pg tests/s-abc.c
+
+  $ uftrace record a.out
+  WARN: child terminated by signal: 7: Bus error
+
+Fixed: #1254
+
+Upstream-status: submitted [Sent to https://github.com/namhyung/uftrace/pull/1248]
+
+Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
+---
+ utils/symbol.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/symbol.c b/utils/symbol.c
+index 29a1d295..01e52dab 100644
+--- a/utils/symbol.c
++++ b/utils/symbol.c
+@@ -560,6 +560,7 @@ int load_elf_dynsymtab(struct symtab *dsymtab, struct uftrace_elf_data *elf,
+ 	}
+ 	else if (elf->ehdr.e_machine == EM_AARCH64) {
+ 		plt_addr += 16;    /* AARCH64 PLT0 size is 32 */
++		plt_entsize = 16;
+ 	}
+ 	else if (elf->ehdr.e_machine == EM_386) {
+ 		plt_entsize += 12;
+-- 
+2.25.1
+
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 4b4fc831c3..a04fccca75 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
 PV .= "+git${SRCPV}"
 SRCREV = "d648bbffedef529220896283fb59e35531c13804"
 SRC_URI = "git://github.com/namhyung/${BPN} \
-           file://0001-Fix-error-on-aarch64-with-binutils2.35.1.patch \
+           file://0001-aarch64-Fix-a-plthook-crash-on-aarch64-with-binutils.patch \
            "
 S = "${WORKDIR}/git"
 
-- 
2.17.1


  parent reply	other threads:[~2021-05-26 11:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 11:52 [harkknott 00/23] Patch review Armin Kuster
2021-05-26 11:52 ` [harkknott 01/23] python3-cerberus: Upgrade 1.3.3 -> 1.3.4 Armin Kuster
2021-05-26 12:20   ` [oe] " Robert P. J. Day
2021-05-26 11:52 ` [harkknott 02/23] python3-robotframework: Upgrade 4.0.1 -> 4.0.2 Armin Kuster
2021-05-26 11:52 ` [harkknott 03/23] python3-django: upgrade 2.2.20 -> 2.2.22 Armin Kuster
2021-05-26 11:52 ` [harkknott 04/23] python3-django: upgrade 3.2 -> 3.2.2 Armin Kuster
2021-05-26 11:52 ` [harkknott 05/23] python3-rfc3339-validator: Upgrade 0.1.3 -> 0.1.4 Armin Kuster
2021-05-26 11:52 ` [harkknott 06/23] python3-pymongo: Upgrade 3.11.3 -> 3.11.4 Armin Kuster
2021-05-26 11:52 ` Armin Kuster [this message]
2021-05-26 11:52 ` [harkknott 08/23] exiv2: Fix CVE-2021-29457 Armin Kuster
2021-05-26 11:52 ` [harkknott 09/23] exiv2: Fix CVE-2021-29458 Armin Kuster
2021-05-26 11:52 ` [harkknott 10/23] exiv2: Fix CVE-2021-29463 Armin Kuster
2021-05-26 11:52 ` [harkknott 11/23] exiv2: Fix CVE-2021-3482 Armin Kuster
2021-05-26 11:52 ` [harkknott 12/23] exiv2: Fix CVE-2021-29464 Armin Kuster
2021-05-26 11:52 ` [harkknott 13/23] exiv2: Fix CVE-2021-29470 Armin Kuster
2021-05-26 11:52 ` [harkknott 14/23] exiv2: Fix CVE-2021-29473 Armin Kuster
2021-05-26 11:52 ` [harkknott 15/23] libsdl: Fix CVE-2019-13616 Armin Kuster
2021-05-26 11:52 ` [harkknott 16/23] hostapd: fix building with CONFIG_TLS=internal Armin Kuster
2021-05-26 11:52 ` [harkknott 17/23] opencv: remove tbb packageconfig for powerpc Armin Kuster
2021-05-26 11:52 ` [harkknott 18/23] sysdig: disable building for ppc Armin Kuster
2021-05-26 11:52 ` [harkknott 19/23] trace-cmd: Conflict resolution Armin Kuster
2021-05-26 11:52 ` [harkknott 20/23] postgresql: upgrade 13.2 -> 13.3 Armin Kuster
2021-05-26 11:52 ` [harkknott 21/23] opencv: Disable tbb on riscv/musl Armin Kuster
2021-05-26 11:52 ` [harkknott 22/23] libgtop: tidy up recipe Armin Kuster
2021-05-26 11:52 ` [harkknott 23/23] libgtop: fix do_compile error Armin Kuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1ae03d0964df5ff7cc1c37c1f95eae60dd07800.1622029873.git.akuster808@gmail.com \
    --to=akuster808@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.