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

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

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

Visibility: public

Requested revision: 25f1526fe6424cef156724977b75a5b80a3d5833

Requested commit: 25f1526fe6424cef156724977b75a5b80a3d5833

Commit: 25f1526fe6424cef156724977b75a5b80a3d5833

Tree: 5caffcd72f5baac64fe99482fc511db79525d77e

Author: Alexandre Janon

Committer: GitHub

## 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

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

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