Lines Matching refs:sec_name
28 const char *sec_name; member
103 char *sec_name; member
205 free(sec->sec_name); in bpf_linker__free()
249 static struct dst_sec *add_dst_sec(struct bpf_linker *linker, const char *sec_name) in add_dst_sec() argument
266 sec->sec_name = strdup(sec_name); in add_dst_sec()
267 if (!sec->sec_name) in add_dst_sec()
358 str_off = strset__add_str(linker->strtab_strs, sec->sec_name); in init_output_elf()
399 str_off = strset__add_str(linker->strtab_strs, sec->sec_name); in init_output_elf()
481 const char *name = sec->sec_name; in is_ignored_sec()
493 strcmp(sec->sec_name, ".text") == 0) in is_ignored_sec()
497 if (is_dwarf_sec_name(sec->sec_name)) in is_ignored_sec()
515 static struct src_sec *add_src_sec(struct src_obj *obj, const char *sec_name) in add_src_sec() argument
532 sec->sec_name = sec_name; in add_src_sec()
617 const char *sec_name; in linker_load_obj_file() local
627 sec_name = elf_strptr(obj->elf, obj->shstrs_sec_idx, shdr->sh_name); in linker_load_obj_file()
628 if (!sec_name) { in linker_load_obj_file()
639 sec_idx, sec_name, filename); in linker_load_obj_file()
643 sec = add_src_sec(obj, sec_name); in linker_load_obj_file()
670 if (strcmp(sec_name, BTF_ELF_SEC) == 0) { in linker_load_obj_file()
681 if (strcmp(sec_name, BTF_EXT_ELF_SEC) == 0) { in linker_load_obj_file()
703 sec_idx, sec_name, filename); in linker_load_obj_file()
734 if (sec->sec_name[0] == '\0') { in linker_sanity_check_elf()
739 if (is_dwarf_sec_name(sec->sec_name)) in linker_sanity_check_elf()
791 sec->sec_idx, sec->sec_name, (size_t)sec->shdr->sh_type, obj->filename); in linker_sanity_check_elf()
900 if (strncmp(sec->sec_name, ".rel", sizeof(".rel") - 1) != 0 in linker_sanity_check_elf_relos()
901 || strcmp(sec->sec_name + sizeof(".rel") - 1, link_sec->sec_name) != 0) { in linker_sanity_check_elf_relos()
1058 name_off = strset__add_str(linker->strtab_strs, src_sec->sec_name); in init_sec()
1084 static struct dst_sec *find_dst_sec_by_name(struct bpf_linker *linker, const char *sec_name) in find_dst_sec_by_name() argument
1092 if (strcmp(sec->sec_name, sec_name) == 0) in find_dst_sec_by_name()
1105 pr_warn("sec %s types mismatch\n", dst->sec_name); in secs_match()
1109 pr_warn("sec %s flags mismatch\n", dst->sec_name); in secs_match()
1113 pr_warn("sec %s entsize mismatch\n", dst->sec_name); in secs_match()
1253 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_sec_data()
1255 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_sec_data()
1260 pr_warn("failed to init section '%s'\n", src_sec->sec_name); in linker_append_sec_data()
1265 pr_warn("ELF sections %s are incompatible\n", src_sec->sec_name); in linker_append_sec_data()
1270 if (strcmp(src_sec->sec_name, "license") == 0 in linker_append_sec_data()
1271 || strcmp(src_sec->sec_name, "version") == 0) { in linker_append_sec_data()
1273 pr_warn("non-identical contents of section '%s' are not supported\n", src_sec->sec_name); in linker_append_sec_data()
1714 if (glob_sym->sec_id && strcmp(linker->secs[glob_sym->sec_id].sec_name, MAPS_ELF_SEC) == 0) in glob_syms_match()
1799 static struct src_sec *find_src_sec_by_name(struct src_obj *obj, const char *sec_name) in find_src_sec_by_name() argument
1807 if (strcmp(sec->sec_name, sec_name) == 0) in find_src_sec_by_name()
1927 const char *sec_name = NULL; in linker_append_elf_sym() local
1931 sec_name = btf__str_by_offset(obj->btf, t->name_off); in linker_append_elf_sym()
1939 if (strcmp(sec_name, BTF_EXTERN_SEC) != 0) { in linker_append_elf_sym()
1940 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_elf_sym()
1942 pr_warn("failed to find matching ELF sec '%s'\n", sec_name); in linker_append_elf_sym()
2101 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_elf_relos()
2103 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_elf_relos()
2108 pr_warn("failed to init section '%s'\n", src_sec->sec_name); in linker_append_elf_relos()
2112 pr_warn("sections %s are not compatible\n", src_sec->sec_name); in linker_append_elf_relos()
2204 const char *sec_name; in linker_fixup_btf() local
2220 sec_name = btf__str_by_offset(obj->btf, t->name_off); in linker_fixup_btf()
2221 sec = find_src_sec_by_name(obj, sec_name); in linker_fixup_btf()
2251 if (strcmp(sec_name, BTF_EXTERN_SEC) == 0) in linker_fixup_btf()
2254 sec = add_src_sec(obj, sec_name); in linker_fixup_btf()
2286 pr_warn("failed to find symbol for variable '%s' in section '%s'\n", var_name, sec_name); in linker_fixup_btf()
2518 const char *sec_name, *s; in linker_append_btf_ext() local
2530 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2531 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2533 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2541 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2559 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2560 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2562 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2570 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2601 sec_name = btf__name_by_offset(obj->btf, ext_sec->sec_name_off); in linker_append_btf_ext()
2602 src_sec = find_src_sec_by_name(obj, sec_name); in linker_append_btf_ext()
2604 pr_warn("can't find section '%s' referenced from .BTF.ext\n", sec_name); in linker_append_btf_ext()
2612 pr_warn("incompatible .BTF.ext record sizes for section '%s'\n", sec_name); in linker_append_btf_ext()
2704 static int emit_elf_data_sec(struct bpf_linker *linker, const char *sec_name, in emit_elf_data_sec() argument
2712 name_off = strset__add_str(linker->strtab_strs, sec_name); in emit_elf_data_sec()
2763 id = btf__add_datasec(btf, sec->sec_name, sec->sec_sz); in finalize_btf()
2766 sec->sec_name, id); in finalize_btf()
2826 const char *sec_name, struct btf_ext_sec_data *sec_data) in emit_btf_ext_data() argument
2836 str_off = btf__add_str(linker->btf, sec_name); in emit_btf_ext_data()
2945 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->func_info); in finalize_btf_ext()
2962 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->line_info); in finalize_btf_ext()
2979 sz = emit_btf_ext_data(linker, cur, sec->sec_name, &sec->core_relo_info); in finalize_btf_ext()