# link.Elf: fix static PIE · gitcafe/zig

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

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

Visibility: public

Requested revision: 4e45362529e05ba1be44fab48bc3469f5bb6492d

Requested commit: 4e45362529e05ba1be44fab48bc3469f5bb6492d

Commit: 4e45362529e05ba1be44fab48bc3469f5bb6492d

Tree: b8d161294f8519ed8471b7cdb84ff2aa037e4368

Author: mlugg

Committer: mlugg

## Message

```
link.Elf: fix static PIE

We mustn't emit the DT_PLTGOT entry in `.dynamic` in a statically-linked
PIE, because there's no dl to relocate it (and `std.pie.relocate`, or
the PIE relocator in libc, won't touch it). In that case, there cannot
be any PLT entries, so there's no point emitting the `.got.plt` section
at all. If we just don't create that section, `link.Elf` already knows
not to add the DT_PLTGOT entry to `.dynamic`.

Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>

```

## Parents

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

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