# InstallRawStep: handle empty segments · gitcafe/zig

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

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

Visibility: public

Requested revision: e2a2e6c14fe181989187d6b59a79c5fc32961250

Requested commit: e2a2e6c14fe181989187d6b59a79c5fc32961250

Commit: e2a2e6c14fe181989187d6b59a79c5fc32961250

Tree: 1eb9ff3e9cadb2f8499e65e779090775607eef1d

Author: Jonathan Marler

Committer: Andrew Kelley

## Message

```
InstallRawStep: handle empty segments

This fixes InstallRawStep to handle the cases when there are empty segments (segments with no sections).  Before this change, if there was an empty segment with no sections, then the fixup of binaryOffsets is skipped.  This fixes that by looping through each segment until a non-empty one is found and then fixing up the sections. This fixed an issue I was having with InstallRawStep for a bootloader I'm writing.

```

## Parents

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

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