On Thu, 2025-11-13 at 13:39 +0100, Paul Houssel wrote:
Handle recursive typedefs in BTF deduplication
Pahole fails to encode BTF for some Go projects (e.g. Kubernetes and Podman) due to recursive type definitions that create reference loops not representable in C. These recursive typedefs trigger a failure in the BTF deduplication algorithm.
This patch extends btf_dedup_ref_type() to properly handle potential recursion for BTF_KIND_TYPEDEF, similar to how recursion is already handled for BTF_KIND_STRUCT. This allows pahole to successfully generate BTF for Go binaries using recursive types without impacting existing C-based workflows.
Co-developed-by: Martin Horth martin.horth@telecom-sudparis.eu Signed-off-by: Martin Horth martin.horth@telecom-sudparis.eu Co-developed-by: Ouail Derghal ouail.derghal@imt-atlantique.fr Signed-off-by: Ouail Derghal ouail.derghal@imt-atlantique.fr Co-developed-by: Guilhem Jazeron guilhem.jazeron@inria.fr Signed-off-by: Guilhem Jazeron guilhem.jazeron@inria.fr Co-developed-by: Ludovic Paillat ludovic.paillat@inria.fr Signed-off-by: Ludovic Paillat ludovic.paillat@inria.fr Co-developed-by: Robin Theveniaut robin.theveniaut@irit.fr Signed-off-by: Robin Theveniaut robin.theveniaut@irit.fr Suggested-by: Tristan d'Audibert tristan.daudibert@gmail.com Signed-off-by: Paul Houssel paul.houssel@orange.com
Acked-by: Eduard Zingerman eddyz87@gmail.com
[...]