[PATCH] D15610: [ELF] - Fixed handling relocations against zero sized .eh_frame section.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 15:50:41 PST 2015


ruiu added inline comments.

================
Comment at: ELF/OutputSections.cpp:856-860
@@ -855,3 +855,7 @@
   }
-  return VA + cast<MergeInputSection<ELFT>>(Section)->getOffset(Offset) +
-         Addend;
+  uintX_t SecOff;
+  if (isa<EHInputSection<ELFT>>(Section))
+    SecOff = cast<EHInputSection<ELFT>>(Section)->getOffset(Offset);
+  else
+    SecOff = cast<MergeInputSection<ELFT>>(Section)->getOffset(Offset);
+
----------------
Is there any reason to not make getOffset a virtual function?


http://reviews.llvm.org/D15610





More information about the llvm-commits mailing list