Does the FV image need to include absolute file paths in the binary? #6295
Unanswered
r1chard-lyu
asked this question in
Q&A
Replies: 1 comment
-
After tracing the build process, I discovered that the gcc output files include full file paths. These files are then compiled by GenFW into .efi files, and subsequently by GenSec into .pe32 files. Based on this, it can be inferred that the NB+filename in the .pe file is generated from the WORKSPACE path. Below is the build process after running the EDK2 build command: "gcc" -o /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/DEBUG/CpuDxe.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/DEBUG/CpuDxe.map,--whole-archive -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie -flto -Os -Wl,--start-group,@/home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/static_library_files.lst,--end-group -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -fstack-protector -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=CpuDxeStrings -mstack-protector-guard=global -m64 "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -fno-omit-frame-pointer -flto -DUSING_LTO -mno-mmx -mno-sse -D DISABLE_NEW_DEPRECATED_INTERFACES -D TDX_GUEST_SUPPORTED -D ENABLE_MD5_DEPRECATED_INTERFACES -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wl,--script=/home/richard/Workspace/edk2/BaseTools/Scripts/GccBase.lds -Wno-error
...
"GenFw" -e DXE_DRIVER -o /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/CpuDxe.efi /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/DEBUG/CpuDxe.dll
...
test -e /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/CpuDxe.efi && GenSec -s EFI_SECTION_PE32 -o /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/FV/Ffs/1A1E4886-9517-440e-9FDE-3BE44CEE2136CpuDxe/1A1E4886-9517-440e-9FDE-3BE44CEE2136SEC2.1.pe32 /home/richard/Workspace/edk2/Build/OvmfX64/DEBUG_GCC5/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/CpuDxe.efi Can we reduce the gcc output to exclude |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
After building the FV image, I noticed that the binary includes system file paths. Do these paths need to be compiled directly into the binary file?
For example, when I used hexdump on a PE file, I found the NB10 flag along with the system file path:
hexdump -C Build/OvmfX64/DEBUG_GCC5/FV/Ffs/1A1E4886-9517-440e-9FDE-3BE44CEE2136CpuDxe/1A1E4886-9517-440e-9FDE-3BE44CEE2136SEC2.1.pe32
The output shows:
Given that this system path is present, would it be possible to use relative paths (e.g., NB10 + relative paths) instead? Having system file paths in the FV image seems to be contributing to unnecessary space usage, as other files within the FV also contain system paths.
Has anyone encountered a similar issue or found a solution for reducing space usage related to these system paths in FV images?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions