Home
last modified time | relevance | path

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

12345

/linux/tools/objtool/
A Delf.c337 s = elf_getscn(elf->elf, i); in read_sections()
384 if (elf_nextscn(elf->elf, s)) { in read_sections()
996 struct elf *elf; in elf_open_read() local
1001 elf = malloc(sizeof(*elf)); in elf_open_read()
1006 memset(elf, 0, sizeof(*elf)); in elf_open_read()
1024 elf->elf = elf_begin(elf->fd, cmd, NULL); in elf_open_read()
1025 if (!elf->elf) { in elf_open_read()
1030 if (!gelf_getehdr(elf->elf, &elf->ehdr)) { in elf_open_read()
1104 s = elf_newscn(elf->elf); in elf_create_section()
1341 if (elf->elf) in elf_close()
[all …]
A Dorc_dump.c21 Elf *elf; in orc_dump() local
27 struct elf dummy_elf = {}; in orc_dump()
40 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump()
41 if (!elf) { in orc_dump()
46 if (!elf64_getehdr(elf)) { in orc_dump()
52 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump()
57 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump()
63 scn = elf_getscn(elf, i); in orc_dump()
74 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump()
123 scn = elf_getscn(elf, sym.st_shndx); in orc_dump()
[all …]
A Dspecial.c68 static int get_alt_entry(struct elf *elf, const struct special_entry *entry, in get_alt_entry() argument
87 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); in get_alt_entry()
98 feature = bswap_if_needed(elf, in get_alt_entry()
106 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); in get_alt_entry()
123 key_reloc = find_reloc_by_dest(elf, sec, offset + entry->key); in get_alt_entry()
140 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument
151 sec = find_section_by_name(elf, entry->sec); in special_get_alts()
171 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
/linux/tools/objtool/include/objtool/
A Delf.h83 struct elf { struct
84 Elf *elf; member
111 struct section *elf_create_section(struct elf *elf, const char *name,
131 int elf_write_insn(struct elf *elf, struct section *sec,
134 int elf_write(struct elf *elf);
135 void elf_close(struct elf *elf);
153 static inline bool has_multiple_files(struct elf *elf) in has_multiple_files() argument
158 static inline size_t elf_addr_size(struct elf *elf) in elf_addr_size() argument
163 static inline size_t elf_rela_size(struct elf *elf) in elf_rela_size() argument
168 static inline unsigned int elf_data_rela_type(struct elf *elf) in elf_data_rela_type() argument
[all …]
A Dendianness.h15 static inline bool need_bswap(struct elf *elf) in need_bswap() argument
18 (elf->ehdr.e_ident[EI_DATA] == ELFDATA2LSB); in need_bswap()
21 #define bswap_if_needed(elf, val) \ argument
24 bool __need_bswap = need_bswap(elf); \
A Dorc.h8 void orc_print_dump(struct elf *dummy_elf, struct orc_entry *orc, int i);
9 int write_orc_entry(struct elf *elf, struct section *orc_sec,
/linux/scripts/mod/
A Dsymsearch.c54 for (Elf_Sym *sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in symbol_count()
55 if (is_valid_name(elf, sym)) in symbol_count()
74 for (Elf_Sym *sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in symsearch_populate()
75 if (is_valid_name(elf, sym)) { in symsearch_populate()
124 void symsearch_init(struct elf_info *elf) in symsearch_init() argument
130 elf->symsearch->table_size = table_size; in symsearch_init()
132 symsearch_populate(elf, elf->symsearch->table, table_size); in symsearch_init()
133 qsort(elf->symsearch->table, table_size, in symsearch_init()
141 free(elf->symsearch); in symsearch_finish()
142 elf->symsearch = NULL; in symsearch_finish()
[all …]
A Dmodpost.c979 if (is_valid_name(elf, sym)) in find_tosym()
986 new_sym = symsearch_find_nearest(elf, addr, get_secindex(elf, sym), in find_tosym()
993 if (secndx >= elf->num_sections) in is_executable_section()
1011 fromsym = sym_name(elf, from); in default_mismatch_handler()
1014 tosym = sym_name(elf, tsym); in default_mismatch_handler()
1042 else if (is_executable_section(elf, get_secindex(elf, tsym))) in default_mismatch_handler()
1067 label = find_fromsym(elf, faddr, elf->export_symbol_secndx); in check_export_symbol()
1083 name = sym_name(elf, sym); in check_export_symbol()
1132 const char *tosec = sec_name(elf, get_secindex(elf, sym)); in check_section_mismatch()
1339 switch (elf->hdr->e_machine) { in section_rela()
[all …]
A Dmodpost.h154 static inline bool is_valid_name(struct elf_info *elf, Elf_Sym *sym) in is_valid_name() argument
156 const char *name = elf->strtab + sym->st_name; in is_valid_name()
164 void symsearch_init(struct elf_info *elf);
165 void symsearch_finish(struct elf_info *elf);
166 Elf_Sym *symsearch_find_nearest(struct elf_info *elf, Elf_Addr addr,
/linux/arch/arm64/kvm/hyp/nvhe/
A Dgen-hyprel.c140 } elf; variable
167 elf.path, ## __VA_ARGS__); \
175 elf.path, strerror(errno)); \
205 for (var = elf.sh_table; var < elf.sh_table + elf16toh(elf.ehdr->e_shnum); ++var)
221 return elf.sh_string + elf32toh(shdr->sh_name); in section_name()
241 return &elf.sh_table[idx]; in section_by_idx()
254 elf.path = path; in init_elf()
270 if (elf.begin == MAP_FAILED) { in init_elf()
280 elf.ehdr = elf_ptr(Elf64_Ehdr, 0); in init_elf()
295 elf.sh_table = section_by_off(elf64toh(elf.ehdr->e_shoff)); in init_elf()
[all …]
/linux/tools/perf/util/
A Dsymbol-elf.c229 Elf *elf; in filename__has_section() local
684 Elf *elf; in dso__synthesize_plt_symbols() local
689 elf = ss->elf; in dso__synthesize_plt_symbols()
971 Elf *elf; in read_build_id() local
1124 Elf *elf; in filename__read_debuglink() local
1233 Elf *elf; in symsrc__init() local
1319 ss->elf = elf; in symsrc__init()
1556 Elf *elf; in dso__load_sym_internal() local
1564 elf = syms_ss->elf; in dso__load_sym_internal()
1897 Elf *elf; in file__read_maps() local
[all …]
A Dunwind-libunwind-local.c174 Elf *elf; in elf_section_address_and_offset() local
180 if (elf == NULL) in elf_section_address_and_offset()
183 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_address_and_offset()
193 elf_end(elf); in elf_section_address_and_offset()
216 if (elf == NULL) in elf_base_address()
218 (void)elf_getphdrnum(elf, &phdrnum); in elf_base_address()
227 elf_end(elf); in elf_base_address()
234 Elf *elf; in elf_is_exec() local
239 if (elf == NULL) in elf_is_exec()
241 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_is_exec()
[all …]
/linux/tools/lib/bpf/
A Delf.c29 Elf *elf; in elf_open() local
31 elf_fd->elf = NULL; in elf_open()
45 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in elf_open()
46 if (!elf) { in elf_open()
52 elf_fd->elf = elf; in elf_open()
60 elf_end(elf_fd->elf); in elf_close()
87 Elf *elf; member
100 Elf *elf, const char *binary_path, in elf_sym_iter_new() argument
109 if (!gelf_getehdr(elf, &ehdr)) { in elf_sym_iter_new()
132 iter->elf = elf; in elf_sym_iter_new()
[all …]
A Dusdt.c310 if (elf_kind(elf) != ELF_K_ELF) { in sanity_check_usdt_elf()
315 switch (gelf_getclass(elf)) { in sanity_check_usdt_elf()
333 if (!gelf_getehdr(elf, &ehdr)) in sanity_check_usdt_elf()
362 if (elf_getshdrstrndx(elf, &shstrndx)) in find_elf_sec_by_name()
366 if (!elf_rawdata(elf_getscn(elf, shstrndx), NULL)) in find_elf_sec_by_name()
369 while ((sec = elf_nextscn(elf, sec)) != NULL) { in find_elf_sec_by_name()
375 name = elf_strptr(elf, shstrndx, shdr->sh_name); in find_elf_sec_by_name()
410 if (elf_getphdrnum(elf, &n)) { in parse_elf_segs()
416 if (!gelf_getphdr(elf, i, &phdr)) { in parse_elf_segs()
607 err = parse_elf_segs(elf, path, &segs, &seg_cnt); in collect_usdt_targets()
[all …]
/linux/arch/powerpc/platforms/powernv/
A Dopal-core.c308 Elf64_Ehdr *elf; in create_opalcore() local
357 elf = (Elf64_Ehdr *)bufp; in create_opalcore()
360 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore()
368 elf->e_entry = 0; in create_opalcore()
370 elf->e_shoff = 0; in create_opalcore()
371 elf->e_flags = 0; in create_opalcore()
375 elf->e_phnum = 0; in create_opalcore()
376 elf->e_shentsize = 0; in create_opalcore()
377 elf->e_shnum = 0; in create_opalcore()
378 elf->e_shstrndx = 0; in create_opalcore()
[all …]
/linux/arch/alpha/boot/tools/
A Dobjstrip.c61 struct elfhdr *elf; in main() local
149 elf = (struct elfhdr *) buf; in main()
151 if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) == 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/arch/mips/tools/
A DMakefile2 hostprogs := elf-entry
3 PHONY += elf-entry
4 elf-entry: $(obj)/elf-entry
/linux/tools/bpf/resolve_btfids/
A Dmain.c121 Elf *elf; member
334 Elf *elf; in elf_collect() local
346 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect()
347 if (!elf) { in elf_collect()
355 obj->efile.elf = elf; in elf_collect()
357 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect()
359 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect()
375 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect()
422 if (compressed_section_fix(elf, scn, &sh)) in elf_collect()
828 if (obj.efile.elf) { in main()
[all …]
/linux/fs/
A Dbinfmt_elf_fdpic.c1242 elf->e_entry = 0; in fill_elf_fdpic_header()
1244 elf->e_shoff = 0; in fill_elf_fdpic_header()
1248 elf->e_phnum = segs; in fill_elf_fdpic_header()
1249 elf->e_shentsize = 0; in fill_elf_fdpic_header()
1250 elf->e_shnum = 0; in fill_elf_fdpic_header()
1251 elf->e_shstrndx = 0; in fill_elf_fdpic_header()
1422 elf->e_shnum = 1; in fill_extnum_info()
1478 elf = kmalloc(sizeof(*elf), GFP_KERNEL); in elf_fdpic_core_dump()
1479 if (!elf) in elf_fdpic_core_dump()
1562 if (!dump_emit(cprm, elf, sizeof(*elf))) in elf_fdpic_core_dump()
[all …]
/linux/tools/objtool/arch/x86/
A Dorc.c100 int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument
110 orc->sp_offset = bswap_if_needed(elf, orc->sp_offset); in write_orc_entry()
111 orc->bp_offset = bswap_if_needed(elf, orc->bp_offset); in write_orc_entry()
114 if (!elf_init_reloc_text_sym(elf, ip_sec, idx * sizeof(int), idx, in write_orc_entry()
177 void orc_print_dump(struct elf *dummy_elf, struct orc_entry *orc, int i) in orc_print_dump()
/linux/arch/powerpc/kernel/
A Dfadump.c939 elf->e_entry = 0; in fadump_init_elfcore_header()
941 elf->e_shoff = 0; in fadump_init_elfcore_header()
944 elf->e_flags = 2; in fadump_init_elfcore_header()
946 elf->e_flags = 1; in fadump_init_elfcore_header()
948 elf->e_flags = 0; in fadump_init_elfcore_header()
952 elf->e_phnum = 0; in fadump_init_elfcore_header()
954 elf->e_shnum = 0; in fadump_init_elfcore_header()
1034 (elf->e_phnum)++; in fadump_populate_elfcorehdr()
1046 (elf->e_phnum)++; in fadump_populate_elfcorehdr()
1060 (elf->e_phnum)++; in fadump_populate_elfcorehdr()
[all …]
/linux/arch/x86/realmode/rm/
A DMakefile44 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
47 targets += realmode.elf
48 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
54 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
61 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
/linux/tools/testing/selftests/sgx/
A DMakefile23 TEST_FILES := $(OUTPUT)/test_encl.elf
25 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
50 $(OUTPUT)/test_encl.elf: test_encl.c test_encl_bootstrap.S
54 $(OUTPUT)/test_encl.elf \
/linux/tools/objtool/arch/loongarch/
A Ddecode.c64 static bool is_loongarch(const struct elf *elf) in is_loongarch() argument
66 if (elf->ehdr.e_machine == EM_LOONGARCH) in is_loongarch()
69 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_loongarch()
289 const struct elf *elf = file->elf; in arch_decode_instruction() local
293 if (!is_loongarch(elf)) in arch_decode_instruction()
/linux/drivers/firmware/efi/libstub/
A DMakefile.zboot55 LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds
56 $(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE
60 $(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE
63 targets += zboot-header.o vmlinux.bin vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi

Completed in 68 milliseconds

12345