[binutils-gdb] readelf.c gcc-4.9 compile error
Alan Modra via Binutils-cvs <[email protected]> Wed, 15 Jul 2026 22:07:07 +0000 (GMT)
| Newsgroups | gmane.comp.gnu.binutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4643afba9100939b16f50e13f085fc5bd0284930 commit 4643afba9100939b16f50e13f085fc5bd0284930 Author: Alan Modra <[email protected]> Date: Thu Jul 16 07:27:58 2026 +0930 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: --- binutils/readelf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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,