Home
last modified time | relevance | path

Searched refs:elf (Results 1 – 25 of 67) sorted by relevance

123

/Linux-v5.4/tools/objtool/
Delf.c24 struct section *find_section_by_name(struct elf *elf, const char *name) in find_section_by_name() argument
28 list_for_each_entry(sec, &elf->sections, list) in find_section_by_name()
35 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index() argument
40 list_for_each_entry(sec, &elf->sections, list) in find_section_by_index()
47 static struct symbol *find_symbol_by_index(struct elf *elf, unsigned int idx) in find_symbol_by_index() argument
52 list_for_each_entry(sec, &elf->sections, list) in find_symbol_by_index()
72 struct symbol *find_symbol_by_name(struct elf *elf, const char *name) in find_symbol_by_name() argument
77 list_for_each_entry(sec, &elf->sections, list) in find_symbol_by_name()
131 static int read_sections(struct elf *elf) in read_sections() argument
138 if (elf_getshdrnum(elf->elf, &sections_nr)) { in read_sections()
[all …]
Delf.h68 struct elf { struct
69 Elf *elf; argument
78 struct elf *elf_read(const char *name, int flags); argument
79 struct section *find_section_by_name(struct elf *elf, const char *name);
81 struct symbol *find_symbol_by_name(struct elf *elf, const char *name);
87 struct section *elf_create_section(struct elf *elf, const char *name, size_t
89 struct section *elf_create_rela_section(struct elf *elf, struct section *base);
91 int elf_write(struct elf *elf);
92 void elf_close(struct elf *elf);
95 list_for_each_entry(sec, &file->elf->sections, list)
Dorc_dump.c70 Elf *elf; in orc_dump() local
88 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump()
89 if (!elf) { in orc_dump()
94 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump()
99 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump()
105 scn = elf_getscn(elf, i); in orc_dump()
116 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump()
162 scn = elf_getscn(elf, sym.st_shndx); in orc_dump()
173 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump()
198 elf_end(elf); in orc_dump()
Dspecial.c71 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument
159 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument
170 sec = find_section_by_name(elf, entry->sec); in special_get_alts()
190 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
Dspecial.h29 int special_get_alts(struct elf *elf, struct list_head *alts);
Dorc_gen.c131 sec = find_section_by_name(file->elf, ".orc_unwind"); in create_orc_sections()
162 sec = elf_create_section(file->elf, ".orc_unwind_ip", sizeof(int), idx); in create_orc_sections()
166 ip_relasec = elf_create_rela_section(file->elf, sec); in create_orc_sections()
171 u_sec = elf_create_section(file->elf, ".orc_unwind", in create_orc_sections()
Darch.h71 int arch_decode_instruction(struct elf *elf, struct section *sec,
/Linux-v5.4/tools/perf/util/
Dsymbol-elf.c75 static int elf_getphdrnum(Elf *elf, size_t *dst) in elf_getphdrnum() argument
80 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum()
91 static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused) in elf_getshdrstrndx()
188 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) in elf_addr_to_index() argument
194 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_addr_to_index()
207 Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, in elf_section_by_name() argument
214 if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) in elf_section_by_name()
217 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_section_by_name()
221 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); in elf_section_by_name()
294 Elf *elf; in dso__synthesize_plt_symbols() local
[all …]
Dunwind-libunwind-local.c173 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 …]
/Linux-v5.4/scripts/mod/
Dmodpost.c303 static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr) in sech_name() argument
305 return (void *)elf->hdr + in sech_name()
306 elf->sechdrs[elf->secindex_strings].sh_offset + in sech_name()
310 static const char *sec_name(struct elf_info *elf, int secindex) in sec_name() argument
312 return sech_name(elf, &elf->sechdrs[secindex]); in sec_name()
317 static enum export export_from_secname(struct elf_info *elf, unsigned int sec) in export_from_secname() argument
319 const char *secname = sec_name(elf, sec); in export_from_secname()
335 static enum export export_from_sec(struct elf_info *elf, unsigned int sec) in export_from_sec() argument
337 if (sec == elf->export_sec) in export_from_sec()
339 else if (sec == elf->export_unused_sec) in export_from_sec()
[all …]
/Linux-v5.4/arch/alpha/boot/tools/
Dobjstrip.c61 struct elfhdr *elf; in main() local
149 elf = (struct elfhdr *) buf; in main()
151 if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) { 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-v5.4/arch/powerpc/platforms/powernv/
Dopal-core.c307 Elf64_Ehdr *elf; in create_opalcore() local
354 elf = (Elf64_Ehdr *)bufp; in create_opalcore()
356 memcpy(elf->e_ident, ELFMAG, SELFMAG); in create_opalcore()
357 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore()
358 elf->e_ident[EI_DATA] = ELFDATA2MSB; in create_opalcore()
359 elf->e_ident[EI_VERSION] = EV_CURRENT; in create_opalcore()
360 elf->e_ident[EI_OSABI] = ELF_OSABI; in create_opalcore()
361 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in create_opalcore()
362 elf->e_type = cpu_to_be16(ET_CORE); in create_opalcore()
363 elf->e_machine = cpu_to_be16(ELF_ARCH); in create_opalcore()
[all …]
/Linux-v5.4/arch/mips/tools/
DMakefile2 hostprogs-y := elf-entry
3 PHONY += elf-entry
4 elf-entry: $(obj)/elf-entry
/Linux-v5.4/arch/powerpc/kernel/
Dfadump.c657 struct elfhdr *elf; in fadump_update_elfcore_header() local
660 elf = (struct elfhdr *)bufp; in fadump_update_elfcore_header()
841 struct elfhdr *elf; in fadump_init_elfcore_header() local
843 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header()
845 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header()
846 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header()
847 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header()
848 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header()
849 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header()
850 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header()
[all …]
/Linux-v5.4/arch/x86/realmode/rm/
DMakefile49 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
52 targets += realmode.elf
53 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
59 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
66 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
/Linux-v5.4/samples/bpf/
Dbpf_load.c316 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 …]
/Linux-v5.4/fs/
Dbinfmt_elf_fdpic.c1290 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument
1292 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header()
1293 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header()
1294 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header()
1295 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header()
1296 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header()
1297 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header()
1299 elf->e_type = ET_CORE; in fill_elf_fdpic_header()
1300 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header()
1301 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header()
[all …]
Dbinfmt_elf.c496 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
1426 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1429 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1431 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1432 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1433 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1434 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1435 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1437 elf->e_type = ET_CORE; in fill_elf_header()
1438 elf->e_machine = machine; in fill_elf_header()
[all …]
/Linux-v5.4/arch/xtensa/boot/
DMakefile29 Image: boot-elf
33 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
44 boot-elf: vmlinux.bin
/Linux-v5.4/arch/xtensa/boot/boot-redboot/
DMakefile28 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
29 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
31 $(obj)/../zImage.redboot: $(obj)/zImage.elf
/Linux-v5.4/tools/build/feature/
Dtest-libelf-mmap.c6 Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0); in main() local
8 return (long)elf; in main()
Dtest-libelf.c6 Elf *elf = elf_begin(0, ELF_C_READ, 0); in main() local
8 return (long)elf; in main()
/Linux-v5.4/tools/objtool/arch/x86/
Ddecode.c29 static int is_x86_64(struct elf *elf) in is_x86_64() argument
31 switch (elf->ehdr.e_machine) { in is_x86_64()
37 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64()
69 int arch_decode_instruction(struct elf *elf, struct section *sec, in arch_decode_instruction() argument
80 x86_64 = is_x86_64(elf); in arch_decode_instruction()
/Linux-v5.4/arch/xtensa/boot/boot-elf/
DMakefile27 $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
34 all Image: $(obj)/../Image.elf
/Linux-v5.4/arch/x86/boot/
DMakefile29 targets := vmlinux.bin setup.bin setup.elf bzImage
103 LDFLAGS_setup.elf := -m elf_i386 -T
104 $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
108 $(obj)/setup.bin: $(obj)/setup.elf FORCE

123