aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-09-02 10:10:45 +0930
committerAlan Modra <amodra@gmail.com>2020-09-02 16:30:43 +0930
commit4dda287bf650e908271a1d36ee1fca6dece4eb16 (patch)
tree13908453e9456a42249ce6d2137fe7894dddf38f
parent251150adb1ec4315f2ec66aceb289cc0ccbf7438 (diff)
downloadgdb-4dda287bf650e908271a1d36ee1fca6dece4eb16.zip
gdb-4dda287bf650e908271a1d36ee1fca6dece4eb16.tar.gz
gdb-4dda287bf650e908271a1d36ee1fca6dece4eb16.tar.bz2
ubsan: obj-macho.c:503 left shift cannot be represented
* config/obj-macho.c (obj_mach_o_zerofill): Correct type of constant shifted left.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/obj-macho.c2
2 files changed, 6 insertions, 1 deletions
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 <amodra@gmail.com>
+ * config/obj-macho.c (obj_mach_o_zerofill): Correct type of
+ constant shifted left.
+
+2020-09-02 Alan Modra <amodra@gmail.com>
+
* config/bfin-lex.l: Use an unsigned type for "value".
2020-09-02 Alan Modra <amodra@gmail.com>
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"),