[PATCH v2 00/12] objtool/arm64: Port klp-build to arm64

Josh Poimboeuf posted 12 patches 2 weeks, 5 days ago
arch/arm64/Kconfig                            |   2 +
arch/arm64/kernel/entry.S                     |   2 +
arch/arm64/kernel/head.S                      |   2 +-
arch/arm64/kernel/proton-pack.c               |  12 +-
arch/arm64/kernel/vmlinux.lds.S               |   2 +-
arch/x86/boot/startup/Makefile                |   2 +-
include/asm-generic/vmlinux.lds.h             |   2 +-
include/linux/init.h                          |   1 +
lib/crypto/arm64/sha2-armv8.pl                |  11 +-
scripts/Makefile.build                        |   4 +-
scripts/Makefile.lib                          |  46 +++----
scripts/Makefile.vmlinux_o                    |  15 +--
scripts/livepatch/klp-build                   |  11 +-
tools/objtool/Makefile                        |   4 +
tools/objtool/arch/arm64/Build                |   2 +
tools/objtool/arch/arm64/decode.c             | 116 ++++++++++++++++++
.../arch/arm64/include/arch/cfi_regs.h        |  11 ++
tools/objtool/arch/arm64/include/arch/elf.h   |  13 ++
.../objtool/arch/arm64/include/arch/special.h |  21 ++++
tools/objtool/arch/arm64/special.c            |  21 ++++
tools/objtool/builtin-check.c                 |   5 -
tools/objtool/check.c                         |  83 +++++++++----
tools/objtool/elf.c                           |   9 +-
tools/objtool/include/objtool/checksum.h      |   6 +-
24 files changed, 321 insertions(+), 82 deletions(-)
create mode 100644 tools/objtool/arch/arm64/Build
create mode 100644 tools/objtool/arch/arm64/decode.c
create mode 100644 tools/objtool/arch/arm64/include/arch/cfi_regs.h
create mode 100644 tools/objtool/arch/arm64/include/arch/elf.h
create mode 100644 tools/objtool/arch/arm64/include/arch/special.h
create mode 100644 tools/objtool/arch/arm64/special.c
[PATCH v2 00/12] objtool/arm64: Port klp-build to arm64
Posted by Josh Poimboeuf 2 weeks, 5 days ago
v2:
- patches 1-2 were merged, rebase on tip/master
- improve commit message for "objtool: Extricate checksum calculation from validate_branch()"
- add review tags

v1: https://lore.kernel.org/cover.1772681234.git.jpoimboe@kernel.org

Port objtool and the klp-build tooling (for building livepatch modules)
to arm64.

Note this doesn't bring all the objtool bells and whistles to arm64, nor
any of the CFG reverse engineering.  This only adds the bare minimum
needed for 'objtool --checksum'.

And note that objtool still doesn't get enabled at all for normal arm64
kernel builds, so this doesn't affect any users other than those running
klp-build directly.

Josh Poimboeuf (12):
  arm64: Annotate intra-function calls
  arm64: head: Move boot header to .head.data
  arm64: Fix EFI linking with -fdata-sections
  crypto: arm64: Move data to .rodata
  objtool: Extricate checksum calculation from validate_branch()
  objtool: Allow setting --mnop without --mcount
  kbuild: Only run objtool if there is at least one command
  objtool: Ignore jumps to the end of the function for non-CFG arches
  objtool: Allow empty alternatives
  objtool: Reuse consecutive string references
  objtool: Introduce objtool for arm64
  klp-build: Support cross-compilation

 arch/arm64/Kconfig                            |   2 +
 arch/arm64/kernel/entry.S                     |   2 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/proton-pack.c               |  12 +-
 arch/arm64/kernel/vmlinux.lds.S               |   2 +-
 arch/x86/boot/startup/Makefile                |   2 +-
 include/asm-generic/vmlinux.lds.h             |   2 +-
 include/linux/init.h                          |   1 +
 lib/crypto/arm64/sha2-armv8.pl                |  11 +-
 scripts/Makefile.build                        |   4 +-
 scripts/Makefile.lib                          |  46 +++----
 scripts/Makefile.vmlinux_o                    |  15 +--
 scripts/livepatch/klp-build                   |  11 +-
 tools/objtool/Makefile                        |   4 +
 tools/objtool/arch/arm64/Build                |   2 +
 tools/objtool/arch/arm64/decode.c             | 116 ++++++++++++++++++
 .../arch/arm64/include/arch/cfi_regs.h        |  11 ++
 tools/objtool/arch/arm64/include/arch/elf.h   |  13 ++
 .../objtool/arch/arm64/include/arch/special.h |  21 ++++
 tools/objtool/arch/arm64/special.c            |  21 ++++
 tools/objtool/builtin-check.c                 |   5 -
 tools/objtool/check.c                         |  83 +++++++++----
 tools/objtool/elf.c                           |   9 +-
 tools/objtool/include/objtool/checksum.h      |   6 +-
 24 files changed, 321 insertions(+), 82 deletions(-)
 create mode 100644 tools/objtool/arch/arm64/Build
 create mode 100644 tools/objtool/arch/arm64/decode.c
 create mode 100644 tools/objtool/arch/arm64/include/arch/cfi_regs.h
 create mode 100644 tools/objtool/arch/arm64/include/arch/elf.h
 create mode 100644 tools/objtool/arch/arm64/include/arch/special.h
 create mode 100644 tools/objtool/arch/arm64/special.c

-- 
2.53.0
Re: [PATCH v2 00/12] objtool/arm64: Port klp-build to arm64
Posted by Josh Poimboeuf 2 weeks, 4 days ago
On Tue, Mar 17, 2026 at 03:51:00PM -0700, Josh Poimboeuf wrote:
> v2:
> - patches 1-2 were merged, rebase on tip/master
> - improve commit message for "objtool: Extricate checksum calculation from validate_branch()"
> - add review tags
> 
> v1: https://lore.kernel.org/cover.1772681234.git.jpoimboe@kernel.org
> 
> Port objtool and the klp-build tooling (for building livepatch modules)
> to arm64.
> 
> Note this doesn't bring all the objtool bells and whistles to arm64, nor
> any of the CFG reverse engineering.  This only adds the bare minimum
> needed for 'objtool --checksum'.
> 
> And note that objtool still doesn't get enabled at all for normal arm64
> kernel builds, so this doesn't affect any users other than those running
> klp-build directly.

The Sashiko AI thing found some bugs, so it might be wise to hold off on
any review or testing of this until I get v3 out.

-- 
Josh