Skip to content

Commit

Permalink
[efi] Allow compiling elf2efi with clang
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mcb30 committed Dec 5, 2023
1 parent 2007159 commit f52c3ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elf2efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f52c3ff

Please sign in to comment.