This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Cast shift expression
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 7 Apr 2015 23:20:48 +0930
- Subject: Cast shift expression
- Authentication-results: sourceware.org; auth=none
We are hardly likely to have alignment larger than 2G, but may as well
ensure the shift is using the same type as dataseg.base.
PR ld/18176
* ldlang.c (lang_size_sections): Cast shift expression.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 13e7b1a..cbd5bc3 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -5424,7 +5424,7 @@ lang_size_sections (bfd_boolean *relax, bfd_boolean check_regions)
between sections won't change. This is better than
simply subtracting 1 << max_alignment_power which is
what we used to do here. */
- expld.dataseg.base &= ~((1 << max_alignment_power) - 1);
+ expld.dataseg.base &= ~(((bfd_vma) 1 << max_alignment_power) - 1);
/* It doesn't make much sense to go lower than the initial
base. That can only increase padding. */
if (expld.dataseg.base < initial_base)
--
Alan Modra
Australia Development Lab, IBM