/linux-6.1.9/tools/objtool/ |
D | elf.c | 31 #define __elf_table(name) (elf->name##_hash) 32 #define __elf_bits(name) (elf->name##_bits) 111 struct section *find_section_by_name(const struct elf *elf, const char *name) in find_section_by_name() argument 123 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index() argument 136 static struct symbol *find_symbol_by_index(struct elf *elf, unsigned int idx) in find_symbol_by_index() argument 239 struct symbol *find_symbol_by_name(const struct elf *elf, const char *name) in find_symbol_by_name() argument 251 struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec, in find_reloc_by_dest_range() argument 280 struct reloc *find_reloc_by_dest(const struct elf *elf, struct section *sec, unsigned long offset) in find_reloc_by_dest() argument 282 return find_reloc_by_dest_range(elf, sec, offset, 1); in find_reloc_by_dest() 285 static int read_sections(struct elf *elf) in read_sections() argument [all …]
|
D | orc_dump.c | 73 Elf *elf; in orc_dump() local 91 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump() 92 if (!elf) { in orc_dump() 97 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump() 102 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump() 108 scn = elf_getscn(elf, i); in orc_dump() 119 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 168 scn = elf_getscn(elf, sym.st_shndx); in orc_dump() 179 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 185 name = elf_strptr(elf, strtab_idx, sym.st_name); in orc_dump() [all …]
|
D | special.c | 68 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument 96 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); in get_alt_entry() 105 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); in get_alt_entry() 122 key_reloc = find_reloc_by_dest(elf, sec, offset + entry->key); in get_alt_entry() 139 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument 150 sec = find_section_by_name(elf, entry->sec); in special_get_alts() 170 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
|
D | orc_gen.c | 90 static int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument 104 if (elf_add_reloc_to_insn(elf, ip_sec, idx * sizeof(int), R_X86_64_PC32, in write_orc_entry() 222 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create() 227 orc_sec = elf_create_section(file->elf, ".orc_unwind", 0, in orc_create() 232 sec = elf_create_section(file->elf, ".orc_unwind_ip", 0, sizeof(int), nr); in orc_create() 238 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
|
/linux-6.1.9/tools/objtool/include/objtool/ |
D | elf.h | 84 struct elf { struct 85 Elf *elf; member 140 static inline bool has_multiple_files(struct elf *elf) in has_multiple_files() argument 142 return elf->num_files > 1; in has_multiple_files() 145 struct elf *elf_open_read(const char *name, int flags); 146 struct section *elf_create_section(struct elf *elf, const char *name, unsigned int sh_flags, size_t… 148 int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long offset, 150 int elf_add_reloc_to_insn(struct elf *elf, struct section *sec, 154 int elf_write_insn(struct elf *elf, struct section *sec, 157 int elf_write_reloc(struct elf *elf, struct reloc *reloc); [all …]
|
D | special.h | 33 int special_get_alts(struct elf *elf, struct list_head *alts);
|
/linux-6.1.9/arch/arm64/kvm/hyp/nvhe/ |
D | gen-hyprel.c | 137 } elf; variable 164 elf.path, ## __VA_ARGS__); \ 172 elf.path, strerror(errno)); \ 198 #define elf_ptr(type, off) ((type *)(elf.begin + (off))) 202 for (var = elf.sh_table; var < elf.sh_table + elf16toh(elf.ehdr->e_shnum); ++var) 218 return elf.sh_string + elf32toh(shdr->sh_name); in section_name() 238 return &elf.sh_table[idx]; in section_by_idx() 251 elf.path = path; in init_elf() 266 elf.begin = mmap(0, stat.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in init_elf() 267 if (elf.begin == MAP_FAILED) { in init_elf() [all …]
|
/linux-6.1.9/tools/perf/util/ |
D | symbol-elf.c | 78 static int elf_getphdrnum(Elf *elf, size_t *dst) in elf_getphdrnum() argument 83 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum() 94 static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused) in elf_getshdrstrndx() 191 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) in elf_addr_to_index() argument 197 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_addr_to_index() 210 Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, in elf_section_by_name() argument 217 if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) in elf_section_by_name() 220 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_section_by_name() 224 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); in elf_section_by_name() 236 static int elf_read_program_header(Elf *elf, u64 vaddr, GElf_Phdr *phdr) in elf_read_program_header() argument [all …]
|
D | unwind-libunwind-local.c | 174 Elf *elf; in elf_section_address_and_offset() local 179 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_section_address_and_offset() 180 if (elf == NULL) in elf_section_address_and_offset() 183 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_address_and_offset() 186 if (!elf_section_by_name(elf, &ehdr, &shdr, name, NULL)) in elf_section_address_and_offset() 193 elf_end(elf); in elf_section_address_and_offset() 211 Elf *elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_base_address() local 216 if (elf == NULL) in elf_base_address() 218 (void)elf_getphdrnum(elf, &phdrnum); in elf_base_address() 221 if (gelf_getphdr(elf, i, &phdr) && phdr.p_type == PT_LOAD) { in elf_base_address() [all …]
|
/linux-6.1.9/scripts/mod/ |
D | modpost.c | 723 static const char *sym_name(struct elf_info *elf, Elf_Sym *sym) in sym_name() argument 726 return elf->strtab + sym->st_name; in sym_name() 785 static void check_section(const char *modname, struct elf_info *elf, in check_section() argument 788 const char *sec = sech_name(elf, sechdr); in check_section() 894 void (*handler)(const char *modname, struct elf_info *elf, 900 static void extable_mismatch_handler(const char *modname, struct elf_info *elf, 1132 static inline int is_valid_name(struct elf_info *elf, Elf_Sym *sym) in is_valid_name() argument 1134 const char *name = elf->strtab + sym->st_name; in is_valid_name() 1148 static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr, in find_elf_symbol() argument 1160 relsym_secindex = get_secindex(elf, relsym); in find_elf_symbol() [all …]
|
/linux-6.1.9/arch/alpha/boot/tools/ |
D | objstrip.c | 61 struct elfhdr *elf; in main() local 149 elf = (struct elfhdr *) buf; in main() 151 if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) { in main() 152 if (elf->e_type != ET_EXEC) { in main() 157 if (!elf_check_arch(elf)) { in main() 159 prog_name, elf->e_machine); in main() 162 if (elf->e_phnum != 1) { in main() 165 prog_name, elf->e_phnum); in main() 168 e_entry = elf->e_entry; in main() 170 lseek(fd, elf->e_phoff, SEEK_SET); in main()
|
/linux-6.1.9/arch/powerpc/platforms/powernv/ |
D | opal-core.c | 308 Elf64_Ehdr *elf; in create_opalcore() local 357 elf = (Elf64_Ehdr *)bufp; in create_opalcore() 359 memcpy(elf->e_ident, ELFMAG, SELFMAG); in create_opalcore() 360 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore() 361 elf->e_ident[EI_DATA] = ELFDATA2MSB; in create_opalcore() 362 elf->e_ident[EI_VERSION] = EV_CURRENT; in create_opalcore() 363 elf->e_ident[EI_OSABI] = ELF_OSABI; in create_opalcore() 364 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in create_opalcore() 365 elf->e_type = cpu_to_be16(ET_CORE); in create_opalcore() 366 elf->e_machine = cpu_to_be16(ELF_ARCH); in create_opalcore() [all …]
|
/linux-6.1.9/arch/mips/tools/ |
D | Makefile | 2 hostprogs := elf-entry 3 PHONY += elf-entry 4 elf-entry: $(obj)/elf-entry
|
/linux-6.1.9/tools/bpf/resolve_btfids/ |
D | main.c | 112 Elf *elf; member 295 static int compressed_section_fix(Elf *elf, Elf_Scn *scn, GElf_Shdr *sh) in compressed_section_fix() argument 297 int expected = gelf_getclass(elf) == ELFCLASS32 ? 4 : 8; in compressed_section_fix() 323 Elf *elf; in elf_collect() local 335 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect() 336 if (!elf) { in elf_collect() 344 obj->efile.elf = elf; in elf_collect() 346 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect() 348 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect() 357 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect() [all …]
|
/linux-6.1.9/fs/ |
D | binfmt_elf_fdpic.c | 1238 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument 1240 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header() 1241 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header() 1242 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header() 1243 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header() 1244 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header() 1245 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header() 1247 elf->e_type = ET_CORE; in fill_elf_fdpic_header() 1248 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header() 1249 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header() [all …]
|
D | binfmt_elf.c | 540 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument 1491 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument 1494 memset(elf, 0, sizeof(*elf)); in fill_elf_header() 1496 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header() 1497 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header() 1498 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header() 1499 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header() 1500 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header() 1502 elf->e_type = ET_CORE; in fill_elf_header() 1503 elf->e_machine = machine; in fill_elf_header() [all …]
|
/linux-6.1.9/arch/powerpc/kernel/ |
D | fadump.c | 965 struct elfhdr *elf; in fadump_init_elfcore_header() local 967 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header() 969 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header() 970 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header() 971 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header() 972 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header() 973 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header() 974 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header() 975 elf->e_type = ET_CORE; in fadump_init_elfcore_header() 976 elf->e_machine = ELF_ARCH; in fadump_init_elfcore_header() [all …]
|
/linux-6.1.9/tools/lib/bpf/ |
D | usdt.c | 299 static int sanity_check_usdt_elf(Elf *elf, const char *path) in sanity_check_usdt_elf() argument 304 if (elf_kind(elf) != ELF_K_ELF) { in sanity_check_usdt_elf() 305 pr_warn("usdt: unrecognized ELF kind %d for '%s'\n", elf_kind(elf), path); in sanity_check_usdt_elf() 309 switch (gelf_getclass(elf)) { in sanity_check_usdt_elf() 327 if (!gelf_getehdr(elf, &ehdr)) in sanity_check_usdt_elf() 351 static int find_elf_sec_by_name(Elf *elf, const char *sec_name, GElf_Shdr *shdr, Elf_Scn **scn) in find_elf_sec_by_name() argument 356 if (elf_getshdrstrndx(elf, &shstrndx)) in find_elf_sec_by_name() 360 if (!elf_rawdata(elf_getscn(elf, shstrndx), NULL)) in find_elf_sec_by_name() 363 while ((sec = elf_nextscn(elf, sec)) != NULL) { in find_elf_sec_by_name() 369 name = elf_strptr(elf, shstrndx, shdr->sh_name); in find_elf_sec_by_name() [all …]
|
/linux-6.1.9/arch/x86/realmode/rm/ |
D | Makefile | 53 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T 56 targets += realmode.elf 57 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE 63 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE 70 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
|
/linux-6.1.9/drivers/firmware/efi/libstub/ |
D | Makefile.zboot | 41 LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds 42 $(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE 46 $(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE 49 targets += zboot-header.o vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi
|
/linux-6.1.9/arch/xtensa/boot/boot-redboot/ |
D | Makefile | 25 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) 26 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) 28 $(obj)/../zImage.redboot: $(obj)/zImage.elf
|
/linux-6.1.9/arch/xtensa/boot/ |
D | Makefile | 26 Image: boot-elf 31 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) 42 boot-elf: $(obj)/vmlinux.bin
|
/linux-6.1.9/tools/build/feature/ |
D | test-libelf.c | 6 Elf *elf = elf_begin(0, ELF_C_READ, 0); in main() local 8 return (long)elf; in main()
|
/linux-6.1.9/tools/objtool/arch/x86/ |
D | decode.c | 26 static int is_x86_64(const struct elf *elf) in is_x86_64() argument 28 switch (elf->ehdr.e_machine) { in is_x86_64() 34 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64() 124 const struct elf *elf = file->elf; in arch_decode_instruction() local 135 x86_64 = is_x86_64(elf); in arch_decode_instruction() 592 immr = find_reloc_by_dest(elf, (void *)sec, offset+3); in arch_decode_instruction() 593 disp = find_reloc_by_dest(elf, (void *)sec, offset+7); in arch_decode_instruction()
|
/linux-6.1.9/tools/testing/selftests/sgx/ |
D | Makefile | 22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf 47 $(OUTPUT)/test_encl.elf: test_encl.lds test_encl.c test_encl_bootstrap.S 51 $(OUTPUT)/test_encl.elf \
|