Open
Description
Describe the bug
When (redundant) -type T
option refers to a type that is already exposed because a variable of T
exists, a bogus "type name is used multiple times" error is reported.
How to reproduce
//go:build ignore
// x.c
struct S {} s;
$ bpf2go --type S --go-package eee x x.c
Error: can't write /home/nickz/cilium-ebpf.git/x_bpfel.go: type name "xS" is used multiple times
The error occurs because variable's type is a copy produced in loadDataSections
. We end up with two distinct objects.
Version information
v0.17.1