From: Alan Modra Date: Sun, 19 Dec 2021 01:48:50 +0000 (+1030) Subject: readelf: avoid a possible divide by zero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=682351b932ba546b4451560917e819681c808f52;p=binutils-gdb.git readelf: avoid a possible divide by zero * readelf.c (process_section_headers): Check SHT_RELR entsize. --- diff --git a/binutils/readelf.c b/binutils/readelf.c index 2225b7d9046..990b7597dd3 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -7093,6 +7093,10 @@ process_section_headers (Filedata * filedata) warn (_("Section '%s': zero-sized relocation section\n"), name); break; + case SHT_RELR: + CHECK_ENTSIZE (section, i, Relr); + break; + case SHT_NOTE: case SHT_PROGBITS: /* Having a zero sized section is not illegal according to the