# Fix the ELF base calculation · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/3e22077d46a02d1c4e02dd603b560978dc184a87)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 3e22077d46a02d1c4e02dd603b560978dc184a87

Requested commit: 3e22077d46a02d1c4e02dd603b560978dc184a87

Commit: 3e22077d46a02d1c4e02dd603b560978dc184a87

Tree: 471896cda055375d4c647e69c6ee2602665f4915

Author: LemonBoy

Committer: LemonBoy

## Message

```
Fix the ELF base calculation

Find the effective ELF load address in dl_iterate_phdr by computing the
difference between the in-memory phdr and its p_vaddr specified in the
ELF file.

This makes the dl_iterate_phdr test pass and restores the stack traces.

```

## Parents

- [0a84f85945a4d22c43b467c69ba7c26cd264659a](https://git.cafe/gitcafe/zig/commit/0a84f85945a4d22c43b467c69ba7c26cd264659a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/3e22077d46a02d1c4e02dd603b560978dc184a87?format=markdown)
