tools/objtool/include/objtool/elf.h
Source file repositories/reference/linux-study-clean/tools/objtool/include/objtool/elf.h
File Facts
- System
- Linux kernel
- Corpus path
tools/objtool/include/objtool/elf.h- Extension
.h- Size
- 15293 bytes
- Lines
- 583
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hgelf.hlinux/string.hlinux/list.hlinux/hashtable.hlinux/rbtree.hlinux/jhash.hobjtool/endianness.hobjtool/checksum_types.harch/elf.h
Detected Declarations
struct elf_hash_nodestruct sectionstruct symbolstruct relocstruct elffunction Copyrightfunction has_multiple_filesfunction elf_addr_sizefunction elf_rela_sizefunction elf_data_rela_typefunction elf_text_rela_typefunction is_undef_symfunction is_null_symfunction is_sec_symfunction is_object_symfunction is_func_symfunction is_file_symfunction is_notype_symfunction is_global_symfunction is_weak_symfunction is_local_symfunction is_alias_symfunction is_prefix_funcfunction is_cold_funcfunction is_reloc_secfunction is_string_secfunction is_text_secfunction is_rodata_secfunction sec_changedfunction mark_sec_changedfunction sec_num_entriesfunction reloc_idxfunction is_32bit_relocfunction sec_sizefunction reloc_offsetfunction set_reloc_offsetfunction reloc_addendfunction set_reloc_addendfunction reloc_symfunction reloc_typefunction set_reloc_symfunction set_reloc_typefunction annotypefunction is_jump_tablefunction set_jump_tablefunction set_sym_next_relocfunction str_hash_demangledfunction sec_offset_hash
Annotated Snippet
struct elf_hash_node {
struct elf_hash_node *next;
};
struct section {
struct list_head list;
struct elf_hash_node hash;
struct elf_hash_node name_hash;
GElf_Shdr sh;
struct rb_root_cached symbol_tree;
struct list_head symbol_list;
struct section *base, *rsec;
struct symbol *sym;
Elf_Data *data;
const char *name;
int idx;
bool _changed, text, rodata, noinstr, init, truncate;
struct reloc *relocs;
unsigned long nr_alloc_relocs;
struct section *twin;
};
struct symbol {
struct list_head list;
struct list_head global_list;
struct rb_node node;
struct elf_hash_node hash;
struct elf_hash_node name_hash;
GElf_Sym sym;
struct section *sec;
const char *name, *demangled_name;
unsigned int idx, len;
unsigned long offset;
unsigned long __subtree_last;
struct symbol *pfunc, *cfunc, *alias, *file;
unsigned char bind, type;
u8 uaccess_safe : 1;
u8 static_call_tramp : 1;
u8 retpoline_thunk : 1;
u8 return_thunk : 1;
u8 fentry : 1;
u8 profiling_func : 1;
u8 warned : 1;
u8 embedded_insn : 1;
u8 local_label : 1;
u8 frame_pointer : 1;
u8 ignore : 1;
u8 nocfi : 1;
u8 cold : 1;
u8 prefix : 1;
u8 debug_checksum : 1;
u8 changed : 1;
u8 included : 1;
u8 klp : 1;
u8 dont_correlate : 1;
struct list_head pv_target;
struct reloc *relocs;
struct section *group_sec;
struct checksum csum;
struct symbol *twin, *clone;
};
struct reloc {
struct elf_hash_node hash;
struct section *sec;
struct symbol *sym;
unsigned long _sym_next_reloc;
};
struct elf {
Elf *elf;
GElf_Ehdr ehdr;
int fd;
bool changed;
const char *name, *tmp_name;
unsigned int num_files;
struct list_head sections;
struct list_head symbols;
unsigned long num_relocs;
int symbol_bits;
int symbol_name_bits;
int section_bits;
int section_name_bits;
int reloc_bits;
struct elf_hash_node **symbol_hash;
struct elf_hash_node **symbol_name_hash;
struct elf_hash_node **section_hash;
struct elf_hash_node **section_name_hash;
Annotation
- Immediate include surface: `stdio.h`, `gelf.h`, `linux/string.h`, `linux/list.h`, `linux/hashtable.h`, `linux/rbtree.h`, `linux/jhash.h`, `objtool/endianness.h`.
- Detected declarations: `struct elf_hash_node`, `struct section`, `struct symbol`, `struct reloc`, `struct elf`, `function Copyright`, `function has_multiple_files`, `function elf_addr_size`, `function elf_rela_size`, `function elf_data_rela_type`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.