Lines Matching defs:dst_sec

92 	/* sec_var index in the corresponding dst_sec, if exists */
101 struct dst_sec {
140 struct dst_sec *secs;
201 struct dst_sec *sec = &linker->secs[i];
247 static struct dst_sec *add_dst_sec(struct bpf_linker *linker, const char *sec_name)
249 struct dst_sec *secs = linker->secs, *sec;
273 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx];
299 struct dst_sec *sec;
978 static int init_sec(struct bpf_linker *linker, struct dst_sec *dst_sec, struct src_sec *src_sec)
985 dst_sec->sec_sz = 0;
986 dst_sec->sec_idx = 0;
987 dst_sec->ephemeral = src_sec->ephemeral;
1003 dst_sec->scn = scn;
1004 dst_sec->shdr = shdr;
1005 dst_sec->data = data;
1006 dst_sec->sec_idx = elf_ndxscn(scn);
1034 static struct dst_sec *find_dst_sec_by_name(struct bpf_linker *linker, const char *sec_name)
1036 struct dst_sec *sec;
1049 static bool secs_match(struct dst_sec *dst, struct src_sec *src)
1070 static bool sec_content_is_same(struct dst_sec *dst_sec, struct src_sec *src_sec)
1072 if (dst_sec->sec_sz != src_sec->shdr->sh_size)
1074 if (memcmp(dst_sec->raw_data, src_sec->data->d_buf, dst_sec->sec_sz) != 0)
1079 static int extend_sec(struct bpf_linker *linker, struct dst_sec *dst, struct src_sec *src)
1175 struct dst_sec *dst_sec;
1181 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name);
1182 if (!dst_sec) {
1183 dst_sec = add_dst_sec(linker, src_sec->sec_name);
1184 if (!dst_sec)
1186 err = init_sec(linker, dst_sec, src_sec);
1192 if (!secs_match(dst_sec, src_sec)) {
1200 if (!sec_content_is_same(dst_sec, src_sec)) {
1205 src_sec->dst_id = dst_sec->id;
1211 src_sec->dst_id = dst_sec->id;
1213 err = extend_sec(linker, dst_sec, src_sec);
1256 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx];
1815 struct dst_sec *dst_sec = NULL;
1837 dst_sec = &linker->secs[src_sec->dst_id];
1840 if (sym_type == STT_SECTION && dst_sec->sec_sym_idx) {
1841 obj->sym_map[src_sym_idx] = dst_sec->sec_sym_idx;
1865 * Those don't have associated src_sec/dst_sec.
1873 dst_sec = &linker->secs[src_sec->dst_id];
1944 dst_sym->st_shndx = dst_sec->sec_idx;
1948 /* see comment below about dst_sec->id vs dst_sec->sec_idx */
1949 glob_sym->sec_id = dst_sec->id;
1975 dst_sym->st_shndx = dst_sec ? dst_sec->sec_idx : sym->st_shndx;
1982 dst_sec->sec_sym_idx = dst_sym_idx;
1992 /* we use dst_sec->id (and not dst_sec->sec_idx), because
1996 * associated with it, so dst_sec->id == dst_sec->sec_idx == 0.
1998 glob_sym->sec_id = dst_sec ? dst_sec->id : 0;
2016 struct dst_sec *dst_sec, *dst_linked_sec;
2029 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name);
2030 if (!dst_sec) {
2031 dst_sec = add_dst_sec(linker, src_sec->sec_name);
2032 if (!dst_sec)
2034 err = init_sec(linker, dst_sec, src_sec);
2039 } else if (!secs_match(dst_sec, src_sec)) {
2045 dst_sec->shdr->sh_link = linker->symtab_sec_idx;
2049 dst_sec->shdr->sh_info = dst_linked_sec->sec_idx;
2051 src_sec->dst_id = dst_sec->id;
2052 err = extend_sec(linker, dst_sec, src_sec);
2057 dst_rel = dst_sec->raw_data + src_sec->dst_off;
2332 struct dst_sec *dst_sec;
2339 dst_sec = &linker->secs[src_sec->dst_id];
2349 dst_sec->has_btf = true;
2355 void *sec_vars = dst_sec->sec_vars;
2363 if (glob_sym->sec_id != dst_sec->id) {
2365 name, glob_sym->sec_id, dst_sec->id);
2378 dst_var = &dst_sec->sec_vars[glob_sym->var_idx];
2394 dst_sec->sec_var_cnt + 1,
2395 sizeof(*dst_sec->sec_vars));
2399 dst_sec->sec_vars = sec_vars;
2400 dst_sec->sec_var_cnt++;
2402 dst_var = &dst_sec->sec_vars[dst_sec->sec_var_cnt - 1];
2408 glob_sym->var_idx = dst_sec->sec_var_cnt - 1;
2437 struct dst_sec *dst_sec;
2453 dst_sec = &linker->secs[src_sec->dst_id];
2455 if (dst_sec->func_info.rec_sz == 0)
2456 dst_sec->func_info.rec_sz = rec_sz;
2457 if (dst_sec->func_info.rec_sz != rec_sz) {
2463 dst_rec = add_btf_ext_rec(&dst_sec->func_info, src_rec);
2482 dst_sec = &linker->secs[src_sec->dst_id];
2484 if (dst_sec->line_info.rec_sz == 0)
2485 dst_sec->line_info.rec_sz = rec_sz;
2486 if (dst_sec->line_info.rec_sz != rec_sz) {
2492 dst_rec = add_btf_ext_rec(&dst_sec->line_info, src_rec);
2524 dst_sec = &linker->secs[src_sec->dst_id];
2526 if (dst_sec->core_relo_info.rec_sz == 0)
2527 dst_sec->core_relo_info.rec_sz = rec_sz;
2528 if (dst_sec->core_relo_info.rec_sz != rec_sz) {
2534 dst_rec = add_btf_ext_rec(&dst_sec->core_relo_info, src_rec);
2556 struct dst_sec *sec;
2670 struct dst_sec *sec = &linker->secs[i];
2770 struct dst_sec *sec = &linker->secs[i];
2848 struct dst_sec *sec = &linker->secs[i];
2865 struct dst_sec *sec = &linker->secs[i];
2882 struct dst_sec *sec = &linker->secs[i];