From ed609c4889d678bdc7f616d7d17494f19c735e90 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 1 Sep 2015 01:29:23 +0100 Subject: [PATCH] [efi] Fix debug directory size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/util/elf2efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2