diff --git a/soc/xtensa/esp32/linker.ld b/soc/xtensa/esp32/linker.ld index 4f09b154d8a..bdfde4903f1 100644 --- a/soc/xtensa/esp32/linker.ld +++ b/soc/xtensa/esp32/linker.ld @@ -181,12 +181,9 @@ SECTIONS KEEP(*(SORT_BY_NAME("._net_buf_pool.static.*"))) #if defined(CONFIG_NETWORKING) - . = ALIGN(4); - Z_LINK_ITERABLE(net_if); - . = ALIGN(4); - Z_LINK_ITERABLE(net_if_dev); - . = ALIGN(4); - Z_LINK_ITERABLE(net_l2); + Z_LINK_ITERABLE_ALIGNED(net_if, 4); + Z_LINK_ITERABLE_ALIGNED(net_if_dev, 4); + Z_LINK_ITERABLE_ALIGNED(net_l2, 4); #endif } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) @@ -266,6 +263,58 @@ _net_buf_pool_list = _esp_net_buf_pool_list; { _rodata_start = ABSOLUTE(.); +#ifdef CONFIG_USERSPACE + Z_LINK_ITERABLE_ALIGNED(z_object_assignment, 4); +#endif + +#if defined(CONFIG_NET_SOCKETS) + Z_LINK_ITERABLE_ALIGNED(net_socket_register, 4); +#endif + +#if defined(CONFIG_NET_L2_PPP) + Z_LINK_ITERABLE_ALIGNED(ppp_protocol_handler, 4); +#endif + + Z_LINK_ITERABLE_ALIGNED(bt_l2cap_fixed_chan, 4); + +#if defined(CONFIG_BT_BREDR) + Z_LINK_ITERABLE_ALIGNED(bt_l2cap_br_fixed_chan, 4); +#endif + + Z_LINK_ITERABLE_ALIGNED(bt_gatt_service_static, 4); + +#if defined(CONFIG_BT_MESH) + Z_LINK_ITERABLE_ALIGNED(bt_mesh_subnet_cb, 4); + Z_LINK_ITERABLE_ALIGNED(bt_mesh_app_key_cb, 4); + Z_LINK_ITERABLE_ALIGNED(bt_mesh_hb_cb, 4); +#endif + +#if defined(CONFIG_BT_MESH_FRIEND) + Z_LINK_ITERABLE_ALIGNED(bt_mesh_friend_cb, 4); +#endif + +#if defined(CONFIG_BT_MESH_LOW_POWER) + Z_LINK_ITERABLE_ALIGNED(bt_mesh_lpn_cb, 4); +#endif + +#if defined(CONFIG_BT_MESH_PROXY) + Z_LINK_ITERABLE_ALIGNED(bt_mesh_proxy_cb, 4); +#endif + +#if defined(CONFIG_EC_HOST_CMD) + Z_LINK_ITERABLE_ALIGNED(ec_host_cmd_handler, 4); +#endif + +#if defined(CONFIG_SETTINGS) + Z_LINK_ITERABLE_ALIGNED(settings_handler_static, 4); +#endif + + Z_LINK_ITERABLE_ALIGNED(k_p4wq_initparam, 4); + + Z_LINK_ITERABLE_ALIGNED(shell, 4); + + Z_LINK_ITERABLE_ALIGNED(tracing_backend, 4) + __esp_shell_root_cmds_start = .; KEEP(*(SORT(.shell_root_cmd_*))); __esp_shell_root_cmds_end = .; @@ -302,7 +351,10 @@ _net_buf_pool_list = _esp_net_buf_pool_list; _rodata_end = ABSOLUTE(.); } GROUP_LINK_IN(ROMABLE_REGION) +#pragma push_macro("Z_ITERABLE_SECTION_ROM") #pragma push_macro("ROMABLE_REGION") +#undef Z_ITERABLE_SECTION_ROM +#define Z_ITERABLE_SECTION_ROM(x,y) #undef ROMABLE_REGION /* This is to workaround limitation of `esptool` which needs single `FLASH` data segment * which is already defined above. In case, `common-rom.ld` creates additional segments @@ -317,6 +369,7 @@ __log_backends_end = __esp_log_backends_end; __shell_root_cmds_start = __esp_shell_root_cmds_start; __shell_root_cmds_end = __esp_shell_root_cmds_end; #pragma pop_macro("ROMABLE_REGION") +#pragma pop_macro("Z_ITERABLE_SECTION_ROM") SECTION_PROLOGUE(_TEXT_SECTION_NAME, , ALIGN(4)) {