# Fix ELF alignment for freestanding targets \(\#19766\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 704f8f4013dee59c899f8900ee2289983bb9d5da

Requested commit: 704f8f4013dee59c899f8900ee2289983bb9d5da

Commit: 704f8f4013dee59c899f8900ee2289983bb9d5da

Tree: 7ee0eeed0512a41213bd023241f722fab224c0dd

Author: Alexandre Janon

Committer: Andrew Kelley

## Message

```
Fix ELF alignment for freestanding targets (#19766)

* Fix the ELF binaries for freestanding target created with the self-hosted linker.

    The ELF specification (generic ABI) states that ``loadable process segments must have congruent
    values for p_vaddr and p_offset, modulo the page size''. Linux refuses to load binaries that
    don't meet this requirement (execve() fails with EINVAL).
```

## Parents

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

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