[PATCH] [RFC][PATCH] Minor opt to access pointers to globals via pcrel GOT entries

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Fri Jan 23 11:58:16 PST 2015


On Fri, Jan 23, 2015 at 5:37 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> > Note that there is no +4 in test2.s.
>>
>> GOTPCREL relocations work differently in ELF and don't require this hack.
>>
>
> Cool. Do you know if it is documented somewhere?

Not that I'm aware of, discovered this by accident =(

> In any case, test.s and test2.s versions of X86_64 OS X are attached, and it
> works with the +4 :-)

Cool.
FWIW, I've attached the examples I've used to test it on darwin,
similar to yours, but using the tables from the testcase in the patch.

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.s
Type: application/octet-stream
Size: 1050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150123/72e1820e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.s
Type: application/octet-stream
Size: 871 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150123/72e1820e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150123/72e1820e/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extfoo.c
Type: text/x-csrc
Size: 18 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150123/72e1820e/attachment-0001.c>


More information about the llvm-commits mailing list