From 92d1b7b6ec83ee595a6c7cdfeaa09198aa6ed662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Wed, 26 Feb 2025 09:28:11 -0800 Subject: [PATCH] Use file size in gsym-in-apk example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gsym-in-apk example still uses the memory size in the file offse to virtual offset translation. Similar to what we did in commit 1a4e10740652 ("Use file size in file offset -> virtual offset translation") switch to using the file size instead. Signed-off-by: Daniel Müller --- examples/gsym-in-apk/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gsym-in-apk/main.rs b/examples/gsym-in-apk/main.rs index 5529a824..f8dec84f 100644 --- a/examples/gsym-in-apk/main.rs +++ b/examples/gsym-in-apk/main.rs @@ -60,7 +60,7 @@ impl TranslateFileOffset for CustomApkResolver { ); let addr = phdrs.iter().find_map(|phdr| { if phdr.p_type == elf64::program_header::PT_LOAD { - if (phdr.p_offset..phdr.p_offset + phdr.p_memsz).contains(&file_offset) { + if (phdr.p_offset..phdr.p_offset + phdr.p_filesz).contains(&file_offset) { return Some((file_offset - phdr.p_offset + phdr.p_vaddr) as Addr) } }