mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 04:46:27 +08:00
I was running the tests with baremetal picolibc which has a linker
script that __eh_frame_start==__eh_frame_end (not equal to zero) in
case there is no .eh_frame_hdr.
I noticed that libunwind was trying to read nonsense data because it
was printing messages such as
`libunwind: unsupported .eh_frame_hdr version: 20 at
8000d30814`
This change adds a ehHdr size check to avoid reading this out-of-bounds
data and potentially crashing.