aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2023-12-05 15:49:17 +0000
committerMichael Brown <mcb30@ipxe.org>2023-12-05 15:49:17 +0000
commitf22879ca994aedd2667bb0c73ebce505bf5f8cef (patch)
treeaf4fc75e8998c6057c1a0acc2868064a73f3cd87
parent98dd25a3bb2d3aafa71f088cbabf89418a783132 (diff)
downloadipxe-f22879ca994aedd2667bb0c73ebce505bf5f8cef.zip
ipxe-f22879ca994aedd2667bb0c73ebce505bf5f8cef.tar.gz
ipxe-f22879ca994aedd2667bb0c73ebce505bf5f8cef.tar.bz2
[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. This mirrors wimboot commit f52c3ff ("[efi] Allow compiling elf2efi with clang"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/util/elf2efi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c
index a3aff8f..acde75c 100644
--- a/src/util/elf2efi.c
+++ b/src/util/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 */