- When _LIBUNWIND_SUPPORT_COMPACT_UNWIND is defined in config.h, define it to "1" like the other macros. These macros are still checked using "#if defined(...)", however.
- Include libunwind.h in AddressSpace.hpp before using _LIBUNWIND_ARM_EHABI.
- Rename ProcessFrameHeaderCache to TheFrameHeaderCache, because some configurations (e.g. Android / hermetic static libraries) can have one cache per shared object in the process. (When there are more copies, it's more important not to waste memory in the cache.)
- Add 3 missing header files to LIBUNWIND_HEADERS.
Details
- Reviewers
saugustine jgorbe mstorsjo compnerd - Group Reviewers
Restricted Project - Commits
- rG7a457593efec: [libunwind] Minor fixes in libunwind
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you please verify that findUnwindSectionsByPhdr was not exposed previously? This seems like it could be an ABI break.
There is a libunwind::findUnwindSectionsByPhdr as of 11.x. When I build 11.x libunwind.so for glibc (I tested arm and x86_64), the symbol is exposed:
$ readelf --dyn-syms unwind-arm/lib/libunwind.so.1.0 | grep findUnwind 35: 00000f24 204 FUNC GLOBAL DEFAULT 11 _ZN9libunwind24findUnwindSectionsByPhdrEP12dl_phdr_infojPv $ readelf --dyn-syms unwind-x86_64/lib/libunwind.so.1.0 | grep findUnwind 46: 0000000000002c30 854 FUNC GLOBAL DEFAULT 12 _ZN9libunwind24findUnwindSectionsByPhdrEP12dl_phdr_infomPv
In previous releases, the function was a lambda instead, and the lambda was a hidden symbol (because LocalAddressSpace is marked with _LIBUNWIND_HIDDEN, which is __attribute__((visibility("hidden"))).)
$ readelf -s unwind-arm/src/CMakeFiles/unwind_shared.dir/libunwind.cpp.o | grep findUnwind 5: 00000000 0 SECTION LOCAL DEFAULT 23 .text._ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEjRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infojPvE_4_FUNES4_jS5_ 7: 00000000 0 SECTION LOCAL DEFAULT 24 .ARM.extab.text._ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEjRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infojPvE_4_FUNES4_jS5_ 8: 00000000 0 SECTION LOCAL DEFAULT 25 .ARM.exidx.text._ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEjRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infojPvE_4_FUNES4_jS5_ 265: 00000000 204 FUNC WEAK HIDDEN 23 _ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEjRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infojPvE_4_FUNES4_jS5_ $ readelf -s unwind-x86_64/src/CMakeFiles/unwind_shared.dir/libunwind.cpp.o | grep findUnwind 38: 0000000000000000 0 SECTION LOCAL DEFAULT 80 .text._ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEmRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infomPvE_4_FUNES4_mS5_ 249: 0000000000000000 313 FUNC WEAK HIDDEN 80 _ZZN9libunwind17LocalAddressSpace18findUnwindSectionsEmRNS_18UnwindInfoSectionsEENUlP12dl_phdr_infomPvE_4_FUNES4_mS5_
The hidden symbol doesn't make it into the shared object's .dynsym table.
11.0.0-final isn't released yet, so maybe this can be fixed still?
I suspect this function is currently only ever defined in libunwind.cpp.
Please ensure that the fix goes into 11 before release (CC: @hans), but the remainder of the change is fine.
Just to make sure I get it right, the fix need for 11 is https://reviews.llvm.org/D86372, right?
clang-format: please reformat the code