• Tiezhu Yang's avatar
    LoongArch: Add ORC stack unwinder support · cb8a2ef0
    Tiezhu Yang authored
    The kernel CONFIG_UNWINDER_ORC option enables the ORC unwinder, which is
    similar in concept to a DWARF unwinder. The difference is that the format
    of the ORC data is much simpler than DWARF, which in turn allows the ORC
    unwinder to be much simpler and faster.
    
    The ORC data consists of unwind tables which are generated by objtool.
    After analyzing all the code paths of a .o file, it determines information
    about the stack state at each instruction address in the file and outputs
    that information to the .orc_unwind and .orc_unwind_ip sections.
    
    The per-object ORC sections are combined at link time and are sorted and
    post-processed at boot time. The unwinder uses the resulting data to
    correlate instruction addresses with their stack states at run time.
    
    Most of the logic are similar with x86, in order to get ra info before ra
    is saved into stack, add ra_reg and ra_offset into orc_entry. At the same
    time, modify some arch-specific code to silence the objtool warnings.
    Co-developed-by: default avatarJinyang He <hejinyang@loongson.cn>
    Signed-off-by: default avatarJinyang He <hejinyang@loongson.cn>
    Co-developed-by: default avatarYouling Tang <tangyouling@loongson.cn>
    Signed-off-by: default avatarYouling Tang <tangyouling@loongson.cn>
    Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    cb8a2ef0
lbt.S 2.96 KB