diff --git a/app/app.c b/app/app.c index 7065c139..789f3d48 100644 --- a/app/app.c +++ b/app/app.c @@ -9,8 +9,8 @@ #include #include -extern const struct app_descriptor __apps_start; -extern const struct app_descriptor __apps_end; +extern const struct app_descriptor __start_apps __WEAK; +extern const struct app_descriptor __stop_apps __WEAK; static void start_app(const struct app_descriptor *app); @@ -19,13 +19,13 @@ void apps_init(void) { const struct app_descriptor *app; /* call all the init routines */ - for (app = &__apps_start; app != &__apps_end; app++) { + for (app = &__start_apps; app != &__stop_apps; app++) { if (app->init) app->init(app); } /* start any that want to start on boot */ - for (app = &__apps_start; app != &__apps_end; app++) { + for (app = &__start_apps; app != &__stop_apps; app++) { if (app->entry && (app->flags & APP_FLAG_DONT_START_ON_BOOT) == 0) { start_app(app); } diff --git a/app/app.ld b/app/app.ld deleted file mode 100644 index 9f8b32df..00000000 --- a/app/app.ld +++ /dev/null @@ -1,8 +0,0 @@ -SECTIONS { - .apps : { - __apps_start = .; - KEEP (*(.apps)) - __apps_end = .; - } -} -INSERT AFTER .rodata; diff --git a/app/include/app.h b/app/include/app.h index 8effc3d2..ded9cb0b 100644 --- a/app/include/app.h +++ b/app/include/app.h @@ -33,7 +33,7 @@ struct app_descriptor { size_t stack_size; }; -#define APP_START(appname) const struct app_descriptor _app_##appname __ALIGNED(sizeof(void *)) __SECTION(".apps") = { .name = #appname, +#define APP_START(appname) const struct app_descriptor _app_##appname __ALIGNED(sizeof(void *)) __SECTION("apps") = { .name = #appname, #define APP_END }; diff --git a/app/rules.mk b/app/rules.mk index 8e24edfd..7de33dd5 100644 --- a/app/rules.mk +++ b/app/rules.mk @@ -5,6 +5,4 @@ MODULE := $(LOCAL_DIR) MODULE_SRCS += \ $(LOCAL_DIR)/app.c -EXTRA_LINKER_SCRIPTS += $(LOCAL_DIR)/app.ld - include make/module.mk