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