This patch sets correct encodings for DWARF exception handling for
LoongArch.
Depends on D134709
Differential D134710
[LoongArch] Set correct encodings for DWARF exception handling wangleiat on Sep 27 2022, 12:53 AM. Authored by
Details
Diff Detail
Unit Tests Event TimelineComment Actions LGTM but I haven't cross-checked with gcc.
Comment Actions https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/config/loongarch/loongarch.h#l1133: #ifdef HAVE_AS_EH_FRAME_PCREL_ENCODING_SUPPORT #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) #else #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr) #endif The ifdef is just for old GNU assemblers, we don't need to care about it because normally LLVM doesn't use an external assembler. I'm not sure about the difference with DW_EH_PE_indirect though (I know literally, nothing about debug symbols). Comment Actions Considering that the old binutils might be used, gcc keeps this definition: #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_absptr)
The definition here is simply to keep consistent with gcc. As for DW_EH_PE_indirect, it seems to be for the read-only attribute of .eh_frame section.
Comment Actions Cross-checked with some gcc code and it looks okay. I don't think we should care for old binutils, the new-world userbase is small enough it'd be easier to tell everyone to upgrade than maintaining such a compatibility hack indefinitely. Comment Actions One nit
|
Better to set --relocation-model=static instead of relying on the default.