]> git.ozlabs.org Git - ccan/commitdiff
configurator: HAVE_SECTION_START_STOP
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 5 Dec 2011 12:17:46 +0000 (22:47 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 5 Dec 2011 12:17:46 +0000 (22:47 +1030)
config.h
tools/configurator/configurator.c

index 03b8c5bb870ea9bc51ce877ac07da1f10e471cf4..5d2031ed44320b0a136b08867d71c4a9198bb042 100644 (file)
--- a/config.h
+++ b/config.h
@@ -42,6 +42,7 @@
 #define HAVE_MMAP 1
 #define HAVE_PROC_SELF_MAPS 1
 #define HAVE_QSORT_R_PRIVATE_LAST 1
 #define HAVE_MMAP 1
 #define HAVE_PROC_SELF_MAPS 1
 #define HAVE_QSORT_R_PRIVATE_LAST 1
+#define HAVE_SECTION_START_STOP 1
 #define HAVE_STACK_GROWS_UPWARDS 0
 #define HAVE_STATEMENT_EXPR 1
 #define HAVE_TYPEOF 1
 #define HAVE_STACK_GROWS_UPWARDS 0
 #define HAVE_STATEMENT_EXPR 1
 #define HAVE_TYPEOF 1
index 8353f08899aede35f7c947e6724e80fa4e1ab482..802559de979ffadafa5b24d4adeac3b8fd9b9f16 100644 (file)
@@ -181,6 +181,13 @@ static struct test tests[] = {
          " qsort_r(array, 3, sizeof(int), cmp, &called);\n"
          " return called && array[0] == 2 && array[1] == 5 && array[2] == 9 ? 0 : 1;\n"
          "}\n" },
          " qsort_r(array, 3, sizeof(int), cmp, &called);\n"
          " return called && array[0] == 2 && array[1] == 5 && array[2] == 9 ? 0 : 1;\n"
          "}\n" },
+       { "HAVE_SECTION_START_STOP",
+         DEFINES_FUNC, NULL,
+         "static void *__attribute__((__section__(\"mysec\"))) p = &p;\n"
+         "static int func(void) {\n"
+         "     extern void *__start_mysec[], *__stop_mysec[];\n"
+         "     return __stop_mysec - __start_mysec;\n"
+         "}\n" },
        { "HAVE_STACK_GROWS_UPWARDS", DEFINES_EVERYTHING|EXECUTE, NULL,
          "static long nest(const void *base, unsigned int i)\n"
          "{\n"
        { "HAVE_STACK_GROWS_UPWARDS", DEFINES_EVERYTHING|EXECUTE, NULL,
          "static long nest(const void *base, unsigned int i)\n"
          "{\n"