ebpf icon indicating copy to clipboard operation
ebpf copied to clipboard

bpf2go: bogus "type name is used multiple times" error

Open mejedi opened this issue 10 months ago • 0 comments

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

mejedi avatar Dec 25 '24 10:12 mejedi