From f52c3ff4bc41352b4a65b3c4c7d973b57850dcd3 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 5 Dec 2023 16:37:21 +0100 Subject: [PATCH] [efi] Allow compiling elf2efi with clang The clang compiler does not (and apparently will not ever) allow for variable-length arrays within structs. Work around this limitation by using a fixed-length array to hold the PDB filename in the debug section. Signed-off-by: Michael Brown --- src/elf2efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elf2efi.c b/src/elf2efi.c index ac61b88..1eb3e28 100644 --- a/src/elf2efi.c +++ b/src/elf2efi.c @@ -961,7 +961,7 @@ create_debug_section ( struct pe_header *pe_header, const char *filename ) { struct { EFI_IMAGE_DEBUG_DIRECTORY_ENTRY debug; EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY rsds; - char name[ strlen ( filename ) + 1 ]; + char name[32]; } *contents; /* Allocate PE section */