[PATCH] D15712: [ELF] - implemented --eh-frame-hdr command line option.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 14:40:21 PST 2016


ruiu added inline comments.

================
Comment at: ELF/OutputSections.cpp:825
@@ +824,3 @@
+    // The last four bytes are an offset to the FDE data itself.
+    uintX_t FdeDataOff = EhVA + I.second - VA;
+    write32<E>(Buf + 4, FdeDataOff);
----------------
grimar wrote:
> ruiu wrote:
> > Ditto
> What about eliminating them ?
> ```
>   for (auto &I : PcToOffset) {
>     // The first four bytes are an offset to the initial PC value for the FDE.
>     write32<E>(Buf, I.first - VA);
>     // The last four bytes are an offset to the FDE data itself.
>     write32<E>(Buf + 4, EhVA + I.second - VA);
>     Buf += 8;
>   }
> }
> ```
LGTM


http://reviews.llvm.org/D15712





More information about the llvm-commits mailing list