mirror of
https://github.com/aya-rs/aya.git
synced 2026-10-13 22:49:15 +02:00
This avoids requiring kernel support for all types of relocations when testing a specific type.
18 lines
360 B
C
18 lines
360 B
C
#include "reloc.h"
|
|
|
|
enum relocated_enum_unsigned_64 {
|
|
U64_VAL =
|
|
#ifndef TARGET
|
|
0xAAAAAAAABBBBBBBB
|
|
#else
|
|
0xCCCCCCCCDDDDDDDD
|
|
#endif
|
|
};
|
|
|
|
__noinline int enum_unsigned_64_global() {
|
|
return set_output(
|
|
bpf_core_enum_value(enum relocated_enum_unsigned_64, U64_VAL));
|
|
}
|
|
|
|
SEC("uprobe") int program(void *ctx) { return enum_unsigned_64_global(); }
|