diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-30 20:27:27 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-30 20:49:32 +0930 |
commit | 54b8331d0b6b58d6f7256a22e7a9457d64891a43 (patch) | |
tree | cdefbe493ca686e133f7930eac7a026ef066da1c /binutils/readelf.c | |
parent | 2781f857e6a654521f0decebb809989b72afa2c5 (diff) | |
download | gdb-54b8331d0b6b58d6f7256a22e7a9457d64891a43.zip gdb-54b8331d0b6b58d6f7256a22e7a9457d64891a43.tar.gz gdb-54b8331d0b6b58d6f7256a22e7a9457d64891a43.tar.bz2 |
readelf: ubsan: shift exponent 32 is too large
When compiled on a 32-bit host, a temp var is too small for possible
64-bit values to be calculated.
* readelf.c (print_gnu_build_attribute_name): Make "bytes"
unsigned long long.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index f02848e..94aa876 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -19662,7 +19662,7 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote) while (bytes --) { - unsigned long byte = (* name ++) & 0xff; + unsigned long long byte = *name++ & 0xff; val |= byte << shift; shift += 8; |