From 074b1a3ce5ceba50e975513cd058bce7b0f6d44e Mon Sep 17 00:00:00 2001 From: Diemit <598757652@qq.com> Date: Mon, 13 Feb 2023 00:28:49 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5libunwind=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E4=BB=A5=E4=BF=AE=E6=AD=A3mesa=E8=8E=B7?= =?UTF-8?q?=E5=8F=96build=20id=E6=97=B6=E4=BC=9A=E5=8F=91=E7=94=9Fcrash?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E5=90=8C=E6=AD=A5libunwind?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=BB=A5=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?mesa=E8=8E=B7=E5=8F=96build=20id=E6=97=B6=E4=BC=9A=E5=8F=91?= =?UTF-8?q?=E7=94=9Fcrash=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Diemit <598757652@qq.com> --- src/util/build_id.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/build_id.c b/src/util/build_id.c index 8b4f8f30afb..9804d787c6e 100644 --- a/src/util/build_id.c +++ b/src/util/build_id.c @@ -92,6 +92,12 @@ build_id_find_nhdr_callback(struct dl_phdr_info *info, size_t size, void *data_) ALIGN_POT(note->nhdr.n_namesz, 4) + ALIGN_POT(note->nhdr.n_descsz, 4); note = (struct build_id_note *)((char *)note + offset); + + // 05 00 00 00 04 00 00 00 4f 48 4f 53 00 01 00 00 00 00 00 00 + if (note->nhdr.n_type == 0x534f484f && note > 20) { + // .note.ohos.ident is not a valid PT_NOTE section, use offset in section header later + offset = 20; + } len -= offset; } }