summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@amadeus.com>2021-01-28 13:41:20 +0000
committerDave Watson <dade.watson@gmail.com>2021-02-17 10:03:57 -0800
commit8f6de116e2df0207dc35a64befe03fbfa3c874fb (patch)
treeeeed00f16c053fc631a83bcc72d64ab7333f7045 /src
parentd22916ff196886a3ba518ba9d75113be28c228f0 (diff)
downloadlibunwind-8f6de116e2df0207dc35a64befe03fbfa3c874fb.tar.gz
Fix elf get_load_offset when the binary was linked by lld: return the right offet.
Diffstat (limited to 'src')
-rw-r--r--src/elfxx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/elfxx.c b/src/elfxx.c
index c6baa098..d6724c3a 100644
--- a/src/elfxx.c
+++ b/src/elfxx.c
@@ -177,7 +177,7 @@ elf_w (get_load_offset) (struct elf_image *ei, unsigned long segbase,
for (i = 0; i < ehdr->e_phnum; ++i)
if (phdr[i].p_type == PT_LOAD && (phdr[i].p_offset & pagesize_aligment_mask) == mapoff)
{
- offset = segbase - phdr[i].p_vaddr;
+ offset = segbase - phdr[i].p_vaddr + (phdr[i].p_offset & (~pagesize_aligment_mask))
break;
}