1/* SPDX-License-Identifier: GPL-2.0 */
2
3#include "nolibc-test-linkage.h"
4
5#ifndef NOLIBC
6#include <errno.h>
7#endif
8
9void *linkage_test_errno_addr(void)
10{
11 return &errno;
12}
13
14int linkage_test_constructor_test_value;
15
16__attribute__((constructor))
17static void constructor1(void)
18{
19 linkage_test_constructor_test_value = 2;
20}
21
22__attribute__((constructor))
23static void constructor2(void)
24{
25 linkage_test_constructor_test_value *= 3;
26}
27

source code of linux/tools/testing/selftests/nolibc/nolibc-test-linkage.c