[PATCH v6 0/9] Add jump table support for objtool on LoongArch

Tiezhu Yang yangtiezhu at loongson.cn
Tue Dec 17 01:08:56 UTC 2024


This version is based on tip/tip.git objtool/core branch [1], add some weak
and arch-specific functions to make the generic code more readable, tested
with the latest upstream mainline Binutils, GCC and Clang.

The first 6 patches are preparation for patch #7 to enable jump table for
objtool on LoongArch, the last 2 patches are small enough to fix objtool
warnings "funcA() falls through to next function funcB()", one is under
arch/loongarch and the other is under drm/amd/display.

v6:
  -- Add arch_reloc_size() for x86 and ppc.
  -- Call arch_reloc_size() directly in add_jump_table().
  -- Refine arch_adjust_offset() for LoongArch.
  -- Rename arch_adjust_offset() to arch_jump_table_sym_offset(). 
  -- Get each table size of rodata in time for switch table.
  -- Update the commit message to make it more clear.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=objtool/core

Tiezhu Yang (9):
  objtool: Handle various symbol types of rodata
  objtool: Handle different entry size of rodata
  objtool: Handle PC relative relocation type
  objtool: Handle unreachable entry of rodata
  objtool/LoongArch: Add support for switch table
  objtool/LoongArch: Add support for goto table
  LoongArch: Enable jump table for objtool
  LoongArch: Convert unreachable() to BUG()
  drm/amd/display: Mark dc_fixpt_from_fraction() noinline

 arch/loongarch/Kconfig                        |   3 +
 arch/loongarch/Makefile                       |   6 +-
 arch/loongarch/kernel/machine_kexec.c         |   4 +-
 .../drm/amd/display/dc/basics/fixpt31_32.c    |   2 +-
 tools/objtool/arch/loongarch/decode.c         |  28 ++-
 .../objtool/arch/loongarch/include/arch/elf.h |   7 +
 tools/objtool/arch/loongarch/special.c        | 159 +++++++++++++++++-
 tools/objtool/arch/powerpc/decode.c           |  15 ++
 tools/objtool/arch/x86/decode.c               |  13 ++
 tools/objtool/check.c                         |  28 ++-
 tools/objtool/include/objtool/arch.h          |   3 +
 11 files changed, 251 insertions(+), 17 deletions(-)

-- 
2.42.0



More information about the amd-gfx mailing list