-
-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MachO::Binary::extend_section fix sorting order
If there are empty sections and non-empty section at the same offset, we want to shift only empty sections. The expected behavior is that we sort sections in ascending order, and then `sections_to_shift` is trimmed, such that the last element becomes `section`. Previously, we were sorting in descending order, while keeping empty sections in the same order. Due to this we were doing trimming incorrectly. Rework macho/test_builder.py::test_extend_section The previous implementation of the test was expecting unsupported behavior from LIEF. LIEF currently does not support arbitrary calls to add_section and extend_section and keeping the layout of the binary correct. Currently it is responsibility of a user to ensure that the final layout of the binary is well-formed. This patch splits test into two cases: 1. Repeated calls to add_section followed by extend_section using different alignment values. 2. Multiple calls to add_section and then multiple calls to extend_section using the same alignment values.
- Loading branch information
1 parent
ca6068a
commit 60de925
Showing
2 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters