[PATCH] D21887: Reduce number of getOffset calls.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 00:39:03 PDT 2016


ruiu created this revision.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.

Mergeable sections usually don't have relocations, so this piece
of code is being used to skip dead EH frames. This patch make it
explicit so that we don't needlessly spend time on getOffset.

http://reviews.llvm.org/D21887

Files:
  ELF/Relocations.cpp

Index: ELF/Relocations.cpp
===================================================================
--- ELF/Relocations.cpp
+++ ELF/Relocations.cpp
@@ -535,8 +535,9 @@
       continue;
 
     // Skip a relocation that points to a dead piece
-    // in a mergeable section.
-    if (C.getOffset(RI.r_offset) == (uintX_t)-1)
+    // in an .eh_frame section.
+    if (isa<EhInputSection<ELFT>>(&C) &&
+        C.getOffset(RI.r_offset) == (uintX_t)-1)
       continue;
 
     // This relocation does not require got entry, but it is relative to got and


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21887.62338.patch
Type: text/x-patch
Size: 544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160630/85381551/attachment.bin>


More information about the llvm-commits mailing list