Browse Source

[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 years ago
parent
commit
ed609c4889
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/util/elf2efi.c

+ 1
- 1
src/util/elf2efi.c View File

@@ -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
 }

Loading…
Cancel
Save