[PATCH] D87750: [libunwind][DWARF] Fix end of .eh_frame calculation

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 16:37:37 PDT 2020


rprichard added a comment.

> This seems like a bad name.

Good point. How about `text_segment_length`?

> I think that tracking the segment length should be okay.  It’s a total overhead of 8 bytes, which is only allocated once,  however, the naming here is egregiously bad.  This is the segment length and not the DSO length nor the DSO mapped length (which may actually be larger or smaller based on the load segment layout).

It's 8 bytes, per cache entry (8 entries), and with the Android NDK, each shared object would have its own copy of the cache. Happily, the Android platform itself now has only a single copy of the unwinder in libc.so, which mitigates the waste. I'd still prefer to refactor the waste away (e.g. maybe by removing UnwindInfoSections from FrameHeaderCache::CacheEntry and inlining just what's needed).

The DwarfFDECache waste is a worse. In practice, it will always be empty, and it's adding 2KiB of .bss in every DSO. That's easy to fix by lowering the number of elements in `_initialBuffer[64]`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87750/new/

https://reviews.llvm.org/D87750



More information about the llvm-commits mailing list