[PATCH] D35371: [COFF] Bounds check relocations

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 12:53:37 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D35371#808377, @ruiu wrote:

> This adds one virtual function call for each relocation. I believe it's negligible, but can you run the linker with and without this patch to see if this is fine?


Hm, I hadn't noticed that. We know we're dealing with a SectionChunk, so the call doesn't have to be virtual. Maybe we should mark SectionChunk final to get that benefit elsewhere.



================
Comment at: lld/COFF/Chunks.cpp:218
+    // beginning of the following input section.
+    if (Rel.VirtualAddress >= getSize())
+      fatal("relocation points beyond the end of its parent section");
----------------
grandinj wrote:
> could hoist getSize() outside the loop?
We should just do that. Even if we inlined the implementation, it's a load.


https://reviews.llvm.org/D35371





More information about the llvm-commits mailing list