bpf: set index entry for a VAR_DECL in CO-RE relocs
CO-RE accesses with non pointer struct variables will also generate a "0" string access within the CO-RE relocation. The first index within the access string, has sort of a different meaning then the remaining of the indexes. For i0:i1:...:in being an access index for "struct A a" declaration, its semantics are represented by: (&a + (sizeof(struct A) * i0) + offsetof(i1:...:in) gcc/ChangeLog: * config/bpf/core-builtins.cc (compute_field_expr): Change VAR_DECL outcome in switch case. gcc/testsuite/ChangeLog: * gcc.target/bpf/core-builtin-1.c: Correct test. * gcc.target/bpf/core-builtin-2.c: Correct test. * gcc.target/bpf/core-builtin-exprlist-1.c: Correct test.
Showing
- gcc/config/bpf/core-builtins.cc 4 additions, 1 deletiongcc/config/bpf/core-builtins.cc
- gcc/testsuite/gcc.target/bpf/core-builtin-1.c 8 additions, 8 deletionsgcc/testsuite/gcc.target/bpf/core-builtin-1.c
- gcc/testsuite/gcc.target/bpf/core-builtin-2.c 2 additions, 1 deletiongcc/testsuite/gcc.target/bpf/core-builtin-2.c
- gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c 8 additions, 8 deletionsgcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c
Loading
Please register or sign in to comment