diff --git a/include/linker/common-ram.ld b/include/linker/common-ram.ld index e8754cf851c..9fb4292a21b 100644 --- a/include/linker/common-ram.ld +++ b/include/linker/common-ram.ld @@ -22,21 +22,6 @@ } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) #endif - SECTION_DATA_PROLOGUE(devices,,) - { - /* link in devices objects, which are tied to the init ones; - * the objects are thus sorted the same way as their init - * object parent see include/device.h - */ - __device_start = .; - CREATE_OBJ_LEVEL(device, PRE_KERNEL_1) - CREATE_OBJ_LEVEL(device, PRE_KERNEL_2) - CREATE_OBJ_LEVEL(device, POST_KERNEL) - CREATE_OBJ_LEVEL(device, APPLICATION) - CREATE_OBJ_LEVEL(device, SMP) - __device_end = .; - } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - #if CONFIG_PM_DEVICE SECTION_DATA_PROLOGUE(pm_device_slots, (NOLOAD),) { diff --git a/include/linker/common-rom.ld b/include/linker/common-rom.ld index 9efd49c0fbf..dd2cfce43d0 100644 --- a/include/linker/common-rom.ld +++ b/include/linker/common-rom.ld @@ -17,6 +17,21 @@ __init_end = .; } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) + SECTION_PROLOGUE(devices,,) + { + /* Link in devices objects, which are tied to the init ones; + * the objects are thus sorted the same way as their init + * object parent. See above and include/device.h. + */ + __device_start = .; + CREATE_OBJ_LEVEL(device, PRE_KERNEL_1) + CREATE_OBJ_LEVEL(device, PRE_KERNEL_2) + CREATE_OBJ_LEVEL(device, POST_KERNEL) + CREATE_OBJ_LEVEL(device, APPLICATION) + CREATE_OBJ_LEVEL(device, SMP) + __device_end = .; + } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) + #if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS) SECTION_PROLOGUE(sw_isr_table,,) {