Browse Source

configurator: HAVE_SECTION_START_STOP

Rusty Russell 14 years ago
parent
commit
6a8d296f93
2 changed files with 8 additions and 0 deletions
  1. 1 0
      config.h
  2. 7 0
      tools/configurator/configurator.c

+ 1 - 0
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_SECTION_START_STOP 1
 #define HAVE_STACK_GROWS_UPWARDS 0
 #define HAVE_STATEMENT_EXPR 1
 #define HAVE_TYPEOF 1

+ 7 - 0
tools/configurator/configurator.c

@@ -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" },
+	{ "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"