Skip to content

Commit 58b33d0

Browse files
authored
[libunwind] fix dynamic .eh_frame registration (#77185)
Fix this issue [#76957](#76957) Libgcc provides __register_frame to register a dynamic .eh_frame section, while __unw_add_dynamic_eh_frame_section can be used to do the same in libunwind. However, the address after dynamic .eh_frame are padding with 0 value, it will be identified as legal CIE. And __unw_add_dynamic_eh_frame_section will continue to parse subsequent addresses until illegal memory or other sections are accessed. This patch adds length formal parameter for dynamic registration.
1 parent 2c0fc0f commit 58b33d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libunwind/src/libunwind.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void __unw_add_dynamic_eh_frame_section(unw_word_t eh_frame_start) {
324324
CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;
325325
CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;
326326
auto p = (LocalAddressSpace::pint_t)eh_frame_start;
327-
while (true) {
327+
while (LocalAddressSpace::sThisAddressSpace.get32(p)) {
328328
if (CFI_Parser<LocalAddressSpace>::decodeFDE(
329329
LocalAddressSpace::sThisAddressSpace, p, &fdeInfo, &cieInfo,
330330
true) == NULL) {

0 commit comments

Comments
 (0)