From: Alan Modra Date: Wed, 2 Sep 2020 00:40:45 +0000 (+0930) Subject: ubsan: obj-macho.c:503 left shift cannot be represented X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4dda287bf650e908271a1d36ee1fca6dece4eb16;p=binutils-gdb.git ubsan: obj-macho.c:503 left shift cannot be represented * config/obj-macho.c (obj_mach_o_zerofill): Correct type of constant shifted left. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index bcc56ca3b25..3d1fdb2ae0d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-09-02 Alan Modra + + * config/obj-macho.c (obj_mach_o_zerofill): Correct type of + constant shifted left. + 2020-09-02 Alan Modra * config/bfin-lex.l: Use an unsigned type for "value". diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index 4b54a667a03..c3ce9993b3d 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -500,7 +500,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED) } size = exp.X_add_number; - size &= ((offsetT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1; + size &= ((valueT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1; if (exp.X_add_number != size || !exp.X_unsigned) { as_warn (_("size (%ld) out of range, ignored"),