Lines Matching refs:sec_name
27 const char *sec_name; member
102 char *sec_name; member
203 free(sec->sec_name); in bpf_linker__free()
247 static struct dst_sec *add_dst_sec(struct bpf_linker *linker, const char *sec_name) in add_dst_sec() argument
264 sec->sec_name = strdup(sec_name); in add_dst_sec()
265 if (!sec->sec_name) in add_dst_sec()
361 str_off = strset__add_str(linker->strtab_strs, sec->sec_name); in init_output_elf()
400 str_off = strset__add_str(linker->strtab_strs, sec->sec_name); in init_output_elf()
482 const char *name = sec->sec_name; in is_ignored_sec()
494 strcmp(sec->sec_name, ".text") == 0) in is_ignored_sec()
498 if (is_dwarf_sec_name(sec->sec_name)) in is_ignored_sec()
516 static struct src_sec *add_src_sec(struct src_obj *obj, const char *sec_name) in add_src_sec() argument
533 sec->sec_name = sec_name; in add_src_sec()
602 const char *sec_name; in linker_load_obj_file() local
612 sec_name = elf_strptr(obj->elf, obj->shstrs_sec_idx, shdr->sh_name); in linker_load_obj_file()
613 if (!sec_name) { in linker_load_obj_file()
624 sec_idx, sec_name, filename); in linker_load_obj_file()
628 sec = add_src_sec(obj, sec_name); in linker_load_obj_file()
655 if (strcmp(sec_name, BTF_ELF_SEC) == 0) { in linker_load_obj_file()
665 if (strcmp(sec_name, BTF_EXT_ELF_SEC) == 0) { in linker_load_obj_file()
686 sec_idx, sec_name, filename); in linker_load_obj_file()
717 if (sec->sec_name[0] == '\0') { in linker_sanity_check_elf()
755 sec->sec_idx, sec->sec_name, (size_t)sec->shdr->sh_type, obj->filename); in linker_sanity_check_elf()
864 if (strncmp(sec->sec_name, ".rel", sizeof(".rel") - 1) != 0 in linker_sanity_check_elf_relos()
865 || strcmp(sec->sec_name + sizeof(".rel") - 1, link_sec->sec_name) != 0) { in linker_sanity_check_elf_relos()
1008 name_off = strset__add_str(linker->strtab_strs, src_sec->sec_name); in init_sec()
1034 static struct dst_sec *find_dst_sec_by_name(struct bpf_linker *linker, const char *sec_name) in find_dst_sec_by_name() argument
1042 if (strcmp(sec->sec_name, sec_name) == 0) in find_dst_sec_by_name()
1055 pr_warn("sec %s types mismatch\n", dst->sec_name); in secs_match()
1059 pr_warn("sec %s flags mismatch\n", dst->sec_name); in secs_match()
1063 pr_warn("sec %s entsize mismatch\n", dst->sec_name); in secs_match()
1181 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_sec_data()
1183 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_sec_data()
1188 pr_warn("failed to init section '%s'\n", src_sec->sec_name); in linker_append_sec_data()
1193 pr_warn("ELF sections %s are incompatible\n", src_sec->sec_name); in linker_append_sec_data()
1198 if (strcmp(src_sec->sec_name, "license") == 0 in linker_append_sec_data()
1199 || strcmp(src_sec->sec_name, "version") == 0) { in linker_append_sec_data()
1201 pr_warn("non-identical contents of section '%s' are not supported\n", src_sec->sec_name); in linker_append_sec_data()
1642 if (glob_sym->sec_id && strcmp(linker->secs[glob_sym->sec_id].sec_name, MAPS_ELF_SEC) == 0) in glob_syms_match()
1727 static struct src_sec *find_src_sec_by_name(struct src_obj *obj, const char *sec_name) in find_src_sec_by_name() argument
1735 if (strcmp(sec->sec_name, sec_name) == 0) in find_src_sec_by_name()
1855 const char *sec_name = NULL; in linker_append_elf_sym() local
1859 sec_name = btf__str_by_offset(obj->btf, t->name_off); in linker_append_elf_sym()
1867 if (strcmp(sec_name, BTF_EXTERN_SEC) != 0) { in linker_append_elf_sym()
1868 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_elf_sym()
1870 pr_warn("failed to find matching ELF sec '%s'\n", sec_name); in linker_append_elf_sym()
2029 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_elf_relos()
2031 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_elf_relos()
2036 pr_warn("failed to init section '%s'\n", src_sec->sec_name); in linker_append_elf_relos()
2040 pr_warn("sections %s are not compatible\n", src_sec->sec_name); in linker_append_elf_relos()
2132 const char *sec_name; in linker_fixup_btf() local
2148 sec_name = btf__str_by_offset(obj->btf, t->name_off); in linker_fixup_btf()
2149 sec = find_src_sec_by_name(obj, sec_name); in linker_fixup_btf()
2179 if (strcmp(sec_name, BTF_EXTERN_SEC) == 0) in linker_fixup_btf()
2182 sec = add_src_sec(obj, sec_name); in linker_fixup_btf()
2207 pr_warn("failed to find symbol for variable '%s' in section '%s'\n", var_name, sec_name); in linker_fixup_btf()
2435 const char *sec_name, *s; in linker_append_btf_ext() local
2447 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2448 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2450 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2458 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2476 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2477 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2479 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2487 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2518 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2519 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2521 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2529 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2617 static int emit_elf_data_sec(struct bpf_linker *linker, const char *sec_name, in emit_elf_data_sec() argument
2625 name_off = strset__add_str(linker->strtab_strs, sec_name); in emit_elf_data_sec()
2675 id = btf__add_datasec(btf, sec->sec_name, sec->sec_sz); in finalize_btf()
2678 sec->sec_name, id); in finalize_btf()
2731 const char *sec_name, struct btf_ext_sec_data *sec_data) in emit_btf_ext_data() argument
2741 str_off = btf__add_str(linker->btf, sec_name); in emit_btf_ext_data()
2850 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->func_info); in finalize_btf_ext()
2867 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->line_info); in finalize_btf_ext()
2884 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->core_relo_info); in finalize_btf_ext()