From: Alan Modra Date: Wed, 15 Jul 2026 21:57:58 +0000 (+0930) Subject: readelf.c gcc-4.9 compile error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4643afba9100939b16f50e13f085fc5bd0284930;p=thirdparty%2Fbinutils-gdb.git readelf.c gcc-4.9 compile error gcc-4.9 doesn't like an empty initialiser. binutils/readelf.c: In function ‘process_relocs’: binutils/readelf.c:10229:5: error: missing initializer for field ‘sh_name’ of ‘Elf_Internal_Shdr’ [-Werror=missing-field-initializers] Elf_Internal_Shdr section = {}; * readelf.c (process_relocs): Avoid gcc-4.9 compile error. --- diff --git a/binutils/readelf.c b/binutils/readelf.c index f18fbfbe8b9..a52fe2b8d63 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -10226,12 +10226,12 @@ process_relocs (Filedata * filedata) is passed to readelf. */ uint64_t num_reloc; uint64_t *relrs = NULL; - Elf_Internal_Shdr section = {}; - section.sh_offset - = filedata->dynamic_info[DT_RELR]; - section.sh_size = rel_size; - section.sh_entsize = rel_entsz; - section.sh_type = SHT_RELR; + Elf_Internal_Shdr section = { + .sh_type = SHT_RELR, + .sh_offset = filedata->dynamic_info[DT_RELR], + .sh_size = rel_size, + .sh_entsize = rel_entsz + }; validate_section_info (§ion, NULL, 0, filedata); num_reloc = count_relr_relocations (filedata, §ion,