-
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.
Signed-off-by: Marcos Paulo de Souza <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0x00000000 crc32c lib/libcrc32c EXPORT_SYMBOL |
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,21 @@ | ||
/* { dg-options "-DCE_EXTRACT_FUNCTIONS=f -DCE_RENAME_SYMBOLS -include ../testsuite/small/linux/livepatch.h -DCE_SYMVERS_PATH=../testsuite/small/Modules.symvers -DKBUILD_MODNAME=crc32c -D__USE_IBT__" } */ | ||
|
||
#include <linux/types.h> | ||
|
||
typedef unsigned int u32; | ||
|
||
u32 crc32c(u32 crc, const void *address, unsigned int length); | ||
|
||
int f(void) | ||
{ | ||
u32 lcrc = 0; | ||
void *addr = 0; | ||
unsigned int len = 0; | ||
|
||
(void)crc32c(lcrc, addr, len); | ||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump "u32 klpe_crc32c" } } */ | ||
/* { dg-final { scan-tree-dump "KLP_RELOC_SYMBOL\(crc32c, crc32c, crc32c\)" } } */ | ||
/* { dg-final { scan-tree-dump-not "\(\*klpe_crc32c\)" } } */ |
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,18 @@ | ||
/** | ||
* KLP_RELOC_SYMBOL_POS - define relocation for external symbols | ||
* | ||
* @LP_OBJ_NAME: name of the livepatched object where the symbol is needed | ||
* @SYM_OBJ_NAME: name of the object where the symbol exists | ||
* @SYM_NAME: symbol name | ||
* @SYM_POS: position of the symbol in SYM_OBJ when there are more | ||
* symbols of the same name. | ||
* | ||
* Use for annotating external symbols used in livepatches which are | ||
* not exported in vmlinux or are in livepatched modules, see | ||
* Documentation/livepatch/module-elf-format.rst | ||
*/ | ||
#define KLP_RELOC_SYMBOL_POS(LP_OBJ_NAME, SYM_OBJ_NAME, SYM_NAME, SYM_POS) \ | ||
asm("\".klp.sym.rela." #LP_OBJ_NAME "." #SYM_OBJ_NAME "." #SYM_NAME "," #SYM_POS "\"") | ||
|
||
#define KLP_RELOC_SYMBOL(LP_OBJ_NAME, SYM_OBJ_NAME, SYM_NAME) \ | ||
KLP_RELOC_SYMBOL_POS(LP_OBJ_NAME, SYM_OBJ_NAME, SYM_NAME, 0) |