浏览代码

[efi] Fix debug directory size

The debug directory size specified in the data directory should cover
only the EFI_IMAGE_DEBUG_DIRECTORY_ENTRY structure, not the whole of
the .debug section.

Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 年前
父节点
当前提交
ed609c4889
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/util/elf2efi.c

+ 1
- 1
src/util/elf2efi.c 查看文件

@@ -600,7 +600,7 @@ create_debug_section ( struct pe_header *pe_header, const char *filename ) {
600 600
 	debugdir = &(pe_header->nt.OptionalHeader.DataDirectory
601 601
 		     [EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
602 602
 	debugdir->VirtualAddress = debug->hdr.VirtualAddress;
603
-	debugdir->Size = debug->hdr.Misc.VirtualSize;
603
+	debugdir->Size = sizeof ( contents->debug );
604 604
 
605 605
 	return debug;
606 606
 }

正在加载...
取消
保存