linker: esp32: Add missing iterable sections

This fixes missing PPP iterable and adds all
common-rom.ld iterables.

ESP32 and esptool does not support more then 16 segments, which
blocks including common iterables section as is.

This partially reverts commit ad0bf94f77

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit is contained in:
Sylvio Alves 2021-06-01 12:13:34 -03:00 committed by Anas Nashif
commit 59d07b0247

View file

@ -181,12 +181,9 @@ SECTIONS
KEEP(*(SORT_BY_NAME("._net_buf_pool.static.*"))) KEEP(*(SORT_BY_NAME("._net_buf_pool.static.*")))
#if defined(CONFIG_NETWORKING) #if defined(CONFIG_NETWORKING)
. = ALIGN(4); Z_LINK_ITERABLE_ALIGNED(net_if, 4);
Z_LINK_ITERABLE(net_if); Z_LINK_ITERABLE_ALIGNED(net_if_dev, 4);
. = ALIGN(4); Z_LINK_ITERABLE_ALIGNED(net_l2, 4);
Z_LINK_ITERABLE(net_if_dev);
. = ALIGN(4);
Z_LINK_ITERABLE(net_l2);
#endif #endif
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
@ -266,6 +263,58 @@ _net_buf_pool_list = _esp_net_buf_pool_list;
{ {
_rodata_start = ABSOLUTE(.); _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 = .; __esp_shell_root_cmds_start = .;
KEEP(*(SORT(.shell_root_cmd_*))); KEEP(*(SORT(.shell_root_cmd_*)));
__esp_shell_root_cmds_end = .; __esp_shell_root_cmds_end = .;
@ -302,7 +351,10 @@ _net_buf_pool_list = _esp_net_buf_pool_list;
_rodata_end = ABSOLUTE(.); _rodata_end = ABSOLUTE(.);
} GROUP_LINK_IN(ROMABLE_REGION) } GROUP_LINK_IN(ROMABLE_REGION)
#pragma push_macro("Z_ITERABLE_SECTION_ROM")
#pragma push_macro("ROMABLE_REGION") #pragma push_macro("ROMABLE_REGION")
#undef Z_ITERABLE_SECTION_ROM
#define Z_ITERABLE_SECTION_ROM(x,y)
#undef ROMABLE_REGION #undef ROMABLE_REGION
/* This is to workaround limitation of `esptool` which needs single `FLASH` data segment /* 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 * 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_start = __esp_shell_root_cmds_start;
__shell_root_cmds_end = __esp_shell_root_cmds_end; __shell_root_cmds_end = __esp_shell_root_cmds_end;
#pragma pop_macro("ROMABLE_REGION") #pragma pop_macro("ROMABLE_REGION")
#pragma pop_macro("Z_ITERABLE_SECTION_ROM")
SECTION_PROLOGUE(_TEXT_SECTION_NAME, , ALIGN(4)) SECTION_PROLOGUE(_TEXT_SECTION_NAME, , ALIGN(4))
{ {