summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Maguire <alan.maguire@oracle.com>2026-10-09 12:23:21 +0100
committerAlexei Starovoitov <ast@kernel.org>2026-10-11 14:18:06 +0000
commit5876080366ae3967a3aad5e193ea0e7704fa022d (patch)
treefada205332a7196e97c5fdf57453fd30fc004150 /include
parent672981f4aec1d0131761aec60298312464bd7a50 (diff)
downloadlinux-next-5876080366ae3967a3aad5e193ea0e7704fa022d.tar.gz
linux-next-5876080366ae3967a3aad5e193ea0e7704fa022d.zip
btf: Preserve string relocation maps for split BTF
Make btf_relocate() optionally return the string-offset map it builds while relocating a BTF relative to a distilled base. A subsequent split BTF object can use that map to rebase references to base strings. Also account for the accumulated base string offset when assigning a new BTF base. This is required when the base is itself split. Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261009112324.1442319-5-alan.maguire@oracle.com
Diffstat (limited to 'include')
-rw-r--r--include/linux/btf.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h
index f731c7a5f14c..b66e20a18c54 100644
--- a/include/linux/btf.h
+++ b/include/linux/btf.h
@@ -608,7 +608,8 @@ struct btf_field_iter {
#ifdef CONFIG_BPF_SYSCALL
const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);
void btf_set_base_btf(struct btf *btf, const struct btf *base_btf);
-int btf_relocate(struct btf *btf, const struct btf *base_btf, __u32 **map_ids);
+int btf_relocate(struct btf *btf, const struct btf *base_btf, __u32 **map_ids,
+ __u32 **map_strs);
int btf_field_iter_init(struct btf_field_iter *it, struct btf_type *t,
enum btf_field_iter_kind iter_kind);
__u32 *btf_field_iter_next(struct btf_field_iter *it);
@@ -682,7 +683,7 @@ static inline void btf_set_base_btf(struct btf *btf, const struct btf *base_btf)
}
static inline int btf_relocate(void *log, struct btf *btf, const struct btf *base_btf,
- __u32 **map_ids)
+ __u32 **map_ids, __u32 **map_strs)
{
return -EOPNOTSUPP;
}