-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btf: Make test for ld64imm CO-RE relocations
Added a test which makes sure we do not mess up offsets when replacing a ld64imm with poisoned instructions. Signed-off-by: Dylan Reimerink <[email protected]>
- Loading branch information
1 parent
933e7a3
commit e43a484
Showing
5 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "bpf_core_read.h" | ||
|
||
enum cgroup_subsys_id { | ||
cpuset_cgrp_id, | ||
cpuset_cgrp_id_lublub, | ||
CGROUP_SUBSYS_COUNT, | ||
}; | ||
|
||
#define __section(NAME) __attribute__((section(NAME), used)) | ||
|
||
__section("socket/core_ld64imm") int core_ld64imm() { | ||
if (bpf_core_enum_value_exists(enum cgroup_subsys_id, cpuset_cgrp_id_lublub)) { | ||
__attribute__((unused)) const volatile int val = bpf_core_enum_value(enum cgroup_subsys_id, cpuset_cgrp_id_lublub); | ||
} | ||
return 0; | ||
} |