From: Michael Brown Date: Tue, 1 Sep 2015 00:29:23 +0000 (+0100) Subject: [efi] Fix debug directory size X-Git-Tag: v1.20.1~714 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed609c4889d678bdc7f616d7d17494f19c735e90;p=thirdparty%2Fipxe.git [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 Signed-off-by: Michael Brown --- diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c index e68fa5d14..eb8f51ee5 100644 --- a/src/util/elf2efi.c +++ b/src/util/elf2efi.c @@ -600,7 +600,7 @@ create_debug_section ( struct pe_header *pe_header, const char *filename ) { debugdir = &(pe_header->nt.OptionalHeader.DataDirectory [EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]); debugdir->VirtualAddress = debug->hdr.VirtualAddress; - debugdir->Size = debug->hdr.Misc.VirtualSize; + debugdir->Size = sizeof ( contents->debug ); return debug; }