PATCH: x86-64: Improve GOTPCREL relocation conversion

H.J. Lu hjl.tools@gmail.com
Tue Sep 5 18:04:00 GMT 2017


On Tue, Sep 5, 2017 at 10:21 AM, Steve Vormwald <sdvormwa@cray.com> wrote:
> That looks great.
>
> Steven Vormwald
> ________________________________________
> From: H.J. Lu <hjl.tools@gmail.com>
> Sent: Tuesday, September 5, 2017 12:19:52 PM
> To: Steve Vormwald
> Cc: Binutils
> Subject: Re: Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions with binutils 2.24/2.25?
>
> On Tue, Sep 5, 2017 at 9:51 AM, Steve Vormwald <sdvormwa@cray.com> wrote:
>> I don't see any problems with adding an option to control this behavior.  The current error message is very confusing though when the object file in question doesn't contain any R_X86_64_PC32 relocations.  Is it possible to note that the error is/may be due to such a transformation, or at least hint that the user might try the --no-relax option?
>>
>
> Good point.  How this?
>
> [hjl@gnu-6 pr18591]$ cat x.S
> .hidden foo
> .comm pad,0x80000000,8
> .comm foo,8,8
> .text
> .globl bar
> .type bar, @function
> bar:
> movq foo@GOTPCREL(%rip), %rax
> [hjl@gnu-6 pr18591]$ make
> gcc    -c -o x.o x.S
> ./ld -z max-page-size=0x200000 -shared -o x.so x.o
> ./ld: failed to convert GOTPCREL relocation; relink with --no-releax
> make: *** [Makefile:25: x.so] Error 1
> [hjl@gnu-6 pr18591]$


This is the patch I am checking in.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-64-Improve-GOTPCREL-relocation-conversion.patch
Type: text/x-patch
Size: 10558 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170905/8ff69ab2/attachment.bin>


More information about the Binutils mailing list