Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–1348 unchanged (1348 lines)
1349 * 0: success
1350 */
1351static int validate_special_section_klp_reloc(struct elfs *e, struct symbol *sym)
1352{
1353 bool static_branch = !strcmp(sym->sec->name, "__jump_table");
1354 bool static_call = !strcmp(sym->sec->name, ".static_call_sites");
1355 struct symbol *code_sym = NULL;
1356 unsigned long code_offset = 0;
1357 struct reloc *reloc;
1358 int ret = 0;
1359
1360 if (!static_branch && !static_call)
1361 return 0;
…lines 1362–1368 unchanged (7 lines)
1369
1370 /* Static branch/call keys are always STT_OBJECT */
1371 if (reloc->sym->type != STT_OBJECT) {
1372
1373 /* Save code location which can be printed below */
1374 if (reloc->sym->type == STT_FUNC && !code_sym) {
1375 code_sym = reloc->sym;
1376 code_offset = reloc_addend(reloc);
1377 }
1378
1379 continue;
1380 }
1381
…lines 1382–1390 unchanged (9 lines)
1391 return -1;
1392 }
1393
1394 /* vmlinux keys are ok */
1395 if (!strcmp(sym_modname, "vmlinux"))
1396 continue;
1397
1398 if (static_branch) {
1399 if (strstarts(reloc->sym->name, "__tracepoint_")) {
1400 WARN("%s: disabling unsupported tracepoint %s",
1401 code_sym->name, reloc->sym->name + 13);
1402 ret = 1;
1403 continue;
1404 }
1405
1406 if (strstr(reloc->sym->name, "__UNIQUE_ID_ddebug_")) {
1407 WARN("%s: disabling unsupported pr_debug()",
1408 code_sym->name);
1409 ret = 1;
1410 continue;
1411 }
1412
1413 ERROR("%s+0x%lx: unsupported static branch key %s. Use static_key_enabled() instead",
1414 code_sym->name, code_offset, reloc->sym->name);
1415 return -1;
1416 }
1417
1418 /* static call */
1419 if (strstarts(reloc->sym->name, "__SCK__tp_func_")) {
1420 ret = 1;
1421 continue;
1422 }
1423
1424 ERROR("%s()+0x%lx: unsupported static call key %s. Use KLP_STATIC_CALL() instead",
1425 code_sym->name, code_offset, reloc->sym->name);
1426 return -1;
1427 }
1428
1429 return ret;
1430}
1431
…lines 1432–1771 unchanged (340 lines)

After

…lines 1–1348 unchanged (1348 lines)
1349 * 0: success
1350 */
1351static int validate_special_section_klp_reloc(struct elfs *e, struct symbol *sym)
1352{
1353 bool static_branch = !strcmp(sym->sec->name, "__jump_table");
1354 bool static_call = !strcmp(sym->sec->name, ".static_call_sites");
1355 const char *code_sym = NULL;
1356 unsigned long code_offset = 0;
1357 struct reloc *reloc;
1358 int ret = 0;
1359
1360 if (!static_branch && !static_call)
1361 return 0;
…lines 1362–1368 unchanged (7 lines)
1369
1370 /* Static branch/call keys are always STT_OBJECT */
1371 if (reloc->sym->type != STT_OBJECT) {
1372
1373 /* Save code location which can be printed below */
1374 if (reloc->sym->type == STT_FUNC && !code_sym) {
1375 code_sym = reloc->sym->name;
1376 code_offset = reloc_addend(reloc);
1377 }
1378
1379 continue;
1380 }
1381
…lines 1382–1391 unchanged (10 lines)
1392 }
1393
1394 /* vmlinux keys are ok */
1395 if (!strcmp(sym_modname, "vmlinux"))
1396 continue;
1397
1398 if (!code_sym)
1399 code_sym = "<unknown>";
1400
1401 if (static_branch) {
1402 if (strstarts(reloc->sym->name, "__tracepoint_")) {
1403 WARN("%s: disabling unsupported tracepoint %s",
1404 code_sym, reloc->sym->name + 13);
1405 ret = 1;
1406 continue;
1407 }
1408
1409 if (strstr(reloc->sym->name, "__UNIQUE_ID_ddebug_")) {
1410 WARN("%s: disabling unsupported pr_debug()",
1411 code_sym);
1412 ret = 1;
1413 continue;
1414 }
1415
1416 ERROR("%s+0x%lx: unsupported static branch key %s. Use static_key_enabled() instead",
1417 code_sym, code_offset, reloc->sym->name);
1418 return -1;
1419 }
1420
1421 /* static call */
1422 if (strstarts(reloc->sym->name, "__SCK__tp_func_")) {
1423 ret = 1;
1424 continue;
1425 }
1426
1427 ERROR("%s()+0x%lx: unsupported static call key %s. Use KLP_STATIC_CALL() instead",
1428 code_sym, code_offset, reloc->sym->name);
1429 return -1;
1430 }
1431
1432 return ret;
1433}
1434
…lines 1435–1774 unchanged (340 lines)

