同步libunwind的修改,以修正mesa获取build id时会发生crash的问题

同步libunwind的修改,以修正mesa获取build id时会发生crash的问题

Signed-off-by: Diemit <598757652@qq.com>
This commit is contained in:
Diemit 2023-02-13 00:28:49 +00:00 committed by Gitee
parent a5825faf10
commit 074b1a3ce5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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;
}
}