I know that, when using languages that support exceptions, such as C++, additional information must be provided to the runtime environment to describe the call frames that must be unwound during the processing of an exception. This information is contained in special sections of the object files, such as .eh_frame
and .eh_frame_hdr
.
But, what kind of data structures are stored in these sections? I mean, can they be read by using any C struct? Do they have anything to do with the .cfi
statements (such as .cfi_startproc
, .cfi_endproc
, .cfi_offset
, .cfi_def_cfa_offset
, .cfi_personality
and .cfi_lsda
) in GNU assembly code? If they do, what each one of these clauses cause in those sections? What does the .eh_frame_hdr
section have to do with the .eh_frame
one?
I would appreciate explanations using C structs as much as possible. Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…