History log of /linux-6.15/scripts/gendwarfksyms/examples/symbolptr.c (Results 1 – 1 of 1)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6
# fa624569 03-Jan-2025 Sami Tolvanen <[email protected]>

gendwarfksyms: Add support for symbol type pointers

The compiler may choose not to emit type information in DWARF for
external symbols. Clang, for example, does this for symbols not
defined in the c

gendwarfksyms: Add support for symbol type pointers

The compiler may choose not to emit type information in DWARF for
external symbols. Clang, for example, does this for symbols not
defined in the current TU.

To provide a way to work around this issue, add support for
__gendwarfksyms_ptr_<symbol> pointers that force the compiler to emit
the necessary type information in DWARF also for the missing symbols.

Example usage:

#define GENDWARFKSYMS_PTR(sym) \
static typeof(sym) *__gendwarfksyms_ptr_##sym __used \
__section(".discard.gendwarfksyms") = &sym;

extern int external_symbol(void);
GENDWARFKSYMS_PTR(external_symbol);

Signed-off-by: Sami Tolvanen <[email protected]>
Reviewed-by: Petr Pavlu <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>

show more ...