Before

translation_unit
comment "// SPDX-License-Identifier: GPL-2.0-or-later"
preproc_def
#define "#define"
identifier "_GNU_SOURCE"
comment "/* memmem() */"
preproc_include
#include "#include"
system_lib_string "<subcmd/parse-options.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
system_lib_string "<libgen.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
system_lib_string "<ctype.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/objtool.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/warn.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/arch.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/klp.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/util.h>"
preproc_include
#include "#include"
system_lib_string "<arch/special.h>"
preproc_include
#include "#include"
system_lib_string "<linux/objtool_types.h>"
preproc_include
#include "#include"
system_lib_string "<linux/livepatch_external.h>"
preproc_include
#include "#include"
system_lib_string "<linux/stringify.h>"
preproc_include
#include "#include"
system_lib_string "<linux/string.h>"
preproc_include
#include "#include"
system_lib_string "<linux/jhash.h>"
preproc_function_def
#define "#define"
identifier "sizeof_field"
preproc_params
( "("
identifier "TYPE"
, ","
identifier "MEMBER"
) ")"
preproc_arg "sizeof((((TYPE *)0)->MEMBER))"
struct_specifier (+30 nodes collapsed)
; ";"
struct_specifier (+22 nodes collapsed)
; ";"
declaration (+28 nodes collapsed)
declaration (+58 nodes collapsed)
declaration
storage_class_specifier
static "static"
macro_type_specifier
identifier "DEFINE_HASHTABLE"
( "("
type_descriptor
type_identifier "exports"
ERROR
, ","
number_literal "15"
) ")"
identifier ""
; ";"
function_definition (+39 nodes collapsed)
function_definition (+319 nodes collapsed)
function_definition (+601 nodes collapsed)
function_definition (+353 nodes collapsed)
function_definition (+64 nodes collapsed)
function_definition (+64 nodes collapsed)
comment "/*\n * Certain static local variables should never be correla"...
function_definition (+194 nodes collapsed)
comment "/*\n * Clang emits several useless .Ltmp_* code labels.\n */"
function_definition (+71 nodes collapsed)
function_definition (+244 nodes collapsed)
comment "/*\n * These sections are referenced by special sections but "...
function_definition (+106 nodes collapsed)
comment "/*\n * These symbols should never be correlated, so their loc"...
function_definition (+117 nodes collapsed)
comment "/*\n * For each symbol in the original kernel, find its corre"...
function_definition (+738 nodes collapsed)
comment "/* \"sympos\" is used by livepatch to disambiguate duplicate s"...
function_definition (+390 nodes collapsed)
declaration (+25 nodes collapsed)
function_definition (+462 nodes collapsed)
function_definition (+100 nodes collapsed)
function_definition (+78 nodes collapsed)
comment "/*\n * Copy a symbol to the output object, optionally includi"...
function_definition (+187 nodes collapsed)
function_definition (+124 nodes collapsed)
comment "/*\n * Copy all changed functions (and their dependencies) fr"...
function_definition (+290 nodes collapsed)
function_definition (+80 nodes collapsed)
comment "/*\n * Determine whether a relocation should reference the se"...
function_definition (+105 nodes collapsed)
function_definition (+45 nodes collapsed)
function_definition (+86 nodes collapsed)
function_definition (+282 nodes collapsed)
comment "/* Get the object's module name as defined by the kernel (an"...
function_definition (+71 nodes collapsed)
comment "/*\n * Copying a function from its native compiled environmen"...
function_definition (+130 nodes collapsed)
function_definition (+136 nodes collapsed)
function_definition (+182 nodes collapsed)
comment "/*\n * Convert a relocation symbol reference to the needed fo"...
function_definition (+83 nodes collapsed)
comment "/*\n * Convert a regular relocation to a klp relocation (sort"...
function_definition (+759 nodes collapsed)
preproc_function_def
#define "#define"
identifier "dbg_clone_reloc"
preproc_params
( "("
identifier "sec"
, ","
identifier "offset"
, ","
identifier "patched_sym"
, ","
identifier "addend"
, ","
identifier "export"
, ","
identifier "klp"
) ")"
preproc_arg "dbg_indent(\"%s+0x%lx: %s%s0x%lx [%s%s%s%s%s%s]\",\t\t\t\t\\\n\t\t s"...
comment "/* Copy a reloc and its symbol to the output object */"
function_definition (+384 nodes collapsed)
comment "/* Copy all relocs needed for a symbol's contents */"
function_definition (+418 nodes collapsed)
function_definition (+178 nodes collapsed)
comment "/*\n * Special sections (alternatives, etc) are basically arr"...
function_definition (+500 nodes collapsed)
comment "/* Keep a special section entry if it references an included"...
function_definition (+123 nodes collapsed)
comment "/*\n * Klp relocations aren't allowed for __jump_table and .s"...
function_definition
storage_class_specifier
static "static"
primitive_type "int"
function_declarator
identifier "validate_special_section_klp_reloc"
parameter_list
( "("
parameter_declaration
struct_specifier
struct "struct"
type_identifier "elfs"
pointer_declarator
* "*"
identifier "e"
, ","
parameter_declaration
struct_specifier
struct "struct"
type_identifier "symbol"
pointer_declarator
* "*"
identifier "sym"
) ")"
compound_statement
{ "{"
declaration (+25 nodes collapsed)
declaration (+25 nodes collapsed)
declaration
struct_specifier
struct "struct"
type_identifier "symbol"
init_declarator
pointer_declarator
* "*"
identifier "code_sym"
= "="
null
NULL "NULL"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
init_declarator
identifier "code_offset"
= "="
number_literal "0"
; ";"
declaration
struct_specifier
struct "struct"
type_identifier "reloc"
pointer_declarator
* "*"
identifier "reloc"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "ret"
= "="
number_literal "0"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
unary_expression
! "!"
identifier "static_branch"
&& "&&"
unary_expression
! "!"
identifier "static_call"
) ")"
return_statement
return "return"
number_literal "0"
; ";"
expression_statement
call_expression
identifier "sym_for_each_reloc"
argument_list
( "("
field_expression
identifier "e"
-> "->"
field_identifier "patched"
, ","
identifier "sym"
, ","
identifier "reloc"
) ")"
; ""
compound_statement
{ "{"
declaration
type_qualifier
const "const"
primitive_type "char"
pointer_declarator
* "*"
identifier "sym_modname"
; ";"
declaration
struct_specifier
struct "struct"
type_identifier "export"
pointer_declarator
* "*"
identifier "export"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "convert_reloc_sym"
argument_list
( "("
field_expression
identifier "e"
-> "->"
field_identifier "patched"
, ","
identifier "reloc"
) ")"
) ")"
continue_statement
continue "continue"
; ";"
comment "/* Static branch/call keys are always STT_OBJECT */"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "type"
!= "!="
identifier "STT_OBJECT"
) ")"
compound_statement
{ "{"
comment "/* Save code location which can be printed below */"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "type"
== "=="
identifier "STT_FUNC"
&& "&&"
unary_expression
! "!"
identifier "code_sym"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "code_sym"
= "="
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
; ";"
expression_statement
assignment_expression
identifier "code_offset"
= "="
call_expression
identifier "reloc_addend"
argument_list
( "("
identifier "reloc"
) ")"
; ";"
} "}"
continue_statement
continue "continue"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
call_expression
identifier "klp_reloc_needed"
argument_list
( "("
identifier "reloc"
) ")"
) ")"
continue_statement
continue "continue"
; ";"
expression_statement
assignment_expression
identifier "export"
= "="
call_expression
identifier "find_export"
argument_list
( "("
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
) ")"
; ";"
if_statement (+46 nodes collapsed)
comment "/* vmlinux keys are ok */"
if_statement (+21 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
identifier "static_branch"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "strstarts"
argument_list
( "("
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
, ","
string_literal
" "\""
string_content "__tracepoint_"
" "\""
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "WARN"
argument_list
( "("
string_literal
" "\""
string_content "%s: disabling unsupported tracepoint %s"
" "\""
, ","
field_expression
identifier "code_sym"
-> "->"
field_identifier "name"
, ","
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
+ "+"
number_literal "13"
) ")"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
number_literal "1"
; ";"
continue_statement
continue "continue"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "strstr"
argument_list
( "("
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
, ","
string_literal
" "\""
string_content "__UNIQUE_ID_ddebug_"
" "\""
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "WARN"
argument_list
( "("
string_literal
" "\""
string_content "%s: disabling unsupported pr_debug()"
" "\""
, ","
field_expression
identifier "code_sym"
-> "->"
field_identifier "name"
) ")"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
number_literal "1"
; ";"
continue_statement
continue "continue"
; ";"
} "}"
expression_statement
call_expression
identifier "ERROR"
argument_list
( "("
string_literal
" "\""
string_content "%s+0x%lx: unsupported static branch key %s. Use static_key_"...
" "\""
, ","
field_expression
identifier "code_sym"
-> "->"
field_identifier "name"
, ","
identifier "code_offset"
, ","
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
) ")"
; ";"
return_statement
return "return"
number_literal "-1"
; ";"
} "}"
comment "/* static call */"
if_statement (+34 nodes collapsed)
expression_statement
call_expression
identifier "ERROR"
argument_list
( "("
string_literal
" "\""
string_content "%s()+0x%lx: unsupported static call key %s. Use KLP_STATIC_"...
" "\""
, ","
field_expression
identifier "code_sym"
-> "->"
field_identifier "name"
, ","
identifier "code_offset"
, ","
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
) ")"
; ";"
return_statement
return "return"
number_literal "-1"
; ";"
} "}"
return_statement
return "return"
identifier "ret"
; ";"
} "}"
function_definition (+153 nodes collapsed)
comment "/* Extract only the needed bits from special sections */"
function_definition (+78 nodes collapsed)
comment "/*\n * Create .init.klp_objects and .init.klp_funcs sections "...
function_definition (+1472 nodes collapsed)
comment "/*\n * Copy all .modinfo import_ns= tags to ensure all namesp"...
function_definition (+316 nodes collapsed)
function_definition (+400 nodes collapsed)

