Home
last modified time | relevance | path

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

123

/Linux-v5.10/tools/objtool/
Delf.c130 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 …]
Delf.h80 struct elf { struct
81 Elf *elf; member
123 struct elf *elf_open_read(const char *name, int flags);
124 struct section *elf_create_section(struct elf *elf, const char *name, unsigned int sh_flags, size_t…
125 struct section *elf_create_reloc_section(struct elf *elf, struct section *base, int reltype);
126 void elf_add_reloc(struct elf *elf, struct reloc *reloc);
127 int elf_write_insn(struct elf *elf, struct section *sec,
130 int elf_write_reloc(struct elf *elf, struct reloc *reloc);
131 int elf_write(struct elf *elf);
132 void elf_close(struct elf *elf);
[all …]
Dorc_dump.c72 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 …]
Dorc_gen.c89 static int create_orc_entry(struct elf *elf, struct section *u_sec, struct section *ip_relocsec, in create_orc_entry() argument
138 elf_add_reloc(elf, reloc); in create_orc_entry()
155 sec = find_section_by_name(file->elf, ".orc_unwind"); in create_orc_sections()
186 sec = elf_create_section(file->elf, ".orc_unwind_ip", 0, sizeof(int), idx); in create_orc_sections()
190 ip_relocsec = elf_create_reloc_section(file->elf, sec, SHT_RELA); in create_orc_sections()
195 u_sec = elf_create_section(file->elf, ".orc_unwind", 0, in create_orc_sections()
209 if (create_orc_entry(file->elf, u_sec, ip_relocsec, idx, in create_orc_sections()
221 if (create_orc_entry(file->elf, u_sec, ip_relocsec, idx, in create_orc_sections()
231 if (elf_rebuild_reloc_section(file->elf, ip_relocsec)) in create_orc_sections()
Dspecial.c58 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument
85 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); in get_alt_entry()
100 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()
Dobjtool.c58 file.elf = elf_open_read(objname, O_RDWR); in objtool_open_read()
59 if (!file.elf) in objtool_open_read()
65 file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment"); in objtool_open_read()
Dobjtool.h18 struct elf *elf; member
Dspecial.h32 int special_get_alts(struct elf *elf, struct list_head *alts);
Dbuiltin-orc.c62 if (!file->elf->changed) in cmd_orc()
65 return elf_write(file->elf); in cmd_orc()
Dbuiltin-check.c66 if (file->elf->changed) in cmd_check()
67 return elf_write(file->elf); in cmd_check()
/Linux-v5.10/tools/perf/util/
Dsymbol-elf.c77 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()
296 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.10/scripts/mod/
Dmodpost.c356 static enum export export_from_secname(struct elf_info *elf, unsigned int sec) in export_from_secname() argument
358 const char *secname = sec_name(elf, sec); in export_from_secname()
374 static enum export export_from_sec(struct elf_info *elf, unsigned int sec) in export_from_sec() argument
376 if (sec == elf->export_sec) in export_from_sec()
378 else if (sec == elf->export_unused_sec) in export_from_sec()
380 else if (sec == elf->export_gpl_sec) in export_from_sec()
382 else if (sec == elf->export_unused_gpl_sec) in export_from_sec()
384 else if (sec == elf->export_gpl_future_sec) in export_from_sec()
829 static const char *sym_name(struct elf_info *elf, Elf_Sym *sym) in sym_name() argument
832 return elf->strtab + sym->st_name; in sym_name()
[all …]
/Linux-v5.10/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 && 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-v5.10/arch/powerpc/platforms/powernv/
Dopal-core.c308 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 …]
/Linux-v5.10/arch/mips/tools/
DMakefile2 hostprogs := elf-entry
3 PHONY += elf-entry
4 elf-entry: $(obj)/elf-entry
/Linux-v5.10/tools/bpf/resolve_btfids/
Dmain.c95 Elf *elf; member
271 static int compressed_section_fix(Elf *elf, Elf_Scn *scn, GElf_Shdr *sh) in compressed_section_fix() argument
273 int expected = gelf_getclass(elf) == ELFCLASS32 ? 4 : 8; in compressed_section_fix()
299 Elf *elf; in elf_collect() local
311 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect()
312 if (!elf) { in elf_collect()
319 obj->efile.elf = elf; in elf_collect()
321 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect()
323 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect()
332 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect()
[all …]
/Linux-v5.10/fs/
Dbinfmt_elf_fdpic.c1252 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument
1254 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header()
1255 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header()
1256 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header()
1257 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header()
1258 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header()
1259 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header()
1261 elf->e_type = ET_CORE; in fill_elf_fdpic_header()
1262 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header()
1263 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header()
[all …]
Dbinfmt_elf.c536 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
1452 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1455 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1457 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1458 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1459 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1460 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1461 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1463 elf->e_type = ET_CORE; in fill_elf_header()
1464 elf->e_machine = machine; in fill_elf_header()
[all …]
/Linux-v5.10/arch/x86/realmode/rm/
DMakefile52 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
/Linux-v5.10/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.10/arch/powerpc/kernel/
Dfadump.c949 struct elfhdr *elf; in fadump_init_elfcore_header() local
951 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header()
953 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header()
954 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header()
955 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header()
956 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header()
957 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header()
958 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header()
959 elf->e_type = ET_CORE; in fadump_init_elfcore_header()
960 elf->e_machine = ELF_ARCH; in fadump_init_elfcore_header()
[all …]
/Linux-v5.10/arch/xtensa/boot/boot-redboot/
DMakefile29 $(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
/Linux-v5.10/tools/build/feature/
Dtest-libelf.c6 Elf *elf = elf_begin(0, ELF_C_READ, 0); in main() local
8 return (long)elf; in main()
/Linux-v5.10/arch/xtensa/boot/
DMakefile30 Image: boot-elf
35 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
46 boot-elf: $(obj)/vmlinux.bin

123