[Rebase&FF] pecoff: add get_section functionality#1409
Merged
Javagedes merged 2 commits intoOpenDevicePartnership:mainfrom Apr 9, 2026
Merged
[Rebase&FF] pecoff: add get_section functionality#1409Javagedes merged 2 commits intoOpenDevicePartnership:mainfrom
get_section functionality#1409Javagedes merged 2 commits intoOpenDevicePartnership:mainfrom
Conversation
Contributor
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/24203186907 Boot Time to EFI Shell
Dependencies
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
23caab7 to
5e68499
Compare
makubacki
approved these changes
Mar 16, 2026
5e68499 to
7e819dc
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
cfernald
approved these changes
Mar 17, 2026
Create a new function called `get_section` that returns the byte slice representing the requested PE/COFF section from the specified image. This logic is directly pulled from the `load_resource_section` and moved into it's own function.
7e819dc to
80f2d82
Compare
This commit removes an allocation done in `get_section` by comparing the bytes of the two string, rather than allocating a new string based off the bytes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This commit pulls the functionality for getting a sub-slice that represents a particular PE/COFF section from an unloaded image out of
load_resource_sectionand makes it a re-usable function. It also removes an unnecessary allocation when comparing section names.NOTE: The git diff does not do this change justice due to each line's "depth" being adjusted. There is no change in logic, except for the second commit, which removes the allocation.
How This Was Tested
CI continues to work. Boot on Q35.
Integration Instructions
N/A