# Fwd: \[PATCH 0/4\] objtool: Reorganize x86 arch-specific code

- From: Christophe Leroy \<hidden\>
- Date: 2022-05-31 06:14:05 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2022/05/9527038
- Thread: https://ratatoskr.run/linuxppc-dev/2022/05/9527038/t.md

```text
All available at 
https://lore.kernel.org/lkml/20220531020744.236970-1-chenzhongjin@huawei.com/T/#t

Chen, can you please copy linuxppc-dev list next time, as powerpc is 
interested in objtool.


-------- Message transféré --------
Sujet : [PATCH 0/4] objtool: Reorganize x86 arch-specific code
Date : Tue, 31 May 2022 10:07:40 +0800
De : Chen Zhongjin [ref]
Pour : linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, 
x86@kernel.org
Copie à : jpoimboe@redhat.com, peterz@infradead.org, 
madvenka@linux.microsoft.com, tglx@linutronix.de, mingo@redhat.com, 
bp@alien8.de, hpa@zytor.com, arnd@arndb.de, akpm@linux-foundation.org, 
andreyknvl@gmail.com, wangkefeng.wang@huawei.com, 
andrealmeid@collabora.com, mhiramat@kernel.org, mcgrof@kernel.org, 
christophe.leroy@csgroup.eu, dmitry.torokhov@gmail.com, 
yangtiezhu@loongson.cn, dave.hansen@linux.intel.com

This patch set reorganize current x86 related code in objtool, [1-3] move
arch-specific to arch files and extract some common codes and [4] fixes
a cross-compile problem.

It make objtool more arch-generic, which makes other patches on different
architectures easier to be reviewed and merged.

Tested on x86 with unwind on kernel and module context.

Rebased to:
tip/objtool/core:22682a07acc3 (objtool: Fix objtool regression on x32 
systems)

Chen Zhongjin (2):
   objtool: Add generic symbol for relocation type
   objtool: Specify host-arch for making LIBSUBCMD

Madhavan T. Venkataraman (2):
   objtool: Make ORC type code arch-specific
   objtool: Make ORC init and lookup code arch-generic

  arch/x86/include/asm/unwind.h                 |   5 -
  arch/x86/kernel/module.c                      |   7 +-
  arch/x86/kernel/unwind_orc.c                  | 256 +----------------
  arch/x86/kernel/vmlinux.lds.S                 |   2 +-
  .../asm => include/asm-generic}/orc_lookup.h  |  42 +++
  kernel/Makefile                               |   2 +
  kernel/orc_lookup.c                           | 261 ++++++++++++++++++
  tools/objtool/Makefile                        |   2 +-
  tools/objtool/arch/x86/Build                  |   1 +
  tools/objtool/arch/x86/include/arch/elf.h     |   5 +-
  tools/objtool/arch/x86/orc.c                  | 137 +++++++++
  tools/objtool/arch/x86/special.c              |   5 +-
  tools/objtool/check.c                         |  12 +-
  tools/objtool/include/objtool/orc.h           |  17 ++
  tools/objtool/orc_dump.c                      |  59 +---
  tools/objtool/orc_gen.c                       |  79 +-----
  16 files changed, 491 insertions(+), 401 deletions(-)
  rename {arch/x86/include/asm => include/asm-generic}/orc_lookup.h (51%)
  create mode 100644 kernel/orc_lookup.c
  create mode 100644 tools/objtool/arch/x86/orc.c
  create mode 100644 tools/objtool/include/objtool/orc.h

-- 
2.17.1
```
