# ElfDynLib: resolve lib from system paths · gitcafe/zig

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

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

Visibility: public

Requested revision: 2d7c26cc66facc401b37c26cb17bbae1da00d170

Requested commit: 2d7c26cc66facc401b37c26cb17bbae1da00d170

Commit: 2d7c26cc66facc401b37c26cb17bbae1da00d170

Tree: e46ecd9beaf22c0e80c24c1891377ef6822469ed

Author: Jari Vetoniemi

Committer: Andrew Kelley

## Message

```
ElfDynLib: resolve lib from system paths

Implements the base that should usually work that is
- Check LD_LIBRARY_PATH if the binary is no setuid setgid binary
- Check /lib, /usr/lib, in that order

The missing parts are:
- DT_RPATH and DT_RUNPATH handling from the calling executable
- Reading /etc/ld.so.cache

For more details check man page of dlopen(3)

```

## Parents

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

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