1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 3 #include "nolibc-test-linkage.h" 3 #include "nolibc-test-linkage.h" 4 4 5 #ifndef NOLIBC 5 #ifndef NOLIBC 6 #include <errno.h> 6 #include <errno.h> 7 #endif 7 #endif 8 8 9 void *linkage_test_errno_addr(void) 9 void *linkage_test_errno_addr(void) 10 { 10 { 11 return &errno; 11 return &errno; 12 } 12 } 13 13 14 int linkage_test_constructor_test_value; 14 int linkage_test_constructor_test_value; 15 15 16 __attribute__((constructor)) 16 __attribute__((constructor)) 17 static void constructor1(void) 17 static void constructor1(void) 18 { 18 { 19 linkage_test_constructor_test_value = 19 linkage_test_constructor_test_value = 2; 20 } 20 } 21 21 22 __attribute__((constructor)) 22 __attribute__((constructor)) 23 static void constructor2(void) 23 static void constructor2(void) 24 { 24 { 25 linkage_test_constructor_test_value *= 25 linkage_test_constructor_test_value *= 3; 26 } 26 } 27 27
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.