tools/objtool/include/objtool/check.h

Source file repositories/reference/linux-study-clean/tools/objtool/include/objtool/check.h

File Facts

System
Linux kernel
Corpus path
tools/objtool/include/objtool/check.h
Extension
.h
Size
4635 bytes
Lines
193
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct insn_state {
	struct cfi_state cfi;
	unsigned int uaccess_stack;
	bool uaccess;
	bool df;
	bool noinstr;
	s8 instr;
};

struct alt_group {
	/*
	 * Pointer from a replacement group to the original group.  NULL if it
	 * *is* the original group.
	 */
	struct alt_group *orig_group;

	/* First and last instructions in the group */
	struct instruction *first_insn, *last_insn, *nop;

	/*
	 * Byte-offset-addressed len-sized array of pointers to CFI structs.
	 * This is shared with the other alt_groups in the same alternative.
	 */
	struct cfi_state **cfi;

	bool ignore;
	unsigned int feature;
};

enum alternative_type {
	ALT_TYPE_INSTRUCTIONS,
	ALT_TYPE_JUMP_TABLE,
	ALT_TYPE_EX_TABLE,
};

struct alternative {
	struct alternative *next;
	struct instruction *insn;
	enum alternative_type type;
};

#define INSN_CHUNK_BITS		8
#define INSN_CHUNK_SIZE		(1 << INSN_CHUNK_BITS)
#define INSN_CHUNK_MAX		(INSN_CHUNK_SIZE - 1)

struct instruction {
	struct hlist_node hash;
	struct list_head call_node;
	struct section *sec;
	unsigned long offset;
	unsigned long immediate;

	u8 len;
	u8 prev_len;
	u8 type;
	s8 instr;

	u32 idx			: INSN_CHUNK_BITS,
	    immediate_len	: 4,
	    dead_end		: 1,
	    ignore_alts		: 1,
	    hint		: 1,
	    save		: 1,
	    restore		: 1,
	    retpoline_safe	: 1,
	    noendbr		: 1,
	    unret		: 1,
	    visited		: 4,
	    no_reloc		: 1,
	    hole		: 1,
	    fake		: 1,
	    trace		: 1;
		/* 4 bit hole */

	struct alt_group *alt_group;
	struct instruction *jump_dest;
	struct instruction *first_jump_src;
	union {
		struct symbol *_call_dest;
		struct {
			struct reloc *_jump_table;
			unsigned long _jump_table_size;
		};
	};
	struct alternative *alts;
	struct symbol *_sym;
	struct stack_op *stack_ops;
	struct cfi_state *cfi;
};

Annotation

Implementation Notes