Lines Matching refs:dst_sec

101 struct dst_sec {  struct
140 struct dst_sec *secs; argument
201 struct dst_sec *sec = &linker->secs[i]; in bpf_linker__free()
246 static struct dst_sec *add_dst_sec(struct bpf_linker *linker, const char *sec_name) in add_dst_sec()
248 struct dst_sec *secs = linker->secs, *sec; in add_dst_sec()
272 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx]; in add_new_sym()
298 struct dst_sec *sec; in init_output_elf()
982 static int init_sec(struct bpf_linker *linker, struct dst_sec *dst_sec, struct src_sec *src_sec) in init_sec() argument
989 dst_sec->sec_sz = 0; in init_sec()
990 dst_sec->sec_idx = 0; in init_sec()
991 dst_sec->ephemeral = src_sec->ephemeral; in init_sec()
1007 dst_sec->scn = scn; in init_sec()
1008 dst_sec->shdr = shdr; in init_sec()
1009 dst_sec->data = data; in init_sec()
1010 dst_sec->sec_idx = elf_ndxscn(scn); in init_sec()
1038 static struct dst_sec *find_dst_sec_by_name(struct bpf_linker *linker, const char *sec_name) in find_dst_sec_by_name()
1040 struct dst_sec *sec; in find_dst_sec_by_name()
1053 static bool secs_match(struct dst_sec *dst, struct src_sec *src) in secs_match()
1074 static bool sec_content_is_same(struct dst_sec *dst_sec, struct src_sec *src_sec) in sec_content_is_same() argument
1076 if (dst_sec->sec_sz != src_sec->shdr->sh_size) in sec_content_is_same()
1078 if (memcmp(dst_sec->raw_data, src_sec->data->d_buf, dst_sec->sec_sz) != 0) in sec_content_is_same()
1083 static int extend_sec(struct bpf_linker *linker, struct dst_sec *dst, struct src_sec *src) in extend_sec()
1167 struct dst_sec *dst_sec; in linker_append_sec_data() local
1173 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_sec_data()
1174 if (!dst_sec) { in linker_append_sec_data()
1175 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_sec_data()
1176 if (!dst_sec) in linker_append_sec_data()
1178 err = init_sec(linker, dst_sec, src_sec); in linker_append_sec_data()
1184 if (!secs_match(dst_sec, src_sec)) { in linker_append_sec_data()
1192 if (!sec_content_is_same(dst_sec, src_sec)) { in linker_append_sec_data()
1197 src_sec->dst_id = dst_sec->id; in linker_append_sec_data()
1203 src_sec->dst_id = dst_sec->id; in linker_append_sec_data()
1205 err = extend_sec(linker, dst_sec, src_sec); in linker_append_sec_data()
1248 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx]; in get_sym_by_idx()
1805 struct dst_sec *dst_sec = NULL; in linker_append_elf_sym() local
1827 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_elf_sym()
1830 if (sym_type == STT_SECTION && dst_sec->sec_sym_idx) { in linker_append_elf_sym()
1831 obj->sym_map[src_sym_idx] = dst_sec->sec_sym_idx; in linker_append_elf_sym()
1863 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_elf_sym()
1934 dst_sym->st_shndx = dst_sec->sec_idx; in linker_append_elf_sym()
1939 glob_sym->sec_id = dst_sec->id; in linker_append_elf_sym()
1965 dst_sym->st_shndx = dst_sec ? dst_sec->sec_idx : sym->st_shndx; in linker_append_elf_sym()
1972 dst_sec->sec_sym_idx = dst_sym_idx; in linker_append_elf_sym()
1988 glob_sym->sec_id = dst_sec ? dst_sec->id : 0; in linker_append_elf_sym()
2002 struct dst_sec *dst_symtab = &linker->secs[linker->symtab_sec_idx]; in linker_append_elf_relos()
2007 struct dst_sec *dst_sec, *dst_linked_sec; in linker_append_elf_relos() local
2020 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name); in linker_append_elf_relos()
2021 if (!dst_sec) { in linker_append_elf_relos()
2022 dst_sec = add_dst_sec(linker, src_sec->sec_name); in linker_append_elf_relos()
2023 if (!dst_sec) in linker_append_elf_relos()
2025 err = init_sec(linker, dst_sec, src_sec); in linker_append_elf_relos()
2030 } else if (!secs_match(dst_sec, src_sec)) { in linker_append_elf_relos()
2036 dst_sec->shdr->sh_link = linker->symtab_sec_idx; in linker_append_elf_relos()
2040 dst_sec->shdr->sh_info = dst_linked_sec->sec_idx; in linker_append_elf_relos()
2042 src_sec->dst_id = dst_sec->id; in linker_append_elf_relos()
2043 err = extend_sec(linker, dst_sec, src_sec); in linker_append_elf_relos()
2048 dst_rel = dst_sec->raw_data + src_sec->dst_off; in linker_append_elf_relos()
2326 struct dst_sec *dst_sec; in linker_append_btf() local
2333 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_btf()
2343 dst_sec->has_btf = true; in linker_append_btf()
2349 void *sec_vars = dst_sec->sec_vars; in linker_append_btf()
2357 if (glob_sym->sec_id != dst_sec->id) { in linker_append_btf()
2359 name, glob_sym->sec_id, dst_sec->id); in linker_append_btf()
2372 dst_var = &dst_sec->sec_vars[glob_sym->var_idx]; in linker_append_btf()
2388 dst_sec->sec_var_cnt + 1, in linker_append_btf()
2389 sizeof(*dst_sec->sec_vars)); in linker_append_btf()
2393 dst_sec->sec_vars = sec_vars; in linker_append_btf()
2394 dst_sec->sec_var_cnt++; in linker_append_btf()
2396 dst_var = &dst_sec->sec_vars[dst_sec->sec_var_cnt - 1]; in linker_append_btf()
2402 glob_sym->var_idx = dst_sec->sec_var_cnt - 1; in linker_append_btf()
2431 struct dst_sec *dst_sec; in linker_append_btf_ext() local
2447 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_btf_ext()
2449 if (dst_sec->func_info.rec_sz == 0) in linker_append_btf_ext()
2450 dst_sec->func_info.rec_sz = rec_sz; in linker_append_btf_ext()
2451 if (dst_sec->func_info.rec_sz != rec_sz) { in linker_append_btf_ext()
2457 dst_rec = add_btf_ext_rec(&dst_sec->func_info, src_rec); in linker_append_btf_ext()
2476 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_btf_ext()
2478 if (dst_sec->line_info.rec_sz == 0) in linker_append_btf_ext()
2479 dst_sec->line_info.rec_sz = rec_sz; in linker_append_btf_ext()
2480 if (dst_sec->line_info.rec_sz != rec_sz) { in linker_append_btf_ext()
2486 dst_rec = add_btf_ext_rec(&dst_sec->line_info, src_rec); in linker_append_btf_ext()
2518 dst_sec = &linker->secs[src_sec->dst_id]; in linker_append_btf_ext()
2520 if (dst_sec->core_relo_info.rec_sz == 0) in linker_append_btf_ext()
2521 dst_sec->core_relo_info.rec_sz = rec_sz; in linker_append_btf_ext()
2522 if (dst_sec->core_relo_info.rec_sz != rec_sz) { in linker_append_btf_ext()
2528 dst_rec = add_btf_ext_rec(&dst_sec->core_relo_info, src_rec); in linker_append_btf_ext()
2550 struct dst_sec *sec; in bpf_linker__finalize()
2663 struct dst_sec *sec = &linker->secs[i]; in finalize_btf()
2762 struct dst_sec *sec = &linker->secs[i]; in finalize_btf_ext()
2840 struct dst_sec *sec = &linker->secs[i]; in finalize_btf_ext()
2857 struct dst_sec *sec = &linker->secs[i]; in finalize_btf_ext()
2874 struct dst_sec *sec = &linker->secs[i]; in finalize_btf_ext()