Quellcode durchsuchen

[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 vor 9 Jahren
Ursprung
Commit
ed609c4889
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      src/util/elf2efi.c

+ 1
- 1
src/util/elf2efi.c Datei anzeigen

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

Laden…
Abbrechen
Speichern