| /linux/tools/objtool/ |
| H A D | elf.c | 3 * elf.c - ELF access library 25 #include <objtool/elf.h> 39 __node->next = __elf_table_entry(elf, name, key); \ 40 __elf_table_entry(elf, name, key) = __node; \ 62 __elf_hash_del(node, &__elf_table_entry(elf, name, key)) in __elf_hash_del() 66 __elf_bits(elf, name) = max(10, ilog2(size)); \ in __elf_hash_del() 67 __elf_table(elf, name) = mmap(NULL, \ in __elf_hash_del() 68 sizeof(struct elf_hash_node *) << __elf_bits(elf, name), \ in __elf_hash_del() 71 if (__elf_table(elf, name) == (void *)-1L) { \ 73 __elf_table(elf, nam 140 find_section_by_name(const struct elf * elf,const char * name) find_section_by_name() argument 152 find_section_by_index(struct elf * elf,unsigned int idx) find_section_by_index() argument 165 find_symbol_by_index(struct elf * elf,unsigned int idx) find_symbol_by_index() argument 284 find_symbol_by_name(const struct elf * elf,const char * name) find_symbol_by_name() argument 297 find_local_symbol_by_file_and_name(const struct elf * elf,struct symbol * file,const char * name) find_local_symbol_by_file_and_name() argument 313 find_global_symbol_by_name(const struct elf * elf,const char * name) find_global_symbol_by_name() argument 325 iterate_global_symbol_by_demangled_name(const struct elf * elf,const char * demangled_name,void (* process)(struct symbol * sym,void * data),void * data) iterate_global_symbol_by_demangled_name() argument 338 find_reloc_by_dest_range(const struct elf * elf,struct section * sec,unsigned long offset,unsigned int len) find_reloc_by_dest_range() argument 368 find_reloc_by_dest(const struct elf * elf,struct section * sec,unsigned long offset) find_reloc_by_dest() argument 378 read_sections(struct elf * elf) read_sections() argument 527 elf_add_symbol(struct elf * elf,struct symbol * sym) elf_add_symbol() argument 592 read_symbols(struct elf * elf) read_symbols() argument 735 mark_group_syms(struct elf * elf) mark_group_syms() argument 766 elf_update_sym_relocs(struct elf * elf,struct symbol * sym) elf_update_sym_relocs() argument 784 elf_update_symbol(struct elf * elf,struct section * symtab,struct section * symtab_shndx,struct symbol * sym) elf_update_symbol() argument 913 elf_create_symbol(struct elf * elf,const char * name,struct section * sec,unsigned int bind,unsigned int type,unsigned long offset,size_t size) elf_create_symbol() argument 1019 elf_create_section_symbol(struct elf * elf,struct section * sec) elf_create_section_symbol() argument 1032 elf_init_reloc(struct elf * elf,struct section * rsec,unsigned int reloc_idx,unsigned long offset,struct symbol * sym,s64 addend,unsigned int type) elf_init_reloc() argument 1067 elf_init_reloc_text_sym(struct elf * elf,struct section * sec,unsigned long offset,unsigned int reloc_idx,struct section * insn_sec,unsigned long insn_off) elf_init_reloc_text_sym() argument 1097 elf_init_reloc_data_sym(struct elf * elf,struct section * sec,unsigned long offset,unsigned int reloc_idx,struct symbol * sym,s64 addend) elf_init_reloc_data_sym() argument 1112 read_relocs(struct elf * elf) read_relocs() argument 1177 struct elf *elf; elf_open_read() local 1246 struct elf *elf; elf_create_file() local 1358 elf_add_string(struct elf * elf,struct section * strtab,const char * str) elf_add_string() argument 1382 elf_add_data(struct elf * elf,struct section * sec,const void * data,size_t size) elf_add_data() argument 1424 elf_create_section(struct elf * elf,const char * name,size_t size,size_t entsize,unsigned int type,unsigned int align,unsigned int flags) elf_create_section() argument 1517 elf_alloc_reloc(struct elf * elf,struct section * rsec) elf_alloc_reloc() argument 1625 elf_create_rela_section(struct elf * elf,struct section * sec,unsigned int nr_relocs) elf_create_rela_section() argument 1666 elf_create_reloc(struct elf * elf,struct section * sec,unsigned long offset,struct symbol * sym,s64 addend,unsigned int type) elf_create_reloc() argument 1693 elf_create_section_pair(struct elf * elf,const char * name,size_t entsize,unsigned int nr,unsigned int nr_relocs) elf_create_section_pair() argument 1710 elf_write_insn(struct elf * elf,struct section * sec,unsigned long offset,unsigned int len,const char * insn) elf_write_insn() argument 1737 elf_truncate_section(struct elf * elf,struct section * sec) elf_truncate_section() argument 1781 elf_write(struct elf * elf) elf_write() argument 1822 elf_close(struct elf * elf) elf_close() argument [all...] |
| H A D | klp-diff.c | 27 struct elf *orig, *patched, *out; 215 static int read_sym_checksums(struct elf *elf) 219 sec = find_section_by_name(elf, ".discard.sym_checksum"); in first_file_symbol() 222 elf->name); in first_file_symbol() 243 reloc = find_reloc_by_dest(elf, sec, i * sizeof(*sym_checksum)); in is_uncorrelated_static_local() 263 static struct symbol *first_file_symbol(struct elf *elf) in is_uncorrelated_static_local() 267 for_each_sym(elf, sym) { in is_uncorrelated_static_local() 275 static struct symbol *next_file_symbol(struct elf *el in is_clang_tmp_label() 168 read_sym_checksums(struct elf * elf) read_sym_checksums() argument 216 first_file_symbol(struct elf * elf) first_file_symbol() argument 228 next_file_symbol(struct elf * elf,struct symbol * sym) next_file_symbol() argument 383 find_global_symbol_by_demangled_name(struct elf * elf,struct symbol * sym,struct symbol ** out_sym) find_global_symbol_by_demangled_name() argument 561 find_sympos(struct elf * elf,struct symbol * sym) find_sympos() argument 621 __clone_symbol(struct elf * elf,struct symbol * patched_sym,bool data_too) __clone_symbol() argument 955 convert_reloc_sym_to_secsym(struct elf * elf,struct reloc * reloc) convert_reloc_sym_to_secsym() argument 969 convert_reloc_secsym_to_sym(struct elf * elf,struct reloc * reloc) convert_reloc_secsym_to_sym() argument 1000 convert_reloc_sym(struct elf * elf,struct reloc * reloc) convert_reloc_sym() argument 1271 create_fake_symbol(struct elf * elf,struct section * sec,unsigned long offset,size_t size) create_fake_symbol() argument 1326 create_fake_symbols(struct elf * elf) create_fake_symbols() argument 1401 should_keep_special_sym(struct elf * elf,struct symbol * sym) should_keep_special_sym() argument [all...] |
| H A D | check.c | 113 for_each_sec(file->elf, __sec) \ 416 for_each_sec(file->elf, sec) { in decode_instructions() 561 sym = find_symbol_by_name(file->elf, symname); in add_pv_ops() 576 reloc = find_reloc_by_dest_range(file->elf, sym->sec, off, end - off); in add_pv_ops() 618 sym = find_symbol_by_name(file->elf, pv_ops_tables[idx].name); in init_pv_ops() 656 sec = find_section_by_name(file->elf, ".modinfo"); in is_livepatch_module() 672 sec = find_section_by_name(file->elf, ".static_call_sites"); in create_static_call_sections() 692 sec = elf_create_section_pair(file->elf, ".static_call_sites", in create_static_call_sections() 704 if (!elf_init_reloc_text_sym(file->elf, sec, in create_static_call_sections() 723 key_sym = find_symbol_by_name(file->elf, tmp); in create_static_call_sections() [all …]
|
| H A D | orc_gen.c | 59 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/objtool/include/objtool/ |
| H A D | elf.h | 19 #include <arch/elf.h> 31 #define bswap_if_needed(elf, val) __bswap_if_needed(&elf->ehdr, val) 115 struct elf { 116 Elf *elf; 142 #define __elf_table(elf, name) ((elf)->name##_hash) 143 #define __elf_bits(elf, name) ((elf)->name##_bits) 145 #define __elf_table_entry(elf, nam 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 106 reloc_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 D | endianness.h | 15 need_bswap(struct elf * elf) need_bswap() argument 21 bswap_if_needed(elf,val) global() argument
|
| H A D | orc.h | 8 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 D | symsearch.c | 50 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 …]
|
| H A D | modpost.c | 721 static const char *sym_name(struct elf_info *elf, Elf_Sym *sym) in sym_name() argument 723 return sym ? elf->strtab + sym->st_name : ""; in sym_name() 784 static void check_section(struct module *mod, struct elf_info *elf, in check_section() argument 787 const char *sec = sech_name(elf, sechdr); in check_section() 999 static Elf_Sym *find_fromsym(struct elf_info *elf, Elf_Addr addr, in find_fromsym() argument 1002 return symsearch_find_nearest(elf, addr, secndx, false, ~0); in find_fromsym() 1005 static Elf_Sym *find_tosym(struct elf_info *elf, Elf_Addr addr, Elf_Sym *sym) in find_tosym() argument 1010 if (is_valid_name(elf, sym)) in find_tosym() 1017 new_sym = symsearch_find_nearest(elf, addr, get_secindex(elf, sym), in find_tosym() 1022 static bool is_executable_section(struct elf_info *elf, unsigned int secndx) in is_executable_section() argument [all …]
|
| /linux/arch/arm64/kvm/hyp/nvhe/ |
| H A D | gen-hyprel.c | 140 } 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 D | symbol-elf.c | 54 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 988 Elf *elf; filename__read_debuglink() local 1068 read_gnu_debugdata(struct dso * dso,Elf * elf,const char * name,int * fd_ret) read_gnu_debugdata() argument 1147 Elf *elf; symsrc__init() local 1271 max_text_section(Elf * elf,GElf_Ehdr * ehdr) max_text_section() argument 1486 Elf *elf; dso__load_sym_internal() local 1810 elf_read_maps(Elf * elf,bool exe,mapfn_t mapfn,void * data) elf_read_maps() argument 1846 Elf *elf; file__read_maps() local 1866 Elf *elf; dso__type_fd() local 1938 Elf *elf; global() member 2278 kcore_copy__read_maps(struct kcore_copy_info * kci,Elf * elf) kcore_copy__read_maps() argument 2345 kcore_copy__calc_maps(struct kcore_copy_info * kci,const char * dir,Elf * elf) kcore_copy__calc_maps() argument 2675 populate_sdt_note(Elf ** elf,const char * data,size_t len,struct list_head * sdt_notes) populate_sdt_note() argument 2807 construct_sdt_notes_list(Elf * elf,struct list_head * sdt_notes) construct_sdt_notes_list() argument 2874 Elf *elf; get_sdt_note_list() local [all...] |
| H A D | unwind-libunwind-local.c | |
| /linux/tools/lib/bpf/ |
| H A D | elf.c | 27 Elf *elf; in elf_open() local 29 elf_fd->elf = NULL; in elf_open() 42 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in elf_open() 43 if (!elf) { in elf_open() 49 elf_fd->elf = elf; in elf_open() 57 elf_end(elf_fd->elf); in elf_close() 62 static Elf_Scn *elf_find_next_scn_by_type(Elf *elf, int sh_type, Elf_Scn *scn) in elf_find_next_scn_by_type() argument 64 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_find_next_scn_by_type() 84 Elf *elf; member 97 Elf *elf, const char *binary_path, in elf_sym_iter_new() argument [all …]
|
| /linux/arch/alpha/boot/tools/ |
| H A D | objstrip.c | 61 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/ |
| H A D | Makefile | 2 hostprogs := elf-entry 3 PHONY += elf-entry 4 elf-entry: $(obj)/elf-entry
|
| /linux/scripts/gendwarfksyms/ |
| H A D | kabi.c | 124 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 D | symbols.c | 203 Elf *elf; in elf_for_each_global() 208 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in elf_for_each_global() 209 if (!elf) in elf_for_each_global() 212 scn = elf_nextscn(elf, NULL); in elf_for_each_global() 226 scn = elf_nextscn(elf, scn); in elf_for_each_global() 229 sym_size = gelf_fsize(elf, ELF_T_SYM, 1, EV_CURRENT); in elf_for_each_global() 230 scn = elf_nextscn(elf, NULL); in elf_for_each_global() 269 name = elf_strptr(elf, shdr->sh_link, in elf_for_each_global() 281 scn = elf_nextscn(elf, scn); in elf_for_each_global() 284 check(elf_end(elf)); in elf_for_each_global() 202 Elf *elf; elf_for_each_global() local [all...] |
| /linux/fs/ |
| H A D | binfmt_elf_fdpic.c | 1251 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) in fill_elf_fdpic_header() argument 1253 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_fdpic_header() 1254 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_fdpic_header() 1255 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_fdpic_header() 1256 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_fdpic_header() 1257 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_fdpic_header() 1258 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); in fill_elf_fdpic_header() 1260 elf->e_type = ET_CORE; in fill_elf_fdpic_header() 1261 elf->e_machine = ELF_ARCH; in fill_elf_fdpic_header() 1262 elf->e_version = EV_CURRENT; in fill_elf_fdpic_header() [all …]
|
| /linux/arch/x86/realmode/rm/ |
| H A D | Makefile | 44 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/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ |
| H A D | gh100.c | 196 elf_validate_sections(const void *elf, size_t length) in elf_validate_sections() argument 198 const struct elf32_hdr *ehdr = elf; in elf_validate_sections() 199 const struct elf32_shdr *shdr = elf + ehdr->e_shoff; in elf_validate_sections() 229 u32 crc32 = crc32_le(~0, elf + shdr[i].sh_offset, shdr[i].sh_size) ^ ~0; in elf_validate_sections() 246 elf_section(const void *elf, const char *name, unsigned int *len) in elf_section() argument 248 const struct elf32_hdr *ehdr = elf; in elf_section() 249 const struct elf32_shdr *shdr = elf + ehdr->e_shoff; in elf_section() 250 const char *names = elf + shdr[ehdr->e_shstrndx].sh_offset; in elf_section() 255 return elf + shdr[i].sh_offset; in elf_section()
|
| /linux/tools/testing/selftests/sgx/ |
| H A D | Makefile | 23 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 D | Makefile.zboot | 53 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 D | k3-am65-iot2050-common-pg1.dtsi | 49 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";
|
| H A D | k3-am654-idk.dtso | 30 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 …]
|
| /linux/arch/xtensa/boot/ |
| H A D | Makefile | 25 Image: boot-elf 30 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) 41 boot-elf: $(obj)/vmlinux.bin
|