Search notes:

tools/objtool/

objtool is an ELF object analysis tool which operates on object (.o) files at compile time.
As per a comment in Documentation/core-api/asm-annotations.rst, objtool can
In order to enable objtool, CONFIG_OBJTOOL must be set.

Usage

objtool <actions> [<options>] file.o

Actions

-h --hacks[=<jump_label,noinstr,skylake>] patch toolchain bugs/limitations
-i --ibt validate and annotate IBT
-l --sls validate straight-line-speculation mitigations
-m --mcount annotate mcount/fentry calls for ftrace
-n --noinstr validate noinstr rules
-o --orc generate ORC metadata
-r --retpoline validate and annotate retpoline usage
-s --stackval validate frame pointer rules
-t --static-call annotate static calls
-u --uaccess validate uaccess rules for SMAP
--cfi annotate kernel control flow integrity (kCFI) function preambles
--dump[=<orc>] dump metadata
--prefix <n> generate prefix symbols
--rethunk validate and annotate rethunk usage
--unret validate entry unret placement

Options

-v --verbose verbose warnings
--backtrace unwind on error
--backup create .orig files before modification
--dry-run don't write modifications
--link object is a linked object
--mnop nop out mcount call sites
--module object is part of a kernel module
--no-unreachable skip 'unreachable instruction' warnings
--sec-address print section addresses in warnings
--stats print statistics

Misc

ORC

objtool creates (or can create?) ORC data.
ORC stands for Oops Rewind Capability and allows to unwind the stack (See also https://github.com/torvalds/linux/blob/master/Documentation/arch/x86/orc-unwinder.rst)

See also

The objtool executable is used (for example?) to produce vmlinux.o.
include/linux/objtool.h, include/linux/compiler.h

Links

https://github.com/torvalds/linux/blob/master/tools/objtool/Documentation/objtool.txt

Index