| /tools/objtool/ |
| A D | elf.c | 342 s = elf_getscn(elf->elf, i); in read_sections() 388 if (elf_nextscn(elf->elf, s)) { in read_sections() 1026 struct elf *elf; in elf_open_read() local 1031 elf = malloc(sizeof(*elf)); in elf_open_read() 1036 memset(elf, 0, sizeof(*elf)); in elf_open_read() 1054 elf->elf = elf_begin(elf->fd, cmd, NULL); in elf_open_read() 1055 if (!elf->elf) { in elf_open_read() 1060 if (!gelf_getehdr(elf->elf, &elf->ehdr)) { in elf_open_read() 1137 s = elf_newscn(elf->elf); in elf_create_section() 1371 if (elf->elf) in elf_close() [all …]
|
| A D | orc_dump.c | 21 Elf *elf; in orc_dump() local 27 struct elf dummy_elf = {}; in orc_dump() 37 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump() 38 if (!elf) { in orc_dump() 43 if (!elf64_getehdr(elf)) { in orc_dump() 49 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump() 54 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump() 60 scn = elf_getscn(elf, i); in orc_dump() 71 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 120 scn = elf_getscn(elf, sym.st_shndx); in orc_dump() [all …]
|
| A D | special.c | 68 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 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); in get_alt_entry() 114 key_reloc = find_reloc_by_dest(elf, sec, offset + entry->key); in get_alt_entry() 130 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument 141 sec = find_section_by_name(elf, entry->sec); in special_get_alts() 160 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
|
| A D | objtool.c | 25 if (file.elf) { in objtool_open_read() 30 file.elf = elf_open_read(filename, O_RDWR); in objtool_open_read() 31 if (!file.elf) in objtool_open_read()
|
| A D | orc_gen.c | 124 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create() 129 orc_sec = elf_create_section(file->elf, ".orc_unwind", in orc_create() 134 sec = elf_create_section_pair(file->elf, ".orc_unwind_ip", sizeof(int), nr, nr); in orc_create() 140 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
|
| /tools/objtool/include/objtool/ |
| A D | elf.h | 85 struct elf { struct 86 Elf *elf; member 113 struct section *elf_create_section(struct elf *elf, const char *name, 133 int elf_write_insn(struct elf *elf, struct section *sec, 136 int elf_write(struct elf *elf); 137 void elf_close(struct elf *elf); 155 static inline bool has_multiple_files(struct elf *elf) in has_multiple_files() argument 160 static inline size_t elf_addr_size(struct elf *elf) in elf_addr_size() argument 165 static inline size_t elf_rela_size(struct elf *elf) in elf_rela_size() argument 170 static inline unsigned int elf_data_rela_type(struct elf *elf) in elf_data_rela_type() argument [all …]
|
| A D | endianness.h | 15 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 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,
|
| A D | special.h | 31 int special_get_alts(struct elf *elf, struct list_head *alts);
|
| A D | objtool.h | 23 struct elf *elf; member
|
| /tools/lib/bpf/ |
| A D | elf.c | 28 Elf *elf; in elf_open() local 30 elf_fd->elf = NULL; in elf_open() 43 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in elf_open() 44 if (!elf) { in elf_open() 50 elf_fd->elf = elf; in elf_open() 58 elf_end(elf_fd->elf); in elf_close() 85 Elf *elf; member 98 Elf *elf, const char *binary_path, in elf_sym_iter_new() argument 107 if (!gelf_getehdr(elf, &ehdr)) { in elf_sym_iter_new() 130 iter->elf = elf; in elf_sym_iter_new() [all …]
|
| A D | usdt.c | 311 if (elf_kind(elf) != ELF_K_ELF) { in sanity_check_usdt_elf() 316 switch (gelf_getclass(elf)) { in sanity_check_usdt_elf() 334 if (!gelf_getehdr(elf, &ehdr)) in sanity_check_usdt_elf() 363 if (elf_getshdrstrndx(elf, &shstrndx)) in find_elf_sec_by_name() 367 if (!elf_rawdata(elf_getscn(elf, shstrndx), NULL)) in find_elf_sec_by_name() 370 while ((sec = elf_nextscn(elf, sec)) != NULL) { in find_elf_sec_by_name() 376 name = elf_strptr(elf, shstrndx, shdr->sh_name); in find_elf_sec_by_name() 411 if (elf_getphdrnum(elf, &n)) { in parse_elf_segs() 417 if (!gelf_getphdr(elf, i, &phdr)) { in parse_elf_segs() 608 err = parse_elf_segs(elf, path, &segs, &seg_cnt); in collect_usdt_targets() [all …]
|
| /tools/perf/util/ |
| A D | symbol-elf.c | 226 Elf *elf; in filename__has_section() local 627 Elf *elf; in dso__synthesize_plt_symbols() local 632 elf = ss->elf; in dso__synthesize_plt_symbols() 909 Elf *elf; in read_build_id() local 1062 Elf *elf; in filename__read_debuglink() local 1219 Elf *elf; in symsrc__init() local 1318 ss->elf = elf; in symsrc__init() 1555 Elf *elf; in dso__load_sym_internal() local 1563 elf = syms_ss->elf; in dso__load_sym_internal() 1915 Elf *elf; in file__read_maps() local [all …]
|
| A D | unwind-libunwind-local.c | 174 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 …]
|
| A D | debuginfo.c | 152 Elf *elf; in debuginfo__get_text_offset() local 156 elf = dwfl_module_getelf(dbg->mod, &dbg->bias); in debuginfo__get_text_offset() 157 if (!elf) in debuginfo__get_text_offset() 169 scn = elf_getscn(elf, shndx); in debuginfo__get_text_offset()
|
| /tools/objtool/arch/x86/ |
| A D | orc.c | 100 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()
|
| A D | special.c | 90 text_reloc = find_reloc_by_dest_range(file->elf, insn->sec, in arch_find_switch_table() 120 rodata_reloc = find_reloc_by_dest(file->elf, table_sec, table_offset); in arch_find_switch_table()
|
| A D | decode.c | 31 static int is_x86_64(const struct elf *elf) in is_x86_64() argument 33 switch (elf->ehdr.e_machine) { in is_x86_64() 39 ERROR("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64() 158 const struct elf *elf = file->elf; in arch_decode_instruction() local 169 x86_64 = is_x86_64(elf); in arch_decode_instruction() 649 immr = find_reloc_by_dest(elf, (void *)sec, offset+3); in arch_decode_instruction() 650 disp = find_reloc_by_dest(elf, (void *)sec, offset+7); in arch_decode_instruction()
|
| /tools/build/feature/ |
| A D | test-libelf.c | 6 Elf *elf = elf_begin(0, ELF_C_READ, 0); in main() local 8 return !!elf; in main()
|
| /tools/bpf/resolve_btfids/ |
| A D | main.c | 121 Elf *elf; member 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() 376 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect() 423 if (compressed_section_fix(elf, scn, &sh)) in elf_collect() 836 if (obj.efile.elf) { in main() [all …]
|
| /tools/testing/selftests/sgx/ |
| 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 \
|
| A D | .gitignore | 2 test_encl.elf
|
| /tools/objtool/arch/loongarch/ |
| A D | orc.c | 101 int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument 113 if (!elf_init_reloc_text_sym(elf, ip_sec, idx * sizeof(int), idx, in write_orc_entry() 157 void orc_print_dump(struct elf *dummy_elf, struct orc_entry *orc, int i) in orc_print_dump()
|
| A D | decode.c | 61 static bool is_loongarch(const struct elf *elf) in is_loongarch() argument 63 if (elf->ehdr.e_machine == EM_LOONGARCH) in is_loongarch() 66 ERROR("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_loongarch() 286 const struct elf *elf = file->elf; in arch_decode_instruction() local 290 if (!is_loongarch(elf)) in arch_decode_instruction()
|
| /tools/testing/selftests/bpf/ |
| A D | trace_helpers.c | 436 Elf *elf = NULL; in read_build_id() local 449 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in read_build_id() 450 if (!elf) in read_build_id() 452 if (elf_kind(elf) != ELF_K_ELF) in read_build_id() 454 if (!gelf_getehdr(elf, &ehdr)) in read_build_id() 461 phdr = gelf_getphdr(elf, i, &mem); in read_build_id() 466 data = elf_rawfile(elf, &max); in read_build_id() 477 if (elf) in read_build_id() 478 elf_end(elf); in read_build_id()
|