-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libcextract: Add support for Weak symbols for kernel mode
Until this point all symbols found in kernel mode (usually using Symvers file), were strong (with externalized variables) or none (which copied the symbols to the closure). Now clang-extract checks is the symbol is present on vmlinux, meaning that the symbol is weak externalized, meaning the the symbol will be always present. Signed-off-by: Marcos Paulo de Souza <[email protected]>
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
0x00000000 crc32c lib/libcrc32c EXPORT_SYMBOL | ||
0x00000000 crc32c lib/libcrc32c EXPORT_SYMBOL | ||
0x00000000 bpf_prog_put vmlinux EXPORT_SYMBOL_GPL |
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 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_SYMVERS_PATH=../testsuite/linux/Modules.symvers -DCE_RENAME_SYMBOLS -nostdinc -I../testsuite/linux -D__USE_IBT__ -D__KERNEL__" } */ | ||
|
||
int bpf_prog_put(void); | ||
|
||
int bpf_prog_put(void) | ||
{ | ||
return 42; | ||
} | ||
|
||
int f(void) | ||
{ | ||
return bpf_prog_put(); | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "int bpf_prog_put\(void\);" } } */ | ||
/* { dg-final { scan-tree-dump-not "return 42;" } } */ |