[PATCH] D23565: [ELF] Linkerscript: fix relocation offsets

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 05:28:32 PDT 2016


My version of fix for that is D23655?. Did not do perfomance tests yet, just want to show concept first.


Best regards,
George.
________________________________
От: Rui Ueyama <ruiu at google.com>
Отправлено: 18 августа 2016 г. 4:51
Кому: reviews+D23565+public+28ea864e67ee3b0f at reviews.llvm.org
Копия: evgeny777; wallbraker at gmail.com; Sean Silva; llvm-commits; Davide Italiano; Ed Maste; Igor Kudrin; George Rimar; Adhemerval Zanella
Тема: Re: [PATCH] D23565: [ELF] Linkerscript: fix relocation offsets

I don't think this would slow down the relocation process because the number of function calls will be the same. A quick performance test would be appreciated, though.

On Wed, Aug 17, 2016 at 6:28 PM, Sean Silva <chisophugis at gmail.com<mailto:chisophugis at gmail.com>> wrote:
silvas added a comment.

In https://reviews.llvm.org/D23565#518608, @ruiu wrote:

> Eugene,
>
> Thank you for your description. I agree that the order we compute offset is the cause of the problem. In scanRelocs, we compute a symbol offset for each symbol and assign it to a local variable `Offset` -- but that value may change if linker scripts are in use. That value is computed too early, and we want to do it lazily.
>
> As to this patch, I'd refactor instead of applying a quick fix. It doesn't seem hard to do. For `C.Relocations` in `scanRelocs`, we are able to not store `Offset` to them because it can be computed from `Body`.


This makes sense, but it may have performance implications to get the offset later (at least more pointer chasing for data that we already had in cache in scanRelocs); it will need to be measured to make sure that we implement it without costing too much performance.


https://reviews.llvm.org/D23565




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160818/cdc6a5b9/attachment.html>


More information about the llvm-commits mailing list