diff --git a/app/app.ld b/app/app.ld index 1e50ca92..6907bbb1 100644 --- a/app/app.ld +++ b/app/app.ld @@ -1,8 +1,8 @@ SECTIONS { - .apps ALIGN(8) : { + .apps : ALIGN(8) { __apps_start = .; KEEP (*(.apps)) __apps_end = .; } } -INSERT AFTER .data; +INSERT AFTER .rodata; diff --git a/dev/devices.ld b/dev/devices.ld index 4222d543..115c9fe1 100644 --- a/dev/devices.ld +++ b/dev/devices.ld @@ -1,5 +1,5 @@ SECTIONS { - .devices ALIGN(8) : { + .devices : ALIGN(8) { __devices = .; KEEP (*(.devices)) __devices_end = .; diff --git a/dev/drivers.ld b/dev/drivers.ld index 62b7fffc..e354cf44 100644 --- a/dev/drivers.ld +++ b/dev/drivers.ld @@ -1,5 +1,5 @@ SECTIONS { - .drivers : { + .drivers : ALIGN(8) { __drivers = .; KEEP (*(.drivers)) __drivers_end = .; diff --git a/include/app.h b/include/app.h index 8fe43229..b98f924e 100644 --- a/include/app.h +++ b/include/app.h @@ -49,11 +49,7 @@ struct app_descriptor { size_t stack_size; }; -#ifdef ARCH_X86_64 -#define APP_START(appname) struct app_descriptor _app_##appname __ALIGNED(8) __SECTION(".apps") = { .name = #appname, -#else -#define APP_START(appname) struct app_descriptor _app_##appname __SECTION(".apps") = { .name = #appname, -#endif +#define APP_START(appname) const struct app_descriptor _app_##appname __SECTION(".apps") = { .name = #appname, #define APP_END }; diff --git a/include/lib/console.h b/include/lib/console.h index f270b3fe..4f928138 100644 --- a/include/lib/console.h +++ b/include/lib/console.h @@ -67,19 +67,11 @@ typedef struct _cmd_block { #define STATIC_COMMAND_START static const cmd _cmd_list[] = { -#ifdef ARCH_X86_64 -#define STATIC_COMMAND_END(name) }; const cmd_block _cmd_block_##name __ALIGNED(8) __SECTION(".commands")= { NULL, sizeof(_cmd_list) / sizeof(_cmd_list[0]), _cmd_list } -#else #define STATIC_COMMAND_END(name) }; const cmd_block _cmd_block_##name __SECTION(".commands")= { NULL, sizeof(_cmd_list) / sizeof(_cmd_list[0]), _cmd_list } -#endif #define STATIC_COMMAND_START_NAMED(name) static const cmd _cmd_list_##name[] = { -#ifdef ARCH_X86_64 -#define STATIC_COMMAND_END_NAMED(name) }; const cmd_block _cmd_block_##name __ALIGNED(8) __SECTION(".commands")= { NULL, sizeof(_cmd_list_##name) / sizeof(_cmd_list_##name[0]), _cmd_list_##name } -#else #define STATIC_COMMAND_END_NAMED(name) }; const cmd_block _cmd_block_##name __SECTION(".commands")= { NULL, sizeof(_cmd_list_##name) / sizeof(_cmd_list_##name[0]), _cmd_list_##name } -#endif #define STATIC_COMMAND(command_str, help_str, func) { command_str, help_str, func, CMD_AVAIL_NORMAL }, #define STATIC_COMMAND_MASKED(command_str, help_str, func, availability_mask) { command_str, help_str, func, availability_mask }, diff --git a/include/lk/init.h b/include/lk/init.h index 3219fdca..803a6b82 100644 --- a/include/lk/init.h +++ b/include/lk/init.h @@ -74,15 +74,6 @@ struct lk_init_struct { const char *name; }; -#ifdef ARCH_X86_64 -#define LK_INIT_HOOK_FLAGS(_name, _hook, _level, _flags) \ - const struct lk_init_struct _init_struct_##_name __ALIGNED(8) __SECTION(".lk_init") = { \ - .level = _level, \ - .flags = _flags, \ - .hook = _hook, \ - .name = #_name, \ - }; -#else #define LK_INIT_HOOK_FLAGS(_name, _hook, _level, _flags) \ const struct lk_init_struct _init_struct_##_name __SECTION(".lk_init") = { \ .level = _level, \ @@ -90,7 +81,6 @@ struct lk_init_struct { .hook = _hook, \ .name = #_name, \ }; -#endif #define LK_INIT_HOOK(_name, _hook, _level) \ LK_INIT_HOOK_FLAGS(_name, _hook, _level, LK_INIT_FLAG_PRIMARY_CPU) diff --git a/lib/console/console.ld b/lib/console/console.ld index 3735d653..197f1dc3 100644 --- a/lib/console/console.ld +++ b/lib/console/console.ld @@ -1,5 +1,5 @@ SECTIONS { - .commands ALIGN(8) : { + .commands : ALIGN(8) { __commands_start = .; KEEP (*(.commands)) __commands_end = .; diff --git a/top/init.ld b/top/init.ld index 2c5de5c2..e1f5bed4 100644 --- a/top/init.ld +++ b/top/init.ld @@ -1,6 +1,5 @@ SECTIONS { - .init ALIGN(8) : { - . = ALIGN(8); + .lk_init : ALIGN(8) { __lk_init = .; KEEP (*(.lk_init)) __lk_init_end = .;