This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: PATCH: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions with binutils 2.24/2.25?
- From: Steve Vormwald <sdvormwa at cray dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 25 Jun 2015 13:13:06 +0000
- Subject: RE: PATCH: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions with binutils 2.24/2.25?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOr0gUErDU+6zsRApV7MK_=hFYj71oaXNRSjvnDb2AHXJA at mail dot gmail dot com>,<CAMe9rOovvU2B5X1_ARot-_JVivMyQSWYdyfQ8mJk5qVDONaBXg at mail dot gmail dot com>
Thanks. This patch fixes the problem for us.
Steven Vormwald
________________________________________
From: H.J. Lu [hjl.tools@gmail.com]
Sent: Wednesday, June 24, 2015 5:02 PM
To: Steve Vormwald; Binutils
Subject: Re: PATCH: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions with binutils 2.24/2.25?
On Wed, Jun 24, 2015 at 10:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Jun 24, 2015 at 4:26 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> I opened:
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=18591
>>
>> H.J.
>>
>
> I checked in this patch to fix it. Please it out.
>
> Thanks.
>
> H.J.
> ---
> When converting "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg"
> with R_X86_64_PC32 relocation, it may overflow if the target section
> is more than 2GB away. This patch estimates distance between mov
> instruction and the target section. We convert R_X86_64_GOTPCREL to
> R_X86_64_PC32 only if their distance is less than 2GB.
>
> PR ld/18591
> * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
> R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
> overflow.
I checked in this patch to silence older GCC warning.
--
H.J.