This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: 32 bit host build failure from peXXigen.c
- From: Nicholas Clifton <nickc at redhat dot com>
- To: Edjunior Barbosa Machado <emachado at linux dot vnet dot ibm dot com>
- Cc: Doug Evans <dje at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 25 Apr 2014 14:06:46 +0100
- Subject: Re: 32 bit host build failure from peXXigen.c
- Authentication-results: sourceware.org; auth=none
- References: <CADPb22TrR1JijxeY0QSyusX0R4hA5c3rx1QfUmOGW_HVGfG6AA at mail dot gmail dot com> <535691A7 dot 1010701 at redhat dot com> <5358200E dot 10801 at linux dot vnet dot ibm dot com> <53592942 dot 5020102 at redhat dot com> <53593A83 dot 1040806 at linux dot vnet dot ibm dot com>
Hi Edjunior,
Thank you for the patch, but unfortunately it still fails on my build
Ho hum. OK - I have another patch for you to try...
I'm using gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5).
Ah - unfortunately I do not have access to a system with this version of
gcc.
Please try the attached patch and let me know if I have gotten it right
this time. :-)
Cheers
Nick
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index d462753..dc45daf 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -236,7 +236,15 @@ _bfd_XXi_swap_sym_out (bfd * abfd, void * inp, void * extp)
reduce the absolute value to < 1^32, and then transforming the
symbol into a section relative symbol. This of course is a hack. */
if (sizeof (in->n_value) > 4
+ /* GCC 4.6.x erroneously complains about the next test always being
+ false when compiled on a 32-bit host. (The sizeof test above
+ should have made the warning unnecessary). Hence we have to
+ predicate the test. It should not matter if the test is omitted
+ since the worst that can happen is that some absolute symbols
+ are needlessly converted to equivalent section relative symbols. */
+#if defined BFD64 || ! defined __GNUC__ || __GNUC__ > 4 || __GNUC_MINOR__ > 6
&& in->n_value > ((1ULL << 32) - 1)
+#endif
&& in->n_scnum == -1)
{
asection * sec;