| /kernel/linux/linux-5.10/tools/objtool/ |
| D | elf.c | 130 struct section *find_section_by_name(const struct elf *elf, const char *name) in find_section_by_name() argument 134 elf_hash_for_each_possible(elf->section_name_hash, sec, name_hash, str_hash(name)) in find_section_by_name() 141 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index() argument 146 elf_hash_for_each_possible(elf->section_hash, sec, hash, idx) in find_section_by_index() 153 static struct symbol *find_symbol_by_index(struct elf *elf, unsigned int idx) in find_symbol_by_index() argument 157 elf_hash_for_each_possible(elf->symbol_hash, sym, hash, idx) in find_symbol_by_index() 220 struct symbol *find_symbol_by_name(const struct elf *elf, const char *name) in find_symbol_by_name() argument 224 elf_hash_for_each_possible(elf->symbol_name_hash, sym, name_hash, str_hash(name)) in find_symbol_by_name() 231 struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec, in find_reloc_by_dest_range() argument 243 elf_hash_for_each_possible(elf->reloc_hash, reloc, hash, in find_reloc_by_dest_range() [all …]
|
| D | elf.h | 84 struct elf { struct 85 Elf *elf; member 127 struct elf *elf_open_read(const char *name, int flags); 128 struct section *elf_create_section(struct elf *elf, const char *name, unsigned int sh_flags, size_t… 130 int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long offset, 132 int elf_add_reloc_to_insn(struct elf *elf, struct section *sec, 136 int elf_write_insn(struct elf *elf, struct section *sec, 139 int elf_write_reloc(struct elf *elf, struct reloc *reloc); 140 int elf_write(struct elf *elf); 141 void elf_close(struct elf *elf); [all …]
|
| D | orc_dump.c | 72 Elf *elf; in orc_dump() local 90 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump() 91 if (!elf) { in orc_dump() 96 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump() 101 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump() 107 scn = elf_getscn(elf, i); in orc_dump() 118 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 167 scn = elf_getscn(elf, sym.st_shndx); in orc_dump() 178 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 184 name = elf_strptr(elf, strtab_idx, sym.st_name); in orc_dump() [all …]
|
| D | special.c | 65 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument 92 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); in get_alt_entry() 101 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); in get_alt_entry() 123 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument 134 sec = find_section_by_name(elf, entry->sec); in special_get_alts() 154 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
|
| D | orc_gen.c | 89 static int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument 101 if (elf_add_reloc_to_insn(elf, ip_sec, idx * sizeof(int), R_X86_64_PC32, in write_orc_entry() 219 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create() 224 orc_sec = elf_create_section(file->elf, ".orc_unwind", 0, in orc_create() 229 sec = elf_create_section(file->elf, ".orc_unwind_ip", 0, sizeof(int), nr); in orc_create() 235 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
|
| D | objtool.c | 58 file.elf = elf_open_read(objname, O_RDWR); in objtool_open_read() 59 if (!file.elf) in objtool_open_read() 67 file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment"); in objtool_open_read()
|
| D | objtool.h | 18 struct elf *elf; member
|
| D | special.h | 32 int special_get_alts(struct elf *elf, struct list_head *alts);
|
| D | builtin-orc.c | 58 if (!file->elf->changed) in cmd_orc() 61 return elf_write(file->elf); in cmd_orc()
|
| /kernel/linux/linux-5.10/tools/perf/util/ |
| D | symbol-elf.c | 77 static int elf_getphdrnum(Elf *elf, size_t *dst) in elf_getphdrnum() argument 82 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum() 93 static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused) in elf_getshdrstrndx() 190 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) in elf_addr_to_index() argument 196 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_addr_to_index() 209 Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, in elf_section_by_name() argument 216 if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) in elf_section_by_name() 219 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_section_by_name() 223 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); in elf_section_by_name() 235 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 | 173 Elf *elf; in elf_section_offset() local 178 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_section_offset() 179 if (elf == NULL) in elf_section_offset() 183 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_offset() 186 if (!elf_section_by_name(elf, &ehdr, &shdr, name, NULL)) in elf_section_offset() 192 elf_end(elf); in elf_section_offset() 199 Elf *elf; in elf_is_exec() local 203 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_is_exec() 204 if (elf == NULL) in elf_is_exec() 206 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_is_exec() [all …]
|
| /kernel/linux/linux-5.10/scripts/mod/ |
| D | modpost.c | 348 static enum export export_from_secname(struct elf_info *elf, unsigned int sec) in export_from_secname() argument 350 const char *secname = sec_name(elf, sec); in export_from_secname() 366 static enum export export_from_sec(struct elf_info *elf, unsigned int sec) in export_from_sec() argument 368 if (sec == elf->export_sec) in export_from_sec() 370 else if (sec == elf->export_unused_sec) in export_from_sec() 372 else if (sec == elf->export_gpl_sec) in export_from_sec() 374 else if (sec == elf->export_unused_gpl_sec) in export_from_sec() 376 else if (sec == elf->export_gpl_future_sec) in export_from_sec() 821 static const char *sym_name(struct elf_info *elf, Elf_Sym *sym) in sym_name() argument 824 return elf->strtab + sym->st_name; in sym_name() [all …]
|
| /kernel/linux/linux-5.10/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()
|
| /kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
| D | opal-core.c | 308 Elf64_Ehdr *elf; in create_opalcore() local 355 elf = (Elf64_Ehdr *)bufp; in create_opalcore() 357 memcpy(elf->e_ident, ELFMAG, SELFMAG); in create_opalcore() 358 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore() 359 elf->e_ident[EI_DATA] = ELFDATA2MSB; in create_opalcore() 360 elf->e_ident[EI_VERSION] = EV_CURRENT; in create_opalcore() 361 elf->e_ident[EI_OSABI] = ELF_OSABI; in create_opalcore() 362 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in create_opalcore() 363 elf->e_type = cpu_to_be16(ET_CORE); in create_opalcore() 364 elf->e_machine = cpu_to_be16(ELF_ARCH); in create_opalcore() [all …]
|
| /kernel/linux/linux-5.10/arch/mips/tools/ |
| D | Makefile | 2 hostprogs := elf-entry 3 PHONY += elf-entry 4 elf-entry: $(obj)/elf-entry
|
| /kernel/linux/linux-5.10/tools/bpf/resolve_btfids/ |
| D | main.c | 95 Elf *elf; member 276 static int compressed_section_fix(Elf *elf, Elf_Scn *scn, GElf_Shdr *sh) in compressed_section_fix() argument 278 int expected = gelf_getclass(elf) == ELFCLASS32 ? 4 : 8; in compressed_section_fix() 304 Elf *elf; in elf_collect() local 316 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect() 317 if (!elf) { in elf_collect() 324 obj->efile.elf = elf; in elf_collect() 326 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect() 328 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect() 337 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect() [all …]
|
| /kernel/linux/linux-5.10/fs/ |
| D | binfmt_elf_fdpic.c | 1253 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument 1255 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header() 1256 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header() 1257 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header() 1258 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header() 1259 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header() 1260 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header() 1262 elf->e_type = ET_CORE; in fill_elf_fdpic_header() 1263 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header() 1264 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header() [all …]
|
| D | binfmt_elf.c | 536 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument 1489 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument 1492 memset(elf, 0, sizeof(*elf)); in fill_elf_header() 1494 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header() 1495 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header() 1496 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header() 1497 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header() 1498 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header() 1500 elf->e_type = ET_CORE; in fill_elf_header() 1501 elf->e_machine = machine; in fill_elf_header() [all …]
|
| /kernel/linux/linux-5.10/arch/x86/realmode/rm/ |
| D | Makefile | 52 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T 55 targets += realmode.elf 56 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE 62 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE 69 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
|
| /kernel/linux/linux-5.10/samples/bpf/ |
| D | bpf_load.c | 316 static int get_sec(Elf *elf, int i, GElf_Ehdr *ehdr, char **shname, in get_sec() argument 321 scn = elf_getscn(elf, i); in get_sec() 328 *shname = elf_strptr(elf, ehdr->e_shstrndx, shdr->sh_name); in get_sec() 400 Elf *elf, Elf_Data *symbols, int strtabidx) in load_elf_maps_section() argument 416 scn = elf_getscn(elf, maps_shndx); in load_elf_maps_section() 475 map_name = elf_strptr(elf, strtabidx, sym[i].st_name); in load_elf_maps_section() 511 Elf *elf; in do_load_bpf_file() local 530 elf = elf_begin(fd, ELF_C_READ, NULL); in do_load_bpf_file() 532 if (!elf) in do_load_bpf_file() 535 if (gelf_getehdr(elf, &ehdr) != &ehdr) in do_load_bpf_file() [all …]
|
| /kernel/linux/linux-5.10/arch/powerpc/kernel/ |
| D | fadump.c | 953 struct elfhdr *elf; in fadump_init_elfcore_header() local 955 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header() 957 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header() 958 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header() 959 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header() 960 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header() 961 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header() 962 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header() 963 elf->e_type = ET_CORE; in fadump_init_elfcore_header() 964 elf->e_machine = ELF_ARCH; in fadump_init_elfcore_header() [all …]
|
| /kernel/linux/linux-5.10/arch/xtensa/boot/boot-redboot/ |
| D | Makefile | 29 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) 30 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) 32 $(obj)/../zImage.redboot: $(obj)/zImage.elf
|
| /kernel/linux/linux-5.10/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()
|
| /kernel/linux/linux-5.10/arch/xtensa/boot/ |
| D | Makefile | 30 Image: boot-elf 35 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) 46 boot-elf: $(obj)/vmlinux.bin
|
| /kernel/linux/linux-5.10/arch/xtensa/boot/boot-elf/ |
| D | Makefile | 28 $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds 35 all Image: $(obj)/../Image.elf
|