/linux/tools/objtool/ |
A D | elf.c | 257 s = elf_getscn(elf->elf, i); in read_sections() 304 if (elf_nextscn(elf->elf, s)) { in read_sections() 654 struct elf *elf; in elf_open_read() local 659 elf = malloc(sizeof(*elf)); in elf_open_read() 682 elf->elf = elf_begin(elf->fd, cmd, NULL); in elf_open_read() 683 if (!elf->elf) { in elf_open_read() 688 if (!gelf_getehdr(elf->elf, &elf->ehdr)) { in elf_open_read() 762 s = elf_newscn(elf->elf); in elf_create_section() 1017 int elf_write(struct elf *elf) in elf_write() argument 1066 if (elf->elf) in elf_close() [all …]
|
A D | orc_dump.c | 73 Elf *elf; in orc_dump() local 91 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump() 92 if (!elf) { in orc_dump() 97 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump() 102 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump() 108 scn = elf_getscn(elf, i); in orc_dump() 119 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 168 scn = elf_getscn(elf, sym.st_shndx); in orc_dump() 179 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 185 name = elf_strptr(elf, strtab_idx, sym.st_name); in orc_dump() [all …]
|
A D | special.c | 68 static int get_alt_entry(struct elf *elf, struct special_entry *entry, in get_alt_entry() argument 96 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); in get_alt_entry() 105 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); in get_alt_entry() 122 key_reloc = find_reloc_by_dest(elf, sec, offset + entry->key); in get_alt_entry() 139 int special_get_alts(struct elf *elf, struct list_head *alts) in special_get_alts() argument 150 sec = find_section_by_name(elf, entry->sec); in special_get_alts() 170 ret = get_alt_entry(elf, entry, sec, idx, alt); in special_get_alts()
|
A D | orc_gen.c | 90 static int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument 104 if (elf_add_reloc_to_insn(elf, ip_sec, idx * sizeof(int), R_X86_64_PC32, in write_orc_entry() 222 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create() 227 orc_sec = elf_create_section(file->elf, ".orc_unwind", 0, in orc_create() 232 sec = elf_create_section(file->elf, ".orc_unwind_ip", 0, sizeof(int), nr); in orc_create() 238 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
|
A D | check.c | 433 sym = find_symbol_by_name(file->elf, symname); in add_pv_ops() 633 if (elf_add_reloc_to_insn(file->elf, sec, in create_static_call_sections() 674 if (elf_add_reloc(file->elf, sec, in create_static_call_sections() 718 if (elf_add_reloc_to_insn(file->elf, sec, in create_retpoline_sites_sections() 763 if (elf_add_reloc_to_insn(file->elf, sec, in create_mcount_loc_sections() 1078 elf_write_reloc(file->elf, reloc); in annotate_call_site() 1081 elf_write_insn(file->elf, insn->sec, in annotate_call_site() 1096 elf_write_reloc(file->elf, reloc); in annotate_call_site() 1099 elf_write_insn(file->elf, insn->sec, in annotate_call_site() 1485 elf_write_reloc(file->elf, reloc); in handle_jump_alt() [all …]
|
/linux/tools/objtool/include/objtool/ |
A D | elf.h | 83 struct elf { struct 84 Elf *elf; member 137 int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long offset, 139 int elf_add_reloc_to_insn(struct elf *elf, struct section *sec, 143 int elf_write_insn(struct elf *elf, struct section *sec, 146 int elf_write_reloc(struct elf *elf, struct reloc *reloc); 147 int elf_write(struct elf *elf); 148 void elf_close(struct elf *elf); 150 struct section *find_section_by_name(const struct elf *elf, const char *name); 153 struct symbol *find_symbol_by_name(const struct elf *elf, const char *name); [all …]
|
A D | special.h | 33 int special_get_alts(struct elf *elf, struct list_head *alts);
|
/linux/arch/arm64/kvm/hyp/nvhe/ |
A D | gen-hyprel.c | 137 } elf; variable 164 elf.path, ## __VA_ARGS__); \ 172 elf.path, strerror(errno)); \ 202 for (var = elf.sh_table; var < elf.sh_table + elf16toh(elf.ehdr->e_shnum); ++var) 218 return elf.sh_string + elf32toh(shdr->sh_name); in section_name() 238 return &elf.sh_table[idx]; in section_by_idx() 251 elf.path = path; in init_elf() 267 if (elf.begin == MAP_FAILED) { in init_elf() 277 elf.ehdr = elf_ptr(Elf64_Ehdr, 0); in init_elf() 292 elf.sh_table = section_by_off(elf64toh(elf.ehdr->e_shoff)); in init_elf() [all …]
|
/linux/tools/perf/util/ |
A D | symbol-elf.c | 301 Elf *elf; in dso__synthesize_plt_symbols() local 307 elf = ss->elf; in dso__synthesize_plt_symbols() 575 Elf *elf; in read_build_id() local 728 Elf *elf; in filename__read_debuglink() local 837 Elf *elf; in symsrc__init() local 922 ss->elf = elf; in symsrc__init() 1095 Elf *elf; in dso__load_sym_internal() local 1102 elf = syms_ss->elf; in dso__load_sym_internal() 1388 Elf *elf; in file__read_maps() local 1408 Elf *elf; in dso__type_fd() local [all …]
|
A D | unwind-libunwind-local.c | 173 Elf *elf; in elf_section_offset() local 178 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_section_offset() 179 if (elf == NULL) in elf_section_offset() 183 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_section_offset() 186 if (!elf_section_by_name(elf, &ehdr, &shdr, name, NULL)) in elf_section_offset() 192 elf_end(elf); in elf_section_offset() 199 Elf *elf; in elf_is_exec() local 203 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in elf_is_exec() 204 if (elf == NULL) in elf_is_exec() 206 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_is_exec() [all …]
|
/linux/scripts/mod/ |
A D | modpost.c | 1305 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol() 1343 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol2() 1348 symsec = sec_name(elf, get_secindex(elf, sym)); in find_elf_symbol2() 1592 tosec = sec_name(elf, get_secindex(elf, sym)); in default_mismatch_handler() 1677 is_executable_section(elf, get_secindex(elf, sym))) in report_extable_warnings() 1694 const char* tosec = sec_name(elf, get_secindex(elf, sym)); in extable_mismatch_handler() 1707 else if (!is_executable_section(elf, get_secindex(elf, sym))) { in extable_mismatch_handler() 1728 const char *tosec = sec_name(elf, get_secindex(elf, sym)); in check_section_mismatch() 1959 check_section(modname, elf, &elf->sechdrs[i]); in check_sec_ref() 1962 section_rela(modname, elf, &elf->sechdrs[i]); in check_sec_ref() [all …]
|
/linux/arch/alpha/boot/tools/ |
A D | objstrip.c | 61 struct elfhdr *elf; in main() local 149 elf = (struct elfhdr *) buf; in main() 151 if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) { 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/powerpc/platforms/powernv/ |
A D | opal-core.c | 308 Elf64_Ehdr *elf; in create_opalcore() local 355 elf = (Elf64_Ehdr *)bufp; in create_opalcore() 358 elf->e_ident[EI_CLASS] = ELF_CLASS; in create_opalcore() 366 elf->e_entry = 0; in create_opalcore() 368 elf->e_shoff = 0; in create_opalcore() 369 elf->e_flags = 0; in create_opalcore() 373 elf->e_phnum = 0; in create_opalcore() 374 elf->e_shentsize = 0; in create_opalcore() 375 elf->e_shnum = 0; in create_opalcore() 376 elf->e_shstrndx = 0; in create_opalcore() [all …]
|
/linux/tools/bpf/resolve_btfids/ |
A D | main.c | 97 Elf *elf; member 308 Elf *elf; in elf_collect() local 320 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect() 321 if (!elf) { in elf_collect() 329 obj->efile.elf = elf; in elf_collect() 331 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect() 333 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect() 342 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect() 381 if (compressed_section_fix(elf, scn, &sh)) in elf_collect() 749 if (obj.efile.elf) { in main() [all …]
|
/linux/fs/ |
A D | binfmt_elf_fdpic.c | 1249 elf->e_entry = 0; in fill_elf_fdpic_header() 1251 elf->e_shoff = 0; in fill_elf_fdpic_header() 1255 elf->e_phnum = segs; in fill_elf_fdpic_header() 1256 elf->e_shentsize = 0; in fill_elf_fdpic_header() 1257 elf->e_shnum = 0; in fill_elf_fdpic_header() 1258 elf->e_shstrndx = 0; in fill_elf_fdpic_header() 1429 elf->e_shnum = 1; in fill_extnum_info() 1487 elf = kmalloc(sizeof(*elf), GFP_KERNEL); in elf_fdpic_core_dump() 1488 if (!elf) in elf_fdpic_core_dump() 1574 if (!dump_emit(cprm, elf, sizeof(*elf))) in elf_fdpic_core_dump() [all …]
|
A D | binfmt_elf.c | 1471 memset(elf, 0, sizeof(*elf)); in fill_elf_header() 1479 elf->e_type = ET_CORE; in fill_elf_header() 1480 elf->e_machine = machine; in fill_elf_header() 1481 elf->e_version = EV_CURRENT; in fill_elf_header() 1483 elf->e_flags = flags; in fill_elf_header() 1486 elf->e_phnum = segs; in fill_elf_header() 1844 fill_elf_header(elf, phdrs, in fill_note_info() 2149 elf->e_shoff = e_shoff; in fill_extnum_info() 2151 elf->e_shnum = 1; in fill_extnum_info() 2174 struct elfhdr elf; in elf_core_dump() local [all …]
|
/linux/arch/mips/tools/ |
A D | Makefile | 2 hostprogs := elf-entry 3 PHONY += elf-entry 4 elf-entry: $(obj)/elf-entry
|
/linux/arch/powerpc/kernel/ |
A D | fadump.c | 949 struct elfhdr *elf; in fadump_init_elfcore_header() local 962 elf->e_entry = 0; in fadump_init_elfcore_header() 964 elf->e_shoff = 0; in fadump_init_elfcore_header() 968 elf->e_flags = 0; in fadump_init_elfcore_header() 972 elf->e_phnum = 0; in fadump_init_elfcore_header() 974 elf->e_shnum = 0; in fadump_init_elfcore_header() 975 elf->e_shstrndx = 0; in fadump_init_elfcore_header() 1060 struct elfhdr *elf; in fadump_create_elfcore_headers() local 1086 (elf->e_phnum)++; in fadump_create_elfcore_headers() 1101 (elf->e_phnum)++; in fadump_create_elfcore_headers() [all …]
|
/linux/arch/x86/realmode/rm/ |
A D | Makefile | 52 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T 55 targets += realmode.elf 56 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE 62 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE 69 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
|
/linux/tools/objtool/arch/x86/ |
A D | decode.c | 26 static int is_x86_64(const struct elf *elf) in is_x86_64() argument 28 switch (elf->ehdr.e_machine) { in is_x86_64() 34 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64() 112 const struct elf *elf = file->elf; in arch_decode_instruction() local 123 x86_64 = is_x86_64(elf); in arch_decode_instruction() 558 immr = find_reloc_by_dest(elf, (void *)sec, offset+3); in arch_decode_instruction() 559 disp = find_reloc_by_dest(elf, (void *)sec, offset+7); in arch_decode_instruction()
|
/linux/arch/xtensa/boot/boot-redboot/ |
A D | Makefile | 25 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) 26 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) 28 $(obj)/../zImage.redboot: $(obj)/zImage.elf
|
/linux/arch/xtensa/boot/ |
A D | Makefile | 26 Image: boot-elf 31 boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) 42 boot-elf: $(obj)/vmlinux.bin
|
/linux/tools/testing/selftests/sgx/ |
A D | Makefile | 22 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf 47 $(OUTPUT)/test_encl.elf: test_encl.lds test_encl.c test_encl_bootstrap.S 51 $(OUTPUT)/test_encl.elf \
|
/linux/tools/build/feature/ |
A D | test-libelf.c | 6 Elf *elf = elf_begin(0, ELF_C_READ, 0); in main() local 8 return (long)elf; in main()
|
/linux/arch/x86/boot/ |
A D | Makefile | 31 targets := vmlinux.bin setup.bin setup.elf bzImage 106 LDFLAGS_setup.elf := -m elf_i386 -T 107 $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE 111 $(obj)/setup.bin: $(obj)/setup.elf FORCE
|