After

translation_unit
comment "// SPDX-License-Identifier: GPL-2.0-or-later"
preproc_def
#define "#define"
identifier "_GNU_SOURCE"
comment "/* memmem() */"
preproc_include
#include "#include"
system_lib_string "<subcmd/parse-options.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
system_lib_string "<libgen.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
system_lib_string "<ctype.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/objtool.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/warn.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/arch.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/klp.h>"
preproc_include
#include "#include"
system_lib_string "<objtool/util.h>"
preproc_include
#include "#include"
system_lib_string "<arch/special.h>"
preproc_include
#include "#include"
system_lib_string "<linux/objtool_types.h>"
preproc_include
#include "#include"
system_lib_string "<linux/livepatch_external.h>"
preproc_include
#include "#include"
system_lib_string "<linux/stringify.h>"
preproc_include
#include "#include"
system_lib_string "<linux/string.h>"
preproc_include
#include "#include"
system_lib_string "<linux/jhash.h>"
preproc_function_def
#define "#define"
identifier "sizeof_field"
preproc_params
( "("
identifier "TYPE"
, ","
identifier "MEMBER"
) ")"
preproc_arg "sizeof((((TYPE *)0)->MEMBER))"
struct_specifier (+30 nodes collapsed)
; ";"
struct_specifier (+22 nodes collapsed)
; ";"
declaration (+28 nodes collapsed)
declaration (+58 nodes collapsed)
declaration
storage_class_specifier
static "static"
macro_type_specifier
identifier "DEFINE_HASHTABLE"
( "("
type_descriptor
type_identifier "exports"
ERROR
, ","
number_literal "15"
) ")"
identifier ""
; ";"
function_definition (+39 nodes collapsed)
function_definition (+319 nodes collapsed)
function_definition (+601 nodes collapsed)
function_definition (+353 nodes collapsed)
function_definition (+64 nodes collapsed)
function_definition (+64 nodes collapsed)
comment "/*\n * Certain static local variables should never be correla"...
function_definition (+194 nodes collapsed)
comment "/*\n * Clang emits several useless .Ltmp_* code labels.\n */"
function_definition (+71 nodes collapsed)
function_definition (+244 nodes collapsed)
comment "/*\n * These sections are referenced by special sections but "...
function_definition (+106 nodes collapsed)
comment "/*\n * These symbols should never be correlated, so their loc"...
function_definition (+117 nodes collapsed)
comment "/*\n * For each symbol in the original kernel, find its corre"...
function_definition (+738 nodes collapsed)
comment "/* \"sympos\" is used by livepatch to disambiguate duplicate s"...
function_definition (+390 nodes collapsed)
declaration (+25 nodes collapsed)
function_definition (+462 nodes collapsed)
function_definition (+100 nodes collapsed)
function_definition (+78 nodes collapsed)
comment "/*\n * Copy a symbol to the output object, optionally includi"...
function_definition (+187 nodes collapsed)
function_definition (+124 nodes collapsed)
comment "/*\n * Copy all changed functions (and their dependencies) fr"...
function_definition (+290 nodes collapsed)
function_definition (+80 nodes collapsed)
comment "/*\n * Determine whether a relocation should reference the se"...
function_definition (+105 nodes collapsed)
function_definition (+45 nodes collapsed)
function_definition (+86 nodes collapsed)
function_definition (+282 nodes collapsed)
comment "/* Get the object's module name as defined by the kernel (an"...
function_definition (+71 nodes collapsed)
comment "/*\n * Copying a function from its native compiled environmen"...
function_definition (+130 nodes collapsed)
function_definition (+136 nodes collapsed)
function_definition (+182 nodes collapsed)
comment "/*\n * Convert a relocation symbol reference to the needed fo"...
function_definition (+83 nodes collapsed)
comment "/*\n * Convert a regular relocation to a klp relocation (sort"...
function_definition (+759 nodes collapsed)
preproc_function_def
#define "#define"
identifier "dbg_clone_reloc"
preproc_params
( "("
identifier "sec"
, ","
identifier "offset"
, ","
identifier "patched_sym"
, ","
identifier "addend"
, ","
identifier "export"
, ","
identifier "klp"
) ")"
preproc_arg "dbg_indent(\"%s+0x%lx: %s%s0x%lx [%s%s%s%s%s%s]\",\t\t\t\t\\\n\t\t s"...
comment "/* Copy a reloc and its symbol to the output object */"
function_definition (+384 nodes collapsed)
comment "/* Copy all relocs needed for a symbol's contents */"
function_definition (+418 nodes collapsed)
function_definition (+178 nodes collapsed)
comment "/*\n * Special sections (alternatives, etc) are basically arr"...
function_definition (+500 nodes collapsed)
comment "/* Keep a special section entry if it references an included"...
function_definition (+123 nodes collapsed)
comment "/*\n * Klp relocations aren't allowed for __jump_table and .s"...
function_definition
storage_class_specifier
static "static"
primitive_type "int"
function_declarator
identifier "validate_special_section_klp_reloc"
parameter_list
( "("
parameter_declaration
struct_specifier
struct "struct"
type_identifier "elfs"
pointer_declarator
* "*"
identifier "e"
, ","
parameter_declaration
struct_specifier
struct "struct"
type_identifier "symbol"
pointer_declarator
* "*"
identifier "sym"
) ")"
compound_statement
{ "{"
declaration (+25 nodes collapsed)
declaration (+25 nodes collapsed)
declaration
type_qualifier
const "const"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "code_sym"
= "="
null
NULL "NULL"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
init_declarator
identifier "code_offset"
= "="
number_literal "0"
; ";"
declaration
struct_specifier
struct "struct"
type_identifier "reloc"
pointer_declarator
* "*"
identifier "reloc"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "ret"
= "="
number_literal "0"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
unary_expression
! "!"
identifier "static_branch"
&& "&&"
unary_expression
! "!"
identifier "static_call"
) ")"
return_statement
return "return"
number_literal "0"
; ";"
expression_statement
call_expression
identifier "sym_for_each_reloc"
argument_list
( "("
field_expression
identifier "e"
-> "->"
field_identifier "patched"
, ","
identifier "sym"
, ","
identifier "reloc"
) ")"
; ""
compound_statement
{ "{"
declaration
type_qualifier
const "const"
primitive_type "char"
pointer_declarator
* "*"
identifier "sym_modname"
; ";"
declaration
struct_specifier
struct "struct"
type_identifier "export"
pointer_declarator
* "*"
identifier "export"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "convert_reloc_sym"
argument_list
( "("
field_expression
identifier "e"
-> "->"
field_identifier "patched"
, ","
identifier "reloc"
) ")"
) ")"
continue_statement
continue "continue"
; ";"
comment "/* Static branch/call keys are always STT_OBJECT */"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "type"
!= "!="
identifier "STT_OBJECT"
) ")"
compound_statement
{ "{"
comment "/* Save code location which can be printed below */"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "type"
== "=="
identifier "STT_FUNC"
&& "&&"
unary_expression
! "!"
identifier "code_sym"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "code_sym"
= "="
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
; ";"
expression_statement
assignment_expression
identifier "code_offset"
= "="
call_expression
identifier "reloc_addend"
argument_list
( "("
identifier "reloc"
) ")"
; ";"
} "}"
continue_statement
continue "continue"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
call_expression
identifier "klp_reloc_needed"
argument_list
( "("
identifier "reloc"
) ")"
) ")"
continue_statement
continue "continue"
; ";"
expression_statement
assignment_expression
identifier "export"
= "="
call_expression
identifier "find_export"
argument_list
( "("
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
) ")"
; ";"
if_statement (+46 nodes collapsed)
comment "/* vmlinux keys are ok */"
if_statement (+21 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
identifier "code_sym"
) ")"
expression_statement
assignment_expression
identifier "code_sym"
= "="
string_literal
" "\""
string_content "<unknown>"
" "\""
; ";"
if_statement
if "if"
parenthesized_expression
( "("
identifier "static_branch"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "strstarts"
argument_list
( "("
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
, ","
string_literal
" "\""
string_content "__tracepoint_"
" "\""
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "WARN"
argument_list
( "("
string_literal
" "\""
string_content "%s: disabling unsupported tracepoint %s"
" "\""
, ","
identifier "code_sym"
, ","
binary_expression
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
+ "+"
number_literal "13"
) ")"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
number_literal "1"
; ";"
continue_statement
continue "continue"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "strstr"
argument_list
( "("
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
, ","
string_literal
" "\""
string_content "__UNIQUE_ID_ddebug_"
" "\""
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "WARN"
argument_list
( "("
string_literal
" "\""
string_content "%s: disabling unsupported pr_debug()"
" "\""
, ","
identifier "code_sym"
) ")"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
number_literal "1"
; ";"
continue_statement
continue "continue"
; ";"
} "}"
expression_statement
call_expression
identifier "ERROR"
argument_list
( "("
string_literal
" "\""
string_content "%s+0x%lx: unsupported static branch key %s. Use static_key_"...
" "\""
, ","
identifier "code_sym"
, ","
identifier "code_offset"
, ","
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
) ")"
; ";"
return_statement
return "return"
number_literal "-1"
; ";"
} "}"
comment "/* static call */"
if_statement (+34 nodes collapsed)
expression_statement
call_expression
identifier "ERROR"
argument_list
( "("
string_literal
" "\""
string_content "%s()+0x%lx: unsupported static call key %s. Use KLP_STATIC_"...
" "\""
, ","
identifier "code_sym"
, ","
identifier "code_offset"
, ","
field_expression
field_expression
identifier "reloc"
-> "->"
field_identifier "sym"
-> "->"
field_identifier "name"
) ")"
; ";"
return_statement
return "return"
number_literal "-1"
; ";"
} "}"
return_statement
return "return"
identifier "ret"
; ";"
} "}"
function_definition (+153 nodes collapsed)
comment "/* Extract only the needed bits from special sections */"
function_definition (+78 nodes collapsed)
comment "/*\n * Create .init.klp_objects and .init.klp_funcs sections "...
function_definition (+1472 nodes collapsed)
comment "/*\n * Copy all .modinfo import_ns= tags to ensure all namesp"...
function_definition (+316 nodes collapsed)
function_definition (+400 nodes collapsed)