/linux-6.3-rc2/tools/objtool/ |
A D | elf.c | 298 s = elf_getscn(elf->elf, i); in read_sections() 345 if (elf_nextscn(elf->elf, s)) { in read_sections() 970 struct elf *elf; in elf_open_read() local 975 elf = malloc(sizeof(*elf)); in elf_open_read() 998 elf->elf = elf_begin(elf->fd, cmd, NULL); in elf_open_read() 999 if (!elf->elf) { in elf_open_read() 1004 if (!gelf_getehdr(elf->elf, &elf->ehdr)) { in elf_open_read() 1078 s = elf_newscn(elf->elf); in elf_create_section() 1391 int elf_write(struct elf *elf) in elf_write() argument 1446 if (elf->elf) in elf_close() [all …]
|
A D | orc_dump.c | 73 Elf *elf; in orc_dump() local 79 struct elf dummy_elf = {}; in orc_dump() 92 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); in orc_dump() 93 if (!elf) { in orc_dump() 98 if (!elf64_getehdr(elf)) { in orc_dump() 104 if (elf_getshdrnum(elf, &nr_sections)) { in orc_dump() 109 if (elf_getshdrstrndx(elf, &shstrtab_idx)) { in orc_dump() 115 scn = elf_getscn(elf, i); in orc_dump() 126 name = elf_strptr(elf, shstrtab_idx, sh.sh_name); in orc_dump() 175 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 90 feature = bswap_if_needed(elf, in get_alt_entry() 97 orig_reloc = find_reloc_by_dest(elf, sec, offset + entry->orig); 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()
|
A D | orc_gen.c | 91 static int write_orc_entry(struct elf *elf, struct section *orc_sec, in write_orc_entry() argument 101 orc->sp_offset = bswap_if_needed(elf, orc->sp_offset); in write_orc_entry() 102 orc->bp_offset = bswap_if_needed(elf, orc->bp_offset); in write_orc_entry() 105 if (elf_add_reloc_to_insn(elf, ip_sec, idx * sizeof(int), R_X86_64_PC32, in write_orc_entry() 223 sec = find_section_by_name(file->elf, ".orc_unwind"); in orc_create() 228 orc_sec = elf_create_section(file->elf, ".orc_unwind", 0, in orc_create() 233 sec = elf_create_section(file->elf, ".orc_unwind_ip", 0, sizeof(int), nr); in orc_create() 239 if (write_orc_entry(file->elf, orc_sec, sec, idx++, in orc_create()
|
A D | check.c | 718 if (elf_add_reloc_to_insn(file->elf, sec, in create_static_call_sections() 761 if (elf_add_reloc(file->elf, sec, in create_static_call_sections() 805 if (elf_add_reloc_to_insn(file->elf, sec, in create_retpoline_sites_sections() 851 if (elf_add_reloc_to_insn(file->elf, sec, in create_return_sites_sections() 910 if (elf_add_reloc_to_insn(file->elf, sec, in create_ibt_endbr_seal_sections() 1062 if (elf_add_reloc_to_insn(file->elf, sec, in create_direct_call_sections() 1421 elf_write_reloc(file->elf, reloc); in annotate_call_site() 1424 elf_write_insn(file->elf, insn->sec, in annotate_call_site() 1450 elf_write_reloc(file->elf, reloc); in annotate_call_site() 1453 elf_write_insn(file->elf, insn->sec, in annotate_call_site() [all …]
|
/linux-6.3-rc2/tools/objtool/include/objtool/ |
A D | elf.h | 87 struct elf { struct 88 Elf *elf; member 146 static inline bool has_multiple_files(struct elf *elf) in has_multiple_files() argument 151 static inline int elf_class_addrsize(struct elf *elf) in elf_class_addrsize() argument 164 int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long offset, 166 int elf_add_reloc_to_insn(struct elf *elf, struct section *sec, 170 int elf_write_insn(struct elf *elf, struct section *sec, 173 int elf_write_reloc(struct elf *elf, struct reloc *reloc); 174 int elf_write(struct elf *elf); 175 void elf_close(struct elf *elf); [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); \
|
/linux-6.3-rc2/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-6.3-rc2/tools/perf/util/ |
A D | symbol-elf.c | 239 Elf *elf; in filename__has_section() local 665 Elf *elf; in dso__synthesize_plt_symbols() local 670 elf = ss->elf; in dso__synthesize_plt_symbols() 952 Elf *elf; in read_build_id() local 1105 Elf *elf; in filename__read_debuglink() local 1214 Elf *elf; in symsrc__init() local 1300 ss->elf = elf; in symsrc__init() 1473 Elf *elf; in dso__load_sym_internal() local 1480 elf = syms_ss->elf; in dso__load_sym_internal() 1800 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 …]
|
/linux-6.3-rc2/scripts/mod/ |
A D | modpost.c | 1160 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol() 1198 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { in find_elf_symbol2() 1203 symsec = sec_name(elf, get_secindex(elf, sym)); in find_elf_symbol2() 1281 tosec = sec_name(elf, get_secindex(elf, sym)); in default_mismatch_handler() 1363 is_executable_section(elf, get_secindex(elf, sym))) in report_extable_warnings() 1380 const char* tosec = sec_name(elf, get_secindex(elf, sym)); in extable_mismatch_handler() 1393 else if (!is_executable_section(elf, get_secindex(elf, sym))) { in extable_mismatch_handler() 1414 const char *tosec = sec_name(elf, get_secindex(elf, sym)); in check_section_mismatch() 1667 check_section(modname, elf, &elf->sechdrs[i]); in check_sec_ref() 1670 section_rela(modname, elf, &elf->sechdrs[i]); in check_sec_ref() [all …]
|
/linux-6.3-rc2/arch/powerpc/platforms/powernv/ |
A D | opal-core.c | 308 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-6.3-rc2/arch/alpha/boot/tools/ |
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-6.3-rc2/arch/mips/tools/ |
A D | Makefile | 2 hostprogs := elf-entry 3 PHONY += elf-entry 4 elf-entry: $(obj)/elf-entry
|
/linux-6.3-rc2/tools/bpf/resolve_btfids/ |
A D | main.c | 112 Elf *elf; member 323 Elf *elf; in elf_collect() local 335 elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL); in elf_collect() 336 if (!elf) { in elf_collect() 344 obj->efile.elf = elf; in elf_collect() 346 elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT); in elf_collect() 348 if (elf_getshdrstrndx(elf, &shdrstrndx) != 0) { in elf_collect() 357 while ((scn = elf_nextscn(elf, scn)) != NULL) { in elf_collect() 396 if (compressed_section_fix(elf, scn, &sh)) in elf_collect() 778 if (obj.efile.elf) { in main() [all …]
|
/linux-6.3-rc2/fs/ |
A D | binfmt_elf_fdpic.c | 1250 elf->e_entry = 0; in fill_elf_fdpic_header() 1252 elf->e_shoff = 0; in fill_elf_fdpic_header() 1256 elf->e_phnum = segs; in fill_elf_fdpic_header() 1257 elf->e_shentsize = 0; in fill_elf_fdpic_header() 1258 elf->e_shnum = 0; in fill_elf_fdpic_header() 1259 elf->e_shstrndx = 0; in fill_elf_fdpic_header() 1430 elf->e_shnum = 1; in fill_extnum_info() 1486 elf = kmalloc(sizeof(*elf), GFP_KERNEL); in elf_fdpic_core_dump() 1487 if (!elf) in elf_fdpic_core_dump() 1570 if (!dump_emit(cprm, elf, sizeof(*elf))) in elf_fdpic_core_dump() [all …]
|
A D | binfmt_elf.c | 1493 memset(elf, 0, sizeof(*elf)); in fill_elf_header() 1501 elf->e_type = ET_CORE; in fill_elf_header() 1502 elf->e_machine = machine; in fill_elf_header() 1503 elf->e_version = EV_CURRENT; in fill_elf_header() 1505 elf->e_flags = flags; in fill_elf_header() 1508 elf->e_phnum = segs; in fill_elf_header() 1894 fill_elf_header(elf, phdrs, in fill_note_info() 2006 elf->e_shoff = e_shoff; in fill_extnum_info() 2008 elf->e_shnum = 1; in fill_extnum_info() 2030 struct elfhdr elf; in elf_core_dump() local [all …]
|
/linux-6.3-rc2/arch/powerpc/kernel/ |
A D | fadump.c | 965 struct elfhdr *elf; in fadump_init_elfcore_header() local 978 elf->e_entry = 0; in fadump_init_elfcore_header() 980 elf->e_shoff = 0; in fadump_init_elfcore_header() 983 elf->e_flags = 2; in fadump_init_elfcore_header() 985 elf->e_flags = 1; in fadump_init_elfcore_header() 987 elf->e_flags = 0; in fadump_init_elfcore_header() 991 elf->e_phnum = 0; in fadump_init_elfcore_header() 993 elf->e_shnum = 0; in fadump_init_elfcore_header() 1105 (elf->e_phnum)++; in fadump_create_elfcore_headers() 1120 (elf->e_phnum)++; in fadump_create_elfcore_headers() [all …]
|
/linux-6.3-rc2/tools/lib/bpf/ |
A D | usdt.c | 304 if (elf_kind(elf) != ELF_K_ELF) { in sanity_check_usdt_elf() 309 switch (gelf_getclass(elf)) { in sanity_check_usdt_elf() 327 if (!gelf_getehdr(elf, &ehdr)) in sanity_check_usdt_elf() 356 if (elf_getshdrstrndx(elf, &shstrndx)) in find_elf_sec_by_name() 404 if (elf_getphdrnum(elf, &n)) { in parse_elf_segs() 410 if (!gelf_getphdr(elf, i, &phdr)) { in parse_elf_segs() 952 Elf *elf; in usdt_manager_attach_usdt() local 966 if (!elf) { in usdt_manager_attach_usdt() 1070 elf_end(elf); in usdt_manager_attach_usdt() 1080 if (elf) in usdt_manager_attach_usdt() [all …]
|
/linux-6.3-rc2/arch/x86/realmode/rm/ |
A D | Makefile | 53 LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T 56 targets += realmode.elf 57 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE 63 $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE 70 $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
|
/linux-6.3-rc2/drivers/firmware/efi/libstub/ |
A D | Makefile.zboot | 39 LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds 40 $(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE 44 $(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE 47 targets += zboot-header.o vmlinuz.o vmlinuz.efi.elf vmlinuz.efi
|
/linux-6.3-rc2/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-6.3-rc2/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-6.3-rc2/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-6.3-rc2/tools/objtool/arch/x86/ |
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 WARN("unexpected ELF machine type %d", elf->ehdr.e_machine); in is_x86_64() 152 const struct elf *elf = file->elf; in arch_decode_instruction() local 163 x86_64 = is_x86_64(elf); in arch_decode_instruction() 620 immr = find_reloc_by_dest(elf, (void *)sec, offset+3); in arch_decode_instruction() 621 disp = find_reloc_by_dest(elf, (void *)sec, offset+7); in arch_decode_instruction()
|