Skip to content

[Rebase&FF] pecoff: add get_section functionality#1409

Merged
Javagedes merged 2 commits intoOpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/section-parse
Apr 9, 2026
Merged

[Rebase&FF] pecoff: add get_section functionality#1409
Javagedes merged 2 commits intoOpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/section-parse

Conversation

@Javagedes
Copy link
Copy Markdown
Contributor

@Javagedes Javagedes commented Mar 16, 2026

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_section and 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.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

CI continues to work. Boot on Q35.

Integration Instructions

N/A

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented Mar 16, 2026

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/24203186907

Boot Time to EFI Shell

Platform Elapsed
Q35 (Linux Host) 27.8s
SBSA (Linux Host) 1m 1s

Dependencies

Repository Ref
patina 660746f
patina-dxe-core-qemu 8a232bb
patina-fw-patcher b08d6ff
patina-qemu firmware v3.0.0
patina-qemu build script efe1fb2

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added impact:non-functional Does not have a functional impact impact:testing Affects testing labels Mar 16, 2026
@Javagedes Javagedes force-pushed the personal/joeyvagedes/section-parse branch from 23caab7 to 5e68499 Compare March 16, 2026 21:00
Comment thread patina_dxe_core/src/pecoff.rs Outdated
Comment thread patina_dxe_core/src/pecoff.rs Outdated
Comment thread patina_dxe_core/src/pecoff.rs Outdated
@Javagedes Javagedes force-pushed the personal/joeyvagedes/section-parse branch from 5e68499 to 7e819dc Compare March 16, 2026 21:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 83.54430% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
patina_dxe_core/src/pecoff.rs 83.54% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.
@Javagedes Javagedes force-pushed the personal/joeyvagedes/section-parse branch from 7e819dc to 80f2d82 Compare April 9, 2026 15:38
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.
@Javagedes Javagedes merged commit 769ae4d into OpenDevicePartnership:main Apr 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact impact:testing Affects testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants