Home
last modified time | relevance | path

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

12345

/linux/tools/objtool/include/objtool/
H A Delf.h19 #include <arch/elf.h>
24 #define bswap_if_needed(elf, val) __bswap_if_needed(&elf->ehdr, val)
106 struct elf { argument
107 Elf *elf;
133 struct elf *elf_open_read(const char *name, int flags);
134 struct elf *elf_create_file(GElf_Ehdr *ehdr, const char *name);
136 struct section *elf_create_section(struct elf *elf, const char *name,
140 struct section *elf_create_section_pair(struct elf *el
86 struct elf { global() struct
87 elfelf global() argument
102 symbol_hashelf global() argument
103 symbol_name_hashelf global() argument
104 section_hashelf global() argument
105 section_name_hashelf global() argument
112 symbol_dataelf global() argument
156 has_multiple_files(struct elf * elf) has_multiple_files() argument
161 elf_addr_size(struct elf * elf) elf_addr_size() argument
166 elf_rela_size(struct elf * elf) elf_rela_size() argument
171 elf_data_rela_type(struct elf * elf) elf_data_rela_type() argument
176 elf_text_rela_type(struct elf * elf) elf_text_rela_type() argument
191 mark_sec_changed(struct elf * elf,struct section * sec,bool changed) mark_sec_changed() argument
246 set_reloc_offset(struct elf * elf,struct reloc * reloc,u64 offset) set_reloc_offset() argument
257 set_reloc_addend(struct elf * elf,struct reloc * reloc,s64 addend) set_reloc_addend() argument
282 set_reloc_sym(struct elf * elf,struct reloc * reloc,unsigned int sym) set_reloc_sym() argument
292 set_reloc_type(struct elf * elf,struct reloc * reloc,unsigned int type) set_reloc_type() argument
[all...]
H A Dendianness.h15 need_bswap(struct elf * elf) need_bswap() argument
21 bswap_if_needed(elf,val) global() argument
H 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/
H A Dsymsearch.c50 static unsigned int symbol_count(struct elf_info *elf) in symbol_count() argument
54 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()
68 static void symsearch_populate(struct elf_info *elf, in symsearch_populate() argument
72 bool is_arm = (elf->hdr->e_machine == EM_ARM); in symsearch_populate()
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()
78 table->symbol_index = sym - elf->symtab_start; in symsearch_populate()
79 table->section_index = get_secindex(elf, sym); in symsearch_populate()
124 void symsearch_init(struct elf_info *elf) in symsearch_init() argument
[all …]
/linux/arch/arm64/kvm/hyp/nvhe/
H A Dgen-hyprel.c140 } elf; variable
167 elf.path, ## __VA_ARGS__); \
175 elf.path, strerror(errno)); \
201 #define elf_ptr(type, off) ((type *)(elf.begin + (off)))
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()
269 elf.begin = mmap(0, stat.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in init_elf()
270 if (elf.begin == MAP_FAILED) { in init_elf()
[all …]
/linux/tools/perf/util/
H A Dsymbol-elf.c54 static int elf_getphdrnum(Elf *elf, size_t *dst) in elf_getphdrnum() argument
59 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum()
70 static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused) in elf_getshdrstrndx()
167 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) in elf_addr_to_index() argument
173 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_addr_to_index()
186 Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, in elf_section_by_name() argument
193 if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) in elf_section_by_name()
196 while ((sec = elf_nextscn(elf, sec)) != NULL) { in elf_section_by_name()
200 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name); in elf_section_by_name()
215 Elf *elf; in filename__has_section() local
240 elf_read_program_header(Elf * elf,u64 vaddr,GElf_Phdr * phdr) elf_read_program_header() argument
335 get_ifunc_name(Elf * elf,struct dso * dso,GElf_Ehdr * ehdr,struct rel_info * ri,char * buf,size_t buf_sz) get_ifunc_name() argument
471 get_rela_dyn_info(Elf * elf,GElf_Ehdr * ehdr,struct rela_dyn_info * di,Elf_Scn * scn) get_rela_dyn_info() argument
565 dso__synthesize_plt_got_symbols(struct dso * dso,Elf * elf,GElf_Ehdr * ehdr,char * buf,size_t buf_sz) dso__synthesize_plt_got_symbols() argument
616 Elf *elf; dso__synthesize_plt_symbols() local
784 elf_read_build_id(Elf * elf,void * bf,size_t size) elf_read_build_id() argument
867 Elf *elf; read_build_id() local
986 Elf *elf; filename__read_debuglink() local
1066 read_gnu_debugdata(struct dso * dso,Elf * elf,const char * name,int * fd_ret) read_gnu_debugdata() argument
1145 Elf *elf; symsrc__init() local
1269 max_text_section(Elf * elf,GElf_Ehdr * ehdr) max_text_section() argument
1484 Elf *elf; dso__load_sym_internal() local
1808 elf_read_maps(Elf * elf,bool exe,mapfn_t mapfn,void * data) elf_read_maps() argument
1844 Elf *elf; file__read_maps() local
1864 Elf *elf; dso__type_fd() local
1936 Elf *elf; global() member
2276 kcore_copy__read_maps(struct kcore_copy_info * kci,Elf * elf) kcore_copy__read_maps() argument
2343 kcore_copy__calc_maps(struct kcore_copy_info * kci,const char * dir,Elf * elf) kcore_copy__calc_maps() argument
2673 populate_sdt_note(Elf ** elf,const char * data,size_t len,struct list_head * sdt_notes) populate_sdt_note() argument
2805 construct_sdt_notes_list(Elf * elf,struct list_head * sdt_notes) construct_sdt_notes_list() argument
2872 Elf *elf; get_sdt_note_list() local
[all...]
H A Dunwind-libunwind-local.c174 Elf *elf; in elf_section_address_and_offset() local
179 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_section_address_and_offset()
180 if (elf == NULL) in elf_section_address_and_offset()
183 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_address_and_offset()
186 if (!elf_section_by_name(elf, &ehdr, &shdr, name, NULL)) in elf_section_address_and_offset()
193 elf_end(elf); in elf_section_address_and_offset()
211 Elf *elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_base_address() local
216 if (elf == NULL) in elf_base_address()
218 (void)elf_getphdrnum(elf, &phdrnum); in elf_base_address()
221 if (gelf_getphdr(elf, i, &phdr) && phdr.p_type == PT_LOAD) { in elf_base_address()
[all …]
/linux/arch/powerpc/platforms/powernv/
H A Dopal-core.c308 Elf64_Ehdr *elf; in create_opalcore() local
357 elf = (Elf64_Ehdr *)bufp; in create_opalcore()
359 memcpy(elf->e_ident, ELFMAG, SELFMAG); in create_opalcore()
360 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore()
361 elf->e_ident[EI_DATA] = ELFDATA2MSB; in create_opalcore()
362 elf->e_ident[EI_VERSION] = EV_CURRENT; in create_opalcore()
363 elf->e_ident[EI_OSABI] = ELF_OSABI; in create_opalcore()
364 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in create_opalcore()
365 elf->e_type = cpu_to_be16(ET_CORE); in create_opalcore()
366 elf->e_machine = cpu_to_be16(ELF_ARCH); in create_opalcore()
[all …]
/linux/arch/alpha/boot/tools/
H 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/tools/bpf/resolve_btfids/
H A Dmain.c121 Elf *elf; member
306 static int compressed_section_fix(Elf *elf, Elf_Scn *scn, GElf_Shdr *sh) in compressed_section_fix() argument
308 int expected = gelf_getclass(elf) == ELFCLASS32 ? 4 : 8; in compressed_section_fix()
335 Elf *elf; in elf_collect() local
347 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect()
348 if (!elf) { in elf_collect()
356 obj->efile.elf = elf; in elf_collect()
358 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect()
360 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect()
365 if (gelf_getehdr(obj->efile.elf, &ehdr) == NULL) { in elf_collect()
[all …]
/linux/arch/mips/tools/
H A DMakefile2 hostprogs := elf-entry
3 PHONY += elf-entry
4 elf-entry: $(obj)/elf-entry
/linux/scripts/gendwarfksyms/
H A Dkabi.c124 Elf *elf; in kabi_read_rules() local
162 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in kabi_read_rules()
163 if (!elf) in kabi_read_rules()
166 if (elf_getshdrstrndx(elf, &shstrndx) < 0) in kabi_read_rules()
169 scn = elf_nextscn(elf, NULL); in kabi_read_rules()
178 sname = elf_strptr(elf, shstrndx, shdr->sh_name); in kabi_read_rules()
189 scn = elf_nextscn(elf, scn); in kabi_read_rules()
194 check(elf_end(elf)); in kabi_read_rules()
246 check(elf_end(elf)); in kabi_read_rules()
H A Dsymbols.c202 Elf *elf; in elf_for_each_global() local
207 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in elf_for_each_global()
208 if (!elf) in elf_for_each_global()
211 scn = elf_nextscn(elf, NULL); in elf_for_each_global()
225 scn = elf_nextscn(elf, scn); in elf_for_each_global()
228 sym_size = gelf_fsize(elf, ELF_T_SYM, 1, EV_CURRENT); in elf_for_each_global()
229 scn = elf_nextscn(elf, NULL); in elf_for_each_global()
268 name = elf_strptr(elf, shdr->sh_link, in elf_for_each_global()
280 scn = elf_nextscn(elf, scn); in elf_for_each_global()
283 check(elf_end(elf)); in elf_for_each_global()
/linux/fs/
H A Dbinfmt_elf_fdpic.c1240 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument
1242 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header()
1243 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header()
1244 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header()
1245 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header()
1246 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header()
1247 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header()
1249 elf->e_type = ET_CORE; in fill_elf_fdpic_header()
1250 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header()
1251 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header()
[all …]
/linux/arch/powerpc/kernel/
H A Dfadump.c926 struct elfhdr *elf; in fadump_init_elfcore_header() local
928 elf = (struct elfhdr *) bufp; in fadump_init_elfcore_header()
930 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fadump_init_elfcore_header()
931 elf->e_ident[EI_CLASS] = ELF_CLASS; in fadump_init_elfcore_header()
932 elf->e_ident[EI_DATA] = ELF_DATA; in fadump_init_elfcore_header()
933 elf->e_ident[EI_VERSION] = EV_CURRENT; in fadump_init_elfcore_header()
934 elf->e_ident[EI_OSABI] = ELF_OSABI; in fadump_init_elfcore_header()
935 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fadump_init_elfcore_header()
936 elf->e_type = ET_CORE; in fadump_init_elfcore_header()
937 elf->e_machine = ELF_ARCH; in fadump_init_elfcore_header()
[all …]
/linux/arch/x86/realmode/rm/
H 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/objtool/
H A Dcheck.c113 for_each_sec(file->elf, __sec) \
416 for_each_sec(file->elf, sec) { in decode_instructions()
532 sym = find_symbol_by_name(file->elf, symname); in add_pv_ops()
539 reloc = find_reloc_by_dest_range(file->elf, sym->sec, off, end - off); in add_pv_ops()
587 sym = find_symbol_by_name(file->elf, "pv_ops"); in init_pv_ops()
616 sec = find_section_by_name(file->elf, ".modinfo"); in is_livepatch_module()
632 sec = find_section_by_name(file->elf, ".static_call_sites"); in create_static_call_sections()
652 sec = elf_create_section_pair(file->elf, ".static_call_sites", in create_static_call_sections()
664 if (!elf_init_reloc_text_sym(file->elf, sec, in create_static_call_sections()
683 key_sym = find_symbol_by_name(file->elf, tmp); in create_static_call_sections()
[all …]
H A Dorc_gen.c59 for_each_sec(file->elf, sec) { in orc_create()
123 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create()
128 orc_sec = elf_create_section(file->elf, ".orc_unwind", in orc_create()
137 sec = elf_create_section_pair(file->elf, ".orc_unwind_ip", sizeof(int), nr, nr); in orc_create()
143 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
/linux/tools/testing/selftests/sgx/
H 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/drivers/firmware/efi/libstub/
H A DMakefile.zboot53 LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds
54 $(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE
58 $(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE
61 targets += zboot-header.o vmlinux.bin vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi
/linux/arch/arm64/boot/dts/ti/
H A Dk3-am654-idk.dtso30 firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf",
31 "ti-pruss/am65x-sr2-rtu0-prueth-fw.elf",
32 "ti-pruss/am65x-sr2-txpru0-prueth-fw.elf",
33 "ti-pruss/am65x-sr2-pru1-prueth-fw.elf",
34 "ti-pruss/am65x-sr2-rtu1-prueth-fw.elf",
35 "ti-pruss/am65x-sr2-txpru1-prueth-fw.elf";
97 firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf",
98 "ti-pruss/am65x-sr2-rtu0-prueth-fw.elf",
99 "ti-pruss/am65x-sr2-txpru0-prueth-fw.elf",
100 "ti-pruss/am65x-sr2-pru1-prueth-fw.elf",
[all …]
H A Dk3-am65-iot2050-common-pg1.dtsi49 firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
50 "ti-pruss/am65x-rtu0-prueth-fw.elf",
51 "ti-pruss/am65x-pru1-prueth-fw.elf",
52 "ti-pruss/am65x-rtu1-prueth-fw.elf";
/linux/tools/objtool/arch/x86/
H A Ddecode.c20 #include <objtool/elf.h>
24 #include <arch/elf.h>
39 static int is_x86_64(const struct elf *elf) in is_x86_64()
41 switch (elf->ehdr.e_machine) { in is_x86_64()
47 ERROR("unexpected ELF machine type %d", elf->ehdr.e_machine); in arch_callee_saved_reg()
222 const struct elf *elf = file->elf; in arch_decode_instruction()
233 x86_64 = is_x86_64(elf); in arch_decode_instruction()
31 is_x86_64(const struct elf * elf) is_x86_64() argument
158 const struct elf *elf = file->elf; arch_decode_instruction() local
884 arch_absolute_reloc(struct elf * elf,struct reloc * reloc) arch_absolute_reloc() argument
[all...]
/linux/tools/testing/selftests/bpf/
H A Dtrace_helpers.c438 Elf *elf = NULL; in read_build_id()
451 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in read_build_id()
452 if (!elf) in read_build_id()
454 if (elf_kind(elf) != ELF_K_ELF) in read_build_id()
456 if (!gelf_getehdr(elf, &ehdr)) in read_build_id()
463 phdr = gelf_getphdr(elf, i, &mem); in read_build_id()
468 data = elf_rawfile(elf, &max); in read_build_id()
479 if (elf) in read_build_id()
480 elf_end(elf); in read_build_id()
436 Elf *elf = NULL; read_build_id() local
/linux/arch/xtensa/boot/
H A DMakefile25 Image: boot-elf
30 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
41 boot-elf: $(obj)/vmlinux.bin

12345