Home
last modified time | relevance | path

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

123

/Linux-v4.19/tools/objtool/
Delf.c34 struct section *find_section_by_name(struct elf *elf, const char *name) in find_section_by_name() argument
38 list_for_each_entry(sec, &elf->sections, list) in find_section_by_name()
45 static struct section *find_section_by_index(struct elf *elf, in find_section_by_index() argument
50 list_for_each_entry(sec, &elf->sections, list) in find_section_by_index()
57 static struct symbol *find_symbol_by_index(struct elf *elf, unsigned int idx) in find_symbol_by_index() argument
62 list_for_each_entry(sec, &elf->sections, list) in find_symbol_by_index()
82 struct symbol *find_symbol_by_name(struct elf *elf, const char *name) in find_symbol_by_name() argument
87 list_for_each_entry(sec, &elf->sections, list) in find_symbol_by_name()
141 static int read_sections(struct elf *elf) in read_sections() argument
148 if (elf_getshdrnum(elf->elf, &sections_nr)) { in read_sections()
[all …]
Delf.h77 struct elf { struct
78 Elf *elf; member
87 struct elf *elf_open(const char *name, int flags); argument
88 struct section *find_section_by_name(struct elf *elf, const char *name);
90 struct symbol *find_symbol_by_name(struct elf *elf, const char *name);
96 struct section *elf_create_section(struct elf *elf, const char *name, size_t
98 struct section *elf_create_rela_section(struct elf *elf, struct section *base);
100 int elf_write(struct elf *elf);
101 void elf_close(struct elf *elf);
104 list_for_each_entry(sec, &file->elf->sections, list)
Dorc_dump.c82 Elf *elf; in orc_dump() local
100 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump()
101 if (!elf) { in orc_dump()
106 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump()
111 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump()
117 scn = elf_getscn(elf, i); in orc_dump()
128 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump()
174 scn = elf_getscn(elf, sym.st_shndx); in orc_dump()
185 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump()
210 elf_end(elf); in orc_dump()
Dspecial.c81 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument
153 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument
164 sec = find_section_by_name(elf, entry->sec); in special_get_alts()
184 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
Dspecial.h40 int special_get_alts(struct elf *elf, struct list_head *alts);
Dorc_gen.c143 sec = find_section_by_name(file->elf, ".orc_unwind"); in create_orc_sections()
174 sec = elf_create_section(file->elf, ".orc_unwind_ip", sizeof(int), idx); in create_orc_sections()
178 ip_relasec = elf_create_rela_section(file->elf, sec); in create_orc_sections()
183 u_sec = elf_create_section(file->elf, ".orc_unwind", in create_orc_sections()
Darch.h75 int arch_decode_instruction(struct elf *elf, struct section *sec,
Dcheck.h60 struct elf *elf; member
/Linux-v4.19/tools/perf/util/
Dsymbol-elf.c46 static int elf_getphdrnum(Elf *elf, size_t *dst) in elf_getphdrnum() argument
51 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum()
62 static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused) in elf_getshdrstrndx()
152 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) in elf_addr_to_index() argument
158 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_addr_to_index()
171 Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, in elf_section_by_name() argument
178 if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) in elf_section_by_name()
181 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_section_by_name()
185 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); in elf_section_by_name()
258 Elf *elf; in dso__synthesize_plt_symbols() local
[all …]
Dunwind-libunwind-local.c172 Elf *elf; in elf_section_offset() local
177 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_section_offset()
178 if (elf == NULL) in elf_section_offset()
182 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_offset()
185 if (!elf_section_by_name(elf, &ehdr, &shdr, name, NULL)) in elf_section_offset()
191 elf_end(elf); in elf_section_offset()
198 Elf *elf; in elf_is_exec() local
202 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_is_exec()
203 if (elf == NULL) in elf_is_exec()
205 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_is_exec()
[all …]
/Linux-v4.19/scripts/mod/
Dmodpost.c268 static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr) in sech_name() argument
270 return (void *)elf->hdr + in sech_name()
271 elf->sechdrs[elf->secindex_strings].sh_offset + in sech_name()
275 static const char *sec_name(struct elf_info *elf, int secindex) in sec_name() argument
277 return sech_name(elf, &elf->sechdrs[secindex]); in sec_name()
282 static enum export export_from_secname(struct elf_info *elf, unsigned int sec) in export_from_secname() argument
284 const char *secname = sec_name(elf, sec); in export_from_secname()
300 static enum export export_from_sec(struct elf_info *elf, unsigned int sec) in export_from_sec() argument
302 if (sec == elf->export_sec) in export_from_sec()
304 else if (sec == elf->export_unused_sec) in export_from_sec()
[all …]
/Linux-v4.19/arch/ia64/hp/sim/boot/
Dbootloader.c64 struct elfhdr *elf; in start_bootloader() local
114 elf = (struct elfhdr *) mem; in start_bootloader()
115 if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) != 0) { in start_bootloader()
119 if (elf->e_type != ET_EXEC) { in start_bootloader()
123 if (!elf_check_arch(elf)) { in start_bootloader()
128 e_entry = elf->e_entry; in start_bootloader()
129 e_phnum = elf->e_phnum; in start_bootloader()
130 e_phoff = elf->e_phoff; in start_bootloader()
/Linux-v4.19/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-v4.19/arch/powerpc/kernel/
Dfadump.c674 struct elfhdr *elf; in fadump_update_elfcore_header() local
677 elf = (struct elfhdr *)bufp; in fadump_update_elfcore_header()
979 struct elfhdr *elf; in fadump_init_elfcore_header() local
981 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header()
983 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header()
984 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header()
985 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header()
986 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header()
987 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header()
988 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header()
[all …]
/Linux-v4.19/arch/x86/realmode/rm/
DMakefile50 LDFLAGS_realmode.elf := --emit-relocs -T
53 targets += realmode.elf
54 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
60 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
67 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
/Linux-v4.19/samples/bpf/
Dbpf_load.c300 static int get_sec(Elf *elf, int i, GElf_Ehdr *ehdr, char **shname, in get_sec() argument
305 scn = elf_getscn(elf, i); in get_sec()
312 *shname = elf_strptr(elf, ehdr->e_shstrndx, shdr->sh_name); in get_sec()
384 Elf *elf, Elf_Data *symbols, int strtabidx) in load_elf_maps_section() argument
400 scn = elf_getscn(elf, maps_shndx); in load_elf_maps_section()
459 map_name = elf_strptr(elf, strtabidx, sym[i].st_name); in load_elf_maps_section()
495 Elf *elf; in do_load_bpf_file() local
514 elf = elf_begin(fd, ELF_C_READ, NULL); in do_load_bpf_file()
516 if (!elf) in do_load_bpf_file()
519 if (gelf_getehdr(elf, &ehdr) != &ehdr) in do_load_bpf_file()
[all …]
/Linux-v4.19/fs/
Dbinfmt_elf_fdpic.c1294 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument
1296 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header()
1297 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header()
1298 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header()
1299 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header()
1300 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header()
1301 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header()
1303 elf->e_type = ET_CORE; in fill_elf_fdpic_header()
1304 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header()
1305 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header()
[all …]
Dbinfmt_elf.c500 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
1445 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1448 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1450 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1451 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1452 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1453 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1454 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1456 elf->e_type = ET_CORE; in fill_elf_header()
1457 elf->e_machine = machine; in fill_elf_header()
[all …]
/Linux-v4.19/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-v4.19/arch/xtensa/boot/
DMakefile29 Image: boot-elf
33 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
44 boot-elf: vmlinux.bin
/Linux-v4.19/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-v4.19/tools/objtool/arch/x86/
Ddecode.c41 static int is_x86_64(struct elf *elf) in is_x86_64() argument
43 switch (elf->ehdr.e_machine) { in is_x86_64()
49 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64()
81 int arch_decode_instruction(struct elf *elf, struct section *sec, in arch_decode_instruction() argument
92 x86_64 = is_x86_64(elf); in arch_decode_instruction()
/Linux-v4.19/arch/xtensa/boot/boot-elf/
DMakefile27 $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
34 all Image: $(obj)/../Image.elf
/Linux-v4.19/arch/x86/boot/
DMakefile29 targets := vmlinux.bin setup.bin setup.elf bzImage
103 LDFLAGS_setup.elf := -T
104 $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
108 $(obj)/setup.bin: $(obj)/setup.elf FORCE

123