From 4dda287bf650e908271a1d36ee1fca6dece4eb16 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 2 Sep 2020 10:10:45 +0930 Subject: ubsan: obj-macho.c:503 left shift cannot be represented * config/obj-macho.c (obj_mach_o_zerofill): Correct type of constant shifted left. --- gas/ChangeLog | 5 +++++ gas/config/obj-macho.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index bcc56ca..3d1fdb2 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 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". 2020-09-02 Alan Modra diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index 4b54a66..c3ce999 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"), -- cgit v1.1