Lines Matching defs:dst_sec
97 /* sec_var index in the corresponding dst_sec, if exists */
106 struct dst_sec {
146 struct dst_sec *secs;
211 struct dst_sec *sec = &linker->secs[i];
311 static struct dst_sec *add_dst_sec(struct bpf_linker *linker, const char *sec_name)
313 struct dst_sec *secs = linker->secs, *sec;
337 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx];
363 struct dst_sec *sec;
1140 static int init_sec(struct bpf_linker *linker, struct dst_sec *dst_sec, struct src_sec *src_sec)
1147 dst_sec->sec_sz = 0;
1148 dst_sec->sec_idx = 0;
1149 dst_sec->ephemeral = src_sec->ephemeral;
1165 dst_sec->scn = scn;
1166 dst_sec->shdr = shdr;
1167 dst_sec->data = data;
1168 dst_sec->sec_idx = elf_ndxscn(scn);
1196 static struct dst_sec *find_dst_sec_by_name(struct bpf_linker *linker, const char *sec_name)
1198 struct dst_sec *sec;
1211 static bool secs_match(struct dst_sec *dst, struct src_sec *src)
1232 static bool sec_content_is_same(struct dst_sec *dst_sec, struct src_sec *src_sec)
1234 if (dst_sec->sec_sz != src_sec->shdr->sh_size)
1236 if (memcmp(dst_sec->raw_data, src_sec->data->d_buf, dst_sec->sec_sz) != 0)
1241 static bool is_exec_sec(struct dst_sec *sec)
1259 static int extend_sec(struct bpf_linker *linker, struct dst_sec *dst, struct src_sec *src)
1359 struct dst_sec *dst_sec;
1365 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name);
1366 if (!dst_sec) {
1367 dst_sec = add_dst_sec(linker, src_sec->sec_name);
1368 if (!dst_sec)
1370 err = init_sec(linker, dst_sec, src_sec);
1376 if (!secs_match(dst_sec, src_sec)) {
1384 if (!sec_content_is_same(dst_sec, src_sec)) {
1389 src_sec->dst_id = dst_sec->id;
1395 src_sec->dst_id = dst_sec->id;
1397 err = extend_sec(linker, dst_sec, src_sec);
1440 struct dst_sec *symtab = &linker->secs[linker->symtab_sec_idx];
1999 struct dst_sec *dst_sec = NULL;
2021 dst_sec = &linker->secs[src_sec->dst_id];
2024 if (sym_type == STT_SECTION && dst_sec->sec_sym_idx) {
2025 obj->sym_map[src_sym_idx] = dst_sec->sec_sym_idx;
2049 * Those don't have associated src_sec/dst_sec.
2057 dst_sec = &linker->secs[src_sec->dst_id];
2128 dst_sym->st_shndx = dst_sec->sec_idx;
2132 /* see comment below about dst_sec->id vs dst_sec->sec_idx */
2133 glob_sym->sec_id = dst_sec->id;
2159 dst_sym->st_shndx = dst_sec ? dst_sec->sec_idx : sym->st_shndx;
2165 if (sym_type == STT_SECTION && dst_sec) {
2166 dst_sec->sec_sym_idx = dst_sym_idx;
2176 /* we use dst_sec->id (and not dst_sec->sec_idx), because
2180 * associated with it, so dst_sec->id == dst_sec->sec_idx == 0.
2182 glob_sym->sec_id = dst_sec ? dst_sec->id : 0;
2200 struct dst_sec *dst_sec, *dst_linked_sec;
2213 dst_sec = find_dst_sec_by_name(linker, src_sec->sec_name);
2214 if (!dst_sec) {
2215 dst_sec = add_dst_sec(linker, src_sec->sec_name);
2216 if (!dst_sec)
2218 err = init_sec(linker, dst_sec, src_sec);
2223 } else if (!secs_match(dst_sec, src_sec)) {
2229 dst_sec->shdr->sh_link = linker->symtab_sec_idx;
2233 dst_sec->shdr->sh_info = dst_linked_sec->sec_idx;
2235 src_sec->dst_id = dst_sec->id;
2236 err = extend_sec(linker, dst_sec, src_sec);
2241 dst_rel = dst_sec->raw_data + src_sec->dst_off;
2523 struct dst_sec *dst_sec;
2530 dst_sec = &linker->secs[src_sec->dst_id];
2540 dst_sec->has_btf = true;
2546 void *sec_vars = dst_sec->sec_vars;
2554 if (glob_sym->sec_id != dst_sec->id) {
2556 name, glob_sym->sec_id, dst_sec->id);
2573 dst_var = &dst_sec->sec_vars[glob_sym->var_idx];
2589 dst_sec->sec_var_cnt + 1,
2590 sizeof(*dst_sec->sec_vars));
2594 dst_sec->sec_vars = sec_vars;
2595 dst_sec->sec_var_cnt++;
2597 dst_var = &dst_sec->sec_vars[dst_sec->sec_var_cnt - 1];
2603 glob_sym->var_idx = dst_sec->sec_var_cnt - 1;
2632 struct dst_sec *dst_sec;
2648 dst_sec = &linker->secs[src_sec->dst_id];
2650 if (dst_sec->func_info.rec_sz == 0)
2651 dst_sec->func_info.rec_sz = rec_sz;
2652 if (dst_sec->func_info.rec_sz != rec_sz) {
2658 dst_rec = add_btf_ext_rec(&dst_sec->func_info, src_rec);
2677 dst_sec = &linker->secs[src_sec->dst_id];
2679 if (dst_sec->line_info.rec_sz == 0)
2680 dst_sec->line_info.rec_sz = rec_sz;
2681 if (dst_sec->line_info.rec_sz != rec_sz) {
2687 dst_rec = add_btf_ext_rec(&dst_sec->line_info, src_rec);
2719 dst_sec = &linker->secs[src_sec->dst_id];
2721 if (dst_sec->core_relo_info.rec_sz == 0)
2722 dst_sec->core_relo_info.rec_sz = rec_sz;
2723 if (dst_sec->core_relo_info.rec_sz != rec_sz) {
2729 dst_rec = add_btf_ext_rec(&dst_sec->core_relo_info, src_rec);
2751 struct dst_sec *sec;
2871 struct dst_sec *sec = &linker->secs[i];
2978 struct dst_sec *sec = &linker->secs[i];
3056 struct dst_sec *sec = &linker->secs[i];
3073 struct dst_sec *sec = &linker->secs[i];
3090 struct dst_sec *sec = &linker->secs[i];