From d0bd2dad6f56e642ccb69de65a74e011c52da5a3 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 31 Aug 2016 21:04:58 +0000 Subject: [PATCH] readelf: silence GCC 4.2.1 uninitialized variable warning Sponsored by: The FreeBSD Foundation --- contrib/elftoolchain/readelf/readelf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 2fb6d790728..2bf668ed22f 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -2831,6 +2831,8 @@ dump_rel(struct readelf *re, struct section *s, Elf_Data *d) type2 = (type >> 8) & 0xFF; type3 = (type >> 16) & 0xFF; type = type & 0xFF; + } else { + type2 = type3 = 0; } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s" @@ -2914,6 +2916,8 @@ dump_rela(struct readelf *re, struct section *s, Elf_Data *d) type2 = (type >> 8) & 0xFF; type3 = (type >> 16) & 0xFF; type = type & 0xFF; + } else { + type2 = type3 = 0; } if (re->options & RE_WW) printf("%16.16jx %16.16jx %-24.24s"