Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 797792681137b0971ec81e495807b470671ba518
      
https://github.com/tianocore/edk2/commit/797792681137b0971ec81e495807b470671ba518
  Author: Yuwei Chen <[email protected]>
  Date:   2025-11-23 (Sun, 23 Nov 2025)

  Changed paths:
    M BaseTools/Source/Python/FMMT/README.md
    M BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py
    M BaseTools/Source/Python/FMMT/core/BiosTree.py
    M BaseTools/Source/Python/FMMT/core/BiosTreeNode.py
    M BaseTools/Source/Python/FMMT/core/FMMTParser.py
    M BaseTools/Source/Python/FMMT/core/FvHandler.py
    M BaseTools/Source/Python/FirmwareStorageFormat/Common.py
    M BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py
    A BaseTools/Source/Python/FirmwareStorageFormat/PECOFFHeader.py
    M BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py

  Log Message:
  -----------
  BaseTools: Enable FMMT Rebase function

This patch adds and improves the rebase functionality
for firmware images (PE/COFF/TE) in the FMMT tool.
Key features include:

1.Automatically rebases PE/COFF/TE images within FFS files
when the firmware volume (FV) layout is adjusted or FFS files
are moved, ensuring correct loading and execution at new addresses.
2.Implements recursive rebase logic for nested sections,
guaranteeing all relevant images are properly relocated.
3.Adds support for rebasing subsequent FFS files within the same FV,
enhancing compatibility and stability during firmware layout changes.
4.Core code changes are mainly in FvHandler.py, BiosTreeNode.py,
and BinaryFactoryProduct.py, covering rebase flag detection, address 
calculation,
and actual relocation operations.
5.This feature improves the flexibility of firmware space management
and enhances the automation and reliability of the FMMT tool.

Co-Auther: Ashraf Ali S <[email protected]>
Signed-off-by: Yuwei Chen <[email protected]>


  Commit: d8a171b895e3c79002fa7d991de8bf24cfa32851
      
https://github.com/tianocore/edk2/commit/d8a171b895e3c79002fa7d991de8bf24cfa32851
  Author: Yuwei Chen <[email protected]>
  Date:   2025-11-23 (Sun, 23 Nov 2025)

  Changed paths:
    M BaseTools/Source/Python/FMMT/core/BiosTreeNode.py
    M BaseTools/Source/Python/FMMT/core/FvHandler.py

  Log Message:
  -----------
  BaseTools: Enhance FMMT rebase feature with FFS type check

1.Add FFS file type check: Only allow rebase operation for
EFI_FV_FILETYPE_SECURITY_CORE, EFI_FV_FILETYPE_PEI_CORE,
EFI_FV_FILETYPE_DXE_CORE, EFI_FV_FILETYPE_PEIM, EFI_FV_FILETYPE_DRIVER,
EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER,EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
types, improving safety and compliance.
2.Automatically detect and complete the PE/COFF or TE image
relocation table (reloc section) to ensure integrity and compatibility
of the rebase operation.
3.After rebase, automatically update FFS checksum and FV header
information to ensure correct data structure.
4.Support recursive processing for nested FVs, ensuring all related FFS
files' PE/TE images are properly rebased and reloc tables are completed.
5.Use table-driven architecture for relocation types, making it easier to
extend to more platforms.
6.Improve error handling and logging for better robustness and
maintainability.

Please attention, only IA32 and X64 PE/COFF image are supported now.
For other Arch, will support it after testing.

Signed-off-by: Yuwei Chen <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/7e9901887e0a...d8a171b895e3

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to