forked from cilium/ebpf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elf_reader: initial __kconfig support for LINUX_KERNEL_VERSION
This commit is a first step towards __kconfig support. When a .kconfig Datasec is detected, a .kconfig map is created and emitted into the CollectionSpec. Instructions referring to __kconfig variables will be rewritten to refer to the .kconfig map during ELF load. Its contents will only be initialized when loading the spec into the kernel. All variables specified in the .kconfig Datasec are resolved based on their names, and the results are written to .kconfig's Contents. For the moment, it only enables using LINUX_KERNEL_VERSION. Signed-off-by: Francis Laniel <[email protected]> Co-authored-by: Timo Beckers <[email protected]>
- Loading branch information
Showing
8 changed files
with
183 additions
and
2 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
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
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,9 @@ | ||
#include "common.h" | ||
|
||
char __license[] __section("license") = "MIT"; | ||
|
||
extern int LINUX_KERNEL_VERSION __kconfig; | ||
|
||
__section("socket") int kconfig() { | ||
return LINUX_KERNEL_VERSION; | ||
} |