Skip to content

[BPF] fix typedef issue for offset relocation #42136

@yonghong-song

Description

@yonghong-song
Bugzilla Link 42791
Resolution FIXED
Resolved on Jul 29, 2019 02:02
Version 9.0
OS Linux
Blocks #41819
CC @zmodem

Extended Description

Currently, the CO-RE offset relocation does not work
if any struct/union member or array element is a typedef.
For example,

typedef const int arr_t[7];
struct input {
arr_t a;
};
func(...) {
struct input *in = ...;
... __builtin_preserve_access_index(&in->a[1]) ...
}

The BPF backend calculated default offset is 0 while
4 is the correct answer. Similar issues exist for struct/union
typedef's.

Current implementation does not handle typedef properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions