nolibc-test-linkage.c 422 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include "nolibc-test-linkage.h"
  3. #include <errno.h>
  4. void *linkage_test_errno_addr(void)
  5. {
  6. return &errno;
  7. }
  8. int linkage_test_constructor_test_value = 0;
  9. __attribute__((constructor))
  10. static void constructor1(void)
  11. {
  12. linkage_test_constructor_test_value |= 1 << 0;
  13. }
  14. __attribute__((constructor))
  15. static void constructor2(void)
  16. {
  17. linkage_test_constructor_test_value |= 1 << 1;
  18. }