# zld: introduce Stub.zig which represents parsed stub file · gitcafe/zig

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

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

Visibility: public

Requested revision: bc78b02c04143b7e1b32aceacdcf44130026a7a7

Requested commit: bc78b02c04143b7e1b32aceacdcf44130026a7a7

Commit: bc78b02c04143b7e1b32aceacdcf44130026a7a7

Tree: d0d20c362872c1dea62a50f694e309ca7c685645

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
zld: introduce Stub.zig which represents parsed stub file

Instead of trying to fit a stub file into the frame of a Dylib struct,
I think it makes more sense to keep them as separate entities with
possibly shared interface (which would be added in the future).

This cleaned up a lot of logic in Dylib as well as Stub. Also, while
here I've made creating actual *Symbols lazy in the sense Dylib and
Stub only store hash maps of symbol names that they expose but we
defer create and referencing given dylib/stub until link time when
a symbol is actually referenced. This should reduce memory usage
and speed things up a bit.

```

## Parents

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

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