@@ -349,21 +349,22 @@ static void pe_locate_sections(
349349
350350 if (!firmware_devicetree_exists ()) {
351351 /* Find HWIDs table and search for the current device */
352- PeSectionVector hwids_section = {};
352+ static const char * const hwid_section_names [] = { ".hwids" , NULL };
353+ PeSectionVector hwids_section [1 ] = {};
353354
354355 pe_locate_sections_internal (
355356 section_table ,
356357 n_section_table ,
357- ( const char * const []) { ".hwids" , NULL } ,
358+ hwid_section_names ,
358359 validate_base ,
359360 /* device_table */ NULL ,
360361 /* device */ NULL ,
361- & hwids_section );
362+ hwids_section );
362363
363- if (PE_SECTION_VECTOR_IS_SET (& hwids_section )) {
364- hwids = (const uint8_t * ) SIZE_TO_PTR (validate_base ) + hwids_section .memory_offset ;
364+ if (PE_SECTION_VECTOR_IS_SET (hwids_section )) {
365+ hwids = (const uint8_t * ) SIZE_TO_PTR (validate_base ) + hwids_section [ 0 ] .memory_offset ;
365366
366- EFI_STATUS err = chid_match (hwids , hwids_section .memory_size , DEVICE_TYPE_DEVICETREE , & device );
367+ EFI_STATUS err = chid_match (hwids , hwids_section [ 0 ] .memory_size , DEVICE_TYPE_DEVICETREE , & device );
367368 if (err != EFI_SUCCESS ) {
368369 log_error_status (err , "HWID matching failed, no DT blob will be selected: %m" );
369370 hwids = NULL ;
@@ -390,15 +391,15 @@ static uint32_t get_compatibility_entry_address(const DosFileHeader *dos, const
390391 assert (pe );
391392
392393 static const char * const section_names [] = { ".compat" , NULL };
393- PeSectionVector vector = {};
394+ PeSectionVector vector [ 1 ] = {};
394395 pe_locate_sections (
395396 (const PeSectionHeader * ) ((const uint8_t * ) dos + section_table_offset (dos , pe )),
396397 pe -> FileHeader .NumberOfSections ,
397398 section_names ,
398399 PTR_TO_SIZE (dos ),
399- & vector );
400+ vector );
400401
401- if (!PE_SECTION_VECTOR_IS_SET (& vector )) /* not found */
402+ if (!PE_SECTION_VECTOR_IS_SET (vector )) /* not found */
402403 return 0 ;
403404
404405 typedef struct {
@@ -408,7 +409,7 @@ static uint32_t get_compatibility_entry_address(const DosFileHeader *dos, const
408409 uint32_t entry_point ;
409410 } _packed_ LinuxPeCompat1 ;
410411
411- size_t addr = vector .memory_offset , size = vector .memory_size ;
412+ size_t addr = vector [ 0 ] .memory_offset , size = vector [ 0 ] .memory_size ;
412413
413414 while (size >= sizeof (LinuxPeCompat1 ) && addr % alignof(LinuxPeCompat1 ) == 0 ) {
414415 const LinuxPeCompat1 * compat = (const LinuxPeCompat1 * ) ((const uint8_t * ) dos + addr );
0 commit comments