[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 04:02:12 PST 2016


grimar added a comment.

In http://reviews.llvm.org/D15779#330019, @rafael wrote:

> One thing to keep in mind is the possibility of overflow (https://sourceware.org/bugzilla/show_bug.cgi?id=18591). No need to handle it now since llvm is also broken (pr	26208). I will try to fix the LLVM, at which point we should probably check for overflows in lld.


Regarding this I added error message to relocateOne() and that have 2 problems:

1. I just unsure how to find out the overflow and not convert mov->lea before we already applying relocations in relocateOne(). I need to find out the distance between symbol and instructions really early to use canOptimizeGotPcRel() method for avoiding create of GOT entries and so on.
2. I did not included the test for it, because it creates 4gb file, I am not sure that is good for test. But I used sample from https://sourceware.org/bugzilla/show_bug.cgi?id=18591 to check that error is displaying.


http://reviews.llvm.org/D15779





More information about the llvm-commits mailing list