xref: /linux/tools/testing/selftests/nolibc/nolibc-test-linkage.c (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #include "nolibc-test-linkage.h"
4 
5 #include <errno.h>
6 
linkage_test_errno_addr(void)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))
constructor1(void)15 static void constructor1(void)
16 {
17 	linkage_test_constructor_test_value |= 1 << 0;
18 }
19 
20 __attribute__((constructor))
constructor2(void)21 static void constructor2(void)
22 {
23 	linkage_test_constructor_test_value |= 1 << 1;
24 }
25