summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-04-22 22:23:18 +0200
committerMark Wielaard <[email protected]>2014-04-24 11:33:54 +0200
commit7c757b33fd6c975f1f0976eaa9e971432cc031b2 (patch)
treed7a2c0a84785973d214db0fc5ca4742996cef5db /src/readelf.c
parenteb4da48fa48c69e303b410c4bf7dd7bea8108406 (diff)
readelf.c (print_gdb_index_section): Use unsigned int for 31 bits left shift.
Found by gcc -fsanitize=undefined. left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/readelf.c b/src/readelf.c
index 8a9543dc..da1bf73a 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -7827,7 +7827,7 @@ print_gdb_index_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
cu_kind = read_4ubyte_unaligned (dbg, readcus);
cu = cu_kind & ((1 << 24) - 1);
kind = (cu_kind >> 28) & 7;
- is_static = cu_kind & (1 << 31);
+ is_static = cu_kind & (1U << 31);
if (cu > cu_nr - 1)
printf ("%" PRId32 "T", cu - (uint32_t) cu_nr);
else