From ed609c4889d678bdc7f616d7d17494f19c735e90 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 1 Sep 2015 01:29:23 +0100 Subject: [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 --- src/util/elf2efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c index e68fa5d1..eb8f51ee 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; } -- cgit v1.2.3-55-g7522