Skip to content

lisa._btf: Ensure padding members in nested anonymous struct/union have unique names

Douglas Raillard requested to merge douglas-raillard-arm/lisa:_pr0000027 into main

FIX

Nested anonymous struct or union are logically expanded into their parent struct/union. This means that members of those anonymous types may clash with the members of a sibling anonymous type. This will never happen in the original C source (as it would not compile) but we need to take care when generating synthetic members for padding purpose.

Ensure those padding members are uniquely named by encoding the BTF id of the anonymous parent(s) they are located in in their name. Since the members themselves can be shared at BTF level (thanks to BTF type deduplication, this can happen), we use the effective parents stack the type is anonymous type is emitted in. This way, no clash can happen.

Merge request reports