Skip to content
Snippets Groups Projects
Commit 01c37f9a authored by Cupertino Miranda's avatar Cupertino Miranda
Browse files

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.
parent 42786ccf
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment