1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
Subject: Fix build errors with gcc-6. Closes: #811954
Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -147,7 +147,7 @@
*length_return = num_read;
if (sign && (shift < 8 * sizeof (result)) && (byte & 0x40))
- result |= -1L << shift;
+ result |= ((1L << shift) - 1) ^ -1L;
return result;
}
--- a/gas/read.c
+++ b/gas/read.c
@@ -4968,7 +4968,7 @@
{
/* Sign-extend VAL. */
if (val & (1 << (loaded - 1)))
- val |= ~0 << loaded;
+ val |= ((1L << loaded) - 1) ^ -1L;
if (orig)
*p = val & 0x7f;
p++;
--- a/gas/write.c
+++ b/gas/write.c
@@ -2236,7 +2236,7 @@
relax_addressT mask;
relax_addressT new_address;
- mask = ~((~0) << alignment);
+ mask = ((1L << alignment) - 1);
new_address = (address + mask) & (~mask);
#ifdef LINKER_RELAXING_SHRINKS_ONLY
if (linkrelax)
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -2630,7 +2630,7 @@
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & (((1 << align) - 1) ^ -1));
}
/* If you define this macro, it should return the offset between the
|