https://t.me/RX1948
Server : nginx/1.24.0
System : Linux ip-172-31-33-48 6.14.0-1011-aws #11~24.04.1-Ubuntu SMP Fri Aug 1 02:07:25 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
Directory :  /usr/src/linux-headers-6.14.0-1012-aws/scripts/gendwarfksyms/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/src/linux-headers-6.14.0-1012-aws/scripts/gendwarfksyms/examples/symbolptr.c
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2024 Google LLC
 *
 * Example for symbol pointers. When compiled with Clang, gendwarfkyms
 * uses a symbol pointer for `f`.
 *
 * $ clang -g -c examples/symbolptr.c -o examples/symbolptr.o
 * $ echo -e "f\ng\np" | ./gendwarfksyms -d examples/symbolptr.o
 */

/* Kernel macros for userspace testing. */
#ifndef __used
#define __used __attribute__((__used__))
#endif
#ifndef __section
#define __section(section) __attribute__((__section__(section)))
#endif

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

extern void f(unsigned int arg);
void g(int *arg);
void g(int *arg) {}

struct s;
extern struct s *p;

__GENDWARFKSYMS_EXPORT(f);
__GENDWARFKSYMS_EXPORT(g);
__GENDWARFKSYMS_EXPORT(p);

https://t.me/RX1948 - 